# How do you evaluate the integral int tanthetaln(sintheta)?

Dec 3, 2017

$- \frac{1}{2} \left[\ln \left(\sin \left(x\right)\right) \ln \left(\sin \left(x\right) + 1\right) + L {i}_{2} \left(- \sin \left(x\right)\right) - L {i}_{2} \left(1 - \sin \left(x\right)\right)\right]$

#### Explanation:

We will begin by using the $\tan \left(\phi\right) = \sin \frac{\phi}{\cos} \left(\phi\right)$ identity to rewrite the integral:
$\int \setminus \tan \left(x\right) \ln \left(\sin \left(x\right)\right) \setminus \mathrm{dx} = \int \setminus \sin \frac{x}{\cos} \left(x\right) \ln \left(\sin \left(x\right)\right) \setminus \mathrm{dx}$

Next we will multiply on the top and bottom by $\cos \left(x\right)$ so we can use the Pythagorean identity:
$\int \setminus \cos \left(x\right) \left(\frac{\sin \left(x\right) \ln \left(\sin \left(x\right)\right)}{\cos} ^ 2 \left(x\right)\right) \setminus \mathrm{dx}$

$= \int \setminus \cos \left(x\right) \left(\frac{\sin \left(x\right) \ln \left(\sin \left(x\right)\right)}{1 - {\sin}^{2} \left(x\right)}\right) \setminus \mathrm{dx}$

Now we can let $u = \sin \left(x\right)$ and divide by $\frac{\mathrm{du}}{\mathrm{dx}} = \cos \left(x\right)$
$= \int \setminus \cancel{\cos \frac{x}{\cos} \left(x\right)} \left(\frac{\sin \left(x\right) \ln \left(\sin \left(x\right)\right)}{1 - {\sin}^{2} \left(x\right)}\right) \setminus \mathrm{du}$

$= \int \setminus \frac{u \setminus \ln \left(u\right)}{1 - {u}^{2}} \setminus \mathrm{du}$

Now we need to do partial fractions. I will bring out a $- 1$ out of the bottom to make factoring easier:
$= \int \setminus \frac{u \setminus \ln \left(u\right)}{-} \left(- 1 + {u}^{2}\right) \setminus \mathrm{du} = - \int \setminus \frac{u \setminus \ln \left(u\right)}{{u}^{2} - 1}$

$= - \int \setminus \frac{u \setminus \ln \left(u\right)}{\left(u + 1\right) \left(u - 1\right)} \setminus \mathrm{du}$

Now we do partial fractions:
$\frac{u \setminus \ln \left(u\right)}{\left(u + 1\right) \left(u - 1\right)} = \frac{A}{u + 1} + \frac{B}{u - 1}$

After multiplying by the left hand side denominator, we're left with:
$u \setminus \ln \left(u\right) = A \left(u - 1\right) + B \left(u + 1\right)$

If we expand, setup an equation system and solve, we get:
$A = B = \frac{1}{2} \ln \left(u\right)$

Now our integral has become:
$- \int \setminus \frac{u \setminus \ln \left(u\right)}{{u}^{2} - 1} \setminus \mathrm{du} = - \frac{1}{2} \left(\int \setminus \ln \frac{u}{u + 1} \setminus \mathrm{du} + \int \setminus \ln \frac{u}{u - 1} \setminus \mathrm{du}\right)$

I will call the left one Integral 1 and the right one Integral 2.

Integral 1
Here we have to do integration by parts with $f = \ln \left(u\right)$ and $g ' = \frac{1}{u + 1}$

We know $f ' = \frac{1}{u}$ and $g = \ln | u + 1 |$, so we get:
$\int \setminus \ln \frac{u}{u + 1} \setminus \mathrm{du} = \ln \left(u\right) \ln | u + 1 | - \int \setminus \ln \frac{u + 1}{u} \setminus \mathrm{du}$

I will call this rightmost integral Integral 3

Integral 3
This integral has no elementary solution, but we see that it is relatively close to the form for the dilogarithm, which looks like this:
$L {i}_{2} \left(t\right) = \int - \ln \frac{1 - t}{t} \setminus \mathrm{dt}$

If we introduce a substitution, $z = - u$ and $\frac{\mathrm{dz}}{\mathrm{du}} = - 1$, we can get the integral to this form:
$- \int \setminus \ln \frac{1 - z}{-} z \setminus \mathrm{dz} = - \int - \ln \frac{1 - z}{z} \setminus \mathrm{dz} = - L {i}_{2} \left(z\right)$

If we resubstitute, we get that Integral 3 is equal to:
$- L {i}_{2} \left(- u\right)$

Completing Integral 1
We have evaluated Integral 3, so if we plug in, we get:
$\int \setminus \ln \frac{u}{u + 1} \setminus \mathrm{du} = \ln \left(u\right) \ln | u + 1 | + L {i}_{2} \left(- u\right)$

Integral 2
This integral can also be reduced into the dilogarithm. This time we will introduce a substitution with $z = u - 1$:
$\int \setminus \ln \frac{u}{u - 1} \setminus \mathrm{du} = \int \setminus \ln \frac{z + 1}{z} \setminus \mathrm{dz}$

This is the same as Integral 3, so we get:
$\int \setminus \ln \frac{z + 1}{z} \setminus \mathrm{dz} = - L {i}_{2} \left(- z\right) = - L {i}_{2} \left(1 - u\right)$

Completing the original integral
Now that we have evaluated Integral 1 and Integral 2, we can combine them to get our final answer:
$- \int \setminus \frac{u \setminus \ln \left(u\right)}{{u}^{2} - 1} \setminus \mathrm{du} = - \frac{1}{2} \left(\ln \left(u\right) \ln | u + 1 | + L {i}_{2} \left(- u\right) - L {i}_{2} \left(1 - u\right)\right)$

If we resubstitute and see that $\sin \left(x\right) + 1$ is never negative, so we can remove the absolute value, we have:
$- \frac{1}{2} \left[\ln \left(\sin \left(x\right)\right) \ln \left(\sin \left(x\right) + 1\right) + L {i}_{2} \left(- \sin \left(x\right)\right) - L {i}_{2} \left(1 - \sin \left(x\right)\right)\right]$