TITLE: What is the integral of $e^x \tan(x)$?
QUESTION [11 upvotes]: What is the integral of $e^x \tan(x)$? Using basic theorems it is difficult to get I think.

REPLY [9 votes]: $$\tan(x) = -i \frac{1-e^{-2ix}}{1+e^{-2ix}} = -i - 2 i \sum_{k=1}^\infty (-1)^k e^{-2ikx}$$ 
(converging for $\text{Im}(x) < 0$)
$$\begin{align}
\int e^x \tan(x)\ dx &= -i e^x - 2 i \sum_{k=1}^\infty (-1)^k \int e^{(1-2ik)x}\ dx \\
&= -i e^x -2i \sum_{k=1}^\infty \frac{(-1)^k}{1-2ik} e^{(1-2ik)x} + C \\
&= -i{{ e}^{x}}-{\rm LerchPhi} \left( -{{ e}^{-2ix}},1,1+i/2
 \right) {{ e}^{(1-2i)x}} + C
\end{align}$$
This Lerch Phi function can also be expressed in terms of a hypergeometric function:
$${\rm LerchPhi} \left( z,1,1+\frac{i}{2} \right) = \frac{ 4-2i
 }{5} \ {\mbox{$_2$F$_1$}\left(1,1+\frac{i}{2};2+\frac{i}{2};z\right)}$$