# A very difficult integral involving integration by parts.

Some fellow students were talking in a room a while back and apparently they're calculus professor told them a random integral they wrote up was "unsolvable" at the calculus semester 2 level.

The integral was $x \tan(x)$.

To try and see if I could solve it for them (out of curiosity) I was able to do the following by the method of integration of parts:

$\int x \tan(x) dx = x \int \tan(x) dx - \int \int \tan(x) dxdx$

Then by plugging in the integral of tangent:

$-x\ln|\cos(x)| + \int \ln|\cos(x)|dx$

The absolute value of cos can be rewritten as the absolute value of sin which can be rewritten via modulo:

$-x\ln|\cos(x)| + \int \ln|\sin(x+\frac \pi2)|dx = -x\ln|\cos(x)| + \int \ln\sin((x - \frac \pi2) \mod \pi) dx$

I can completely substitute away the modulo operation as I know how to adjust for such a substitution in the general case. (I presumed that this was the issue the professor referred to as most students do not learn of such functions). That leaves me with:

$-x\ln|\cos(x)| + \int \ln\sin(u)du$

This gets me to the final issue I cannot seem to solve. What is the integral of ln(sin(x))? I hear it has no closed form, yet when me and the other students looked it up, it said something about "poly-logarithms"? Is that some kind of made up function used to define an integral with no closed form? What does it mean?

• The integral in question can be written in terms of the dilogarithm function $\text{Li}_2(z)$, which can be expressed as $$\text{Li}_2(z)=-\int_0^z \frac{\log(1-z')}{z'}\,dz'$$ for $z\in \mathbb{C}-[1,\infty)$. – Mark Viola Jun 28 '16 at 2:43
• @Dr.MV as far as I was aware, this was a real valued functiom integration. Does some transition to complex numbers take place? That would make sense I suppose. I hear that particular professor tends to teach complex number stuff in basic calculus. – The Great Duck Jun 28 '16 at 2:45
• Obviously, if the definition holds for complex values, it holds for those complex numbers with zero imaginary parts. But, one may write the answer using complex components. – Mark Viola Jun 28 '16 at 2:48
• @Dr.MV oh yeah, you're right. I dont know what I was thinking. XD – The Great Duck Jun 28 '16 at 2:49
• Closely related (duplicate?): math.stackexchange.com/questions/740911/what-is-int-x-tanxdx – Martin Sleziak Jun 28 '16 at 18:51

Let $I$ be the indefinite integral given

$$I=\int x\tan(x)\,dx \tag 1$$

Integrating by parts the integral in $(1)$ with $u=x$ and $v=\log(\cos(x))$ reveals

\begin{align} I&=-x\log(\cos(x))+\int \log(\cos(x))\,dx \\\\ &=-x\log(\cos(x))+\int \log\left(\frac{e^{ix}+e^{-ix}}{2}\right)\,dx \\\\ &=-x\log(\cos(x))-\log(2)x+\int \log\left(e^{ix}+e^{-ix}\right)\,dx\\\\ &=-x\log(\cos(x))-\log(2)x-\frac i2 x^2 +\int \log\left(1+e^{i2x}\right)\,dx\tag 2 \end{align}

Now, enforcing the substitution $u=-e^{i2x}$ in the integral of $(2)$ reveals

\begin{align} \int \log(1+e^{i2x})\,dx&=\int \frac{\log(1-u)}{i2u}\,du\\\\ &= \frac i2 \text{Li}_2(-e^{i2x}) \tag 3 \end{align}

Substituting $(3)$ in $(2)$ yields

\begin{align} I&=-x\log(\cos(x))-\log(2)x-\frac i2 x^2+\frac i2 \text{Li}_2(-e^{i2x})+C\\\\ &=\bbox[5px,border:2px solid #C0A000]{-x\log\left(1+e^{i2x}\right)+\frac i2 x^2+\frac i2 \text{Li}_2(-e^{i2x})+C} \end{align}

• Comments are not for extended discussion; this conversation has been moved to chat. – Daniel Fischer Jun 29 '16 at 11:23
• @Dr.MV it's not a "best" vote. It's an answered vote. No. The revoke was in error. Wrong post. – The Great Duck Jan 19 '17 at 3:56
• Thank you, much appreciative. – Mark Viola Jan 19 '17 at 4:08