Is $\ x\! \cdot\!\tan(x)\ $ integrable in elementary functions? I'm teaching Calculus and my students asked me to calculate the integral of $\ x\! \cdot\!\tan(x)$.
I spent quite a lot of effort to do this, but I'm now even not sure if the integral could be presented in elementary functions.
Does anybody know how to calculate it, or otherwise prove it is not integrable in elementary functions?
 A: Finding an anti-derivative of $x\tan x$ amounts to finding an anti-derivative of $f=\frac{x}{e^x+1}$. Consider the field $K=\mathbb C(x,e^x)$. Note that $K$ is closed under taking derivatives. If $f$ is elementary integrable, then Liouville's Theorem gives elements $u_i\in K$, $\gamma_i\in\mathbb C$, $v\in K$ with
\begin{equation}
\frac{x}{e^x+1}=\sum\gamma_i\frac{u_i'}{u_i}+v'.
\end{equation}
Consider the $u_i$ and $v$ as rational functions in $e^x$ with coeffcients in $\mathbb C(x)$. By the property of the logarithmic derivative we may assume that the $u_i$ are actually distinct irreducible monic polynomials with respect to $e^x$, or elements from $\mathbb C(x)$.
Looking at poles (with respect to the `variable' $e^x$) shows that at most one of the $u_i$ is $e^x+1$, and the other $u_i$'s are in $\mathbb C(x)$. Similarly, we see that $v\in\mathbb C(x)$. So there indeed must be one index $i$ with $u_i=e^x+1$. However, $\frac{x}{e^x+1}-\gamma_i\frac{u_i'}{u_i}=\frac{x}{e^x+1}-\gamma_i\frac{e^x}{e^x+1}$ isn't in $\mathbb C(x)$, a contradiction.
Remark: The argument given here is somewhat sketchy, some routine details need to be filled in, like that $u_i'$ and $u_i$, as polynomials in $e^x$, are relatively prime. A beautiful paper about Liouville's Theorem is Rosenlicht's article Integration in finite terms. My argument somewhat follows Rosenlicht's example of finding an anti-derivative of $f(x)e^{g(x)}$, where $f$ and $g$ are rational functions.
A: Edit (6/14/14): I maintain that Peter Mueller's answer should be accepted, since he has essentially carried out the proof using Liouville's Theorem (mentioned below) to show that the integrand under question cannot be expressed in elementary functions. However, in addition to my previous unsuccessful attack, I thought I would also point to a full argument in the following source:

Bronstein, M. (1998). Symbolic integration tutorial. INRIA Sophia Antipolis ISSAC. Link.

as well as the author's self-cited:

(4) M. Bronstein. Symbolic Integration I – Transcendental Functions. Springer, Heidelberg, 1997. 2nd Ed., 2004.

In particular, see Section 3.3. Here is an excerpt (see the paper for the definition of special):


Some thoughts on this antiderivative:
Attacking $\log(\cos x)$ using integration by parts, we find:
$$\int \log(\cos x) = x\log(\cos x) + \int x \tan x dx$$
So the question has now become: how do we find an antiderivative for log(cos x)?
Next, we observe that
$$\cos x = \frac{1}{2}(e^{ix} + e^{-ix}) = \frac{1}{2}e^{ix}(1 + e^{-2ix})$$
Taking the log of this, we end up with:
$$-\log 2 + ix + \log(1 + e^{-2ix})$$
Recall that we can write
$$\log(1 + y) = \sum_{k = 1}^{\infty} \frac{(-1)^{k+1}y^{k}}{k}$$
We can now apply this with  $y = e^{-2ix}$ as above and integrate term by term.
Putting all these pieces together will give you a (nasty) way to integrate $x\tan x$.
As far as showing it's not integrable in elementary functions, I suspect your best bet would be an appeal to a theorem of Liouville. See, for example, this link.
All that said, perhaps you could ask your students some form of the following: show
$$\int x\tan^{2}x dx = x\tan x - \frac{x^2}{2} + \log(\cos x) + C$$
(You can find this latter, more tractable problem and its solution written out in nice detail here.)
A: $\int x \tan x \,dx=\frac{1}{2} i \text{Li}_2\left(-e^{2 i x}\right)+\frac{i x^2}{2}-x \log\left(1+e^{2 i x}\right)+C $
Where $\text{Li}_2$ is the dilogarithm function
A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\down}{\downarrow}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
In general, we can consider the integral
$\ds{\int_{0}^{a}x\tan\pars{x}\,\dd x = -a\ln\pars{\cos\pars{a}} + \int_{0}^{a}\ln\pars{\cos\pars{x}}\,\dd x}$
with $\ds{\cos\pars{a} > 0}$:
\begin{align}
\int_{0}^{a}\ln\pars{\cos\pars{x}}\,\dd x&=
-\int_{1}^{\cos\pars{a}}{\ln\pars{x} \over \root{1 - x^{2}}}\,\dd x
=
-\,\half\int_{1}^{\cos^{1/2}\pars{a}}{x^{-1/2}\ln\pars{x^{1/2}} \over \root{1 - x}}\,\dd x
\\[3mm]&=
{1 \over 4}\lim_{\mu \to -1/2}\partiald{}{\mu}\int^{1}_{\cos^{1/2}\pars{a}}x^{\mu}
\pars{1 - x}^{-1/2}\,\dd x
\\[3mm]&=
{1 \over 4}\lim_{\mu \to -1/2}\partiald{}{\mu}\bracks{%
\int_{0}^{1}x^{\mu}\pars{1 - x}^{-1/2}\,\dd x
-
\int_{0}^{\cos^{1/2}\pars{a}}x^{\mu}\pars{1 - x}^{-1/2}\,\dd x}
\\[3mm]&=
{1 \over 4}\lim_{\mu \to -1/2}\partiald{}{\mu}\bracks{%
{\rm B}\pars{\mu + 1,\half} - {\rm B}_{\cos^{1/2}\pars{a}}\pars{\mu + 1,\half}}
\end{align}
where
$\ds{{\rm B}\pars{p,q} = {\Gamma\pars{p}\Gamma\pars{q} \over \Gamma\pars{p + q}}}$ and
$\ds{{\rm B}_{x}\pars{p,q}
 = {x^{p} \over q}\ _{\large 2\atop}\!{\rm F}_{1}\pars{p,1 - q;p + 1,x}}$ are the $\it Beta$  and the $\it\mbox{Incomplete Beta}$ functions, respectively. 
$\ds{_{\large 2\atop}\!{\rm F}_{1}}$ is a $\it hypergeometric$ function.

\begin{align}
&\int_{0}^{a}\ln\pars{\cos\pars{x}}\,\dd x
\\[3mm]&=-\,\half\,\pi\ln\pars{2}
-
{1 \over 4}\lim_{\mu \to -1/2}\partiald{}{\mu}\bracks{%
2{\cos^{\pars{\mu + 1}/2}\pars{a}}
\ _{\large 2\atop}\!{\rm F}_{1}\pars{\mu + 1,\half;\mu + 2,\cos^{1/2}\pars{a}}}
\end{align}

