Evaluate the integral int \ x/(cosx-1) \ dx ?

Nov 5, 2017

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

Explanation:

We seek:

$I = \int \setminus \frac{x}{\cos x - 1} \setminus \mathrm{dx}$ ..... [A]

We can apply Integration By Parts, but prior to this, let us consider:

${I}_{1} = \int \setminus \frac{1}{\cos x - 1} \setminus \mathrm{dx}$

For this we can use the tangent half angle identity:

$\cos \alpha = \frac{1 - {\tan}^{2} \left(\frac{\alpha}{2}\right)}{1 + {\tan}^{2} \left(\frac{\alpha}{2}\right)}$

Which gives us:

${I}_{1} = \int \setminus \frac{1}{\frac{1 - {\tan}^{2} \left(\frac{x}{2}\right)}{1 + {\tan}^{2} \left(\frac{x}{2}\right)} - 1} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = \int \setminus \frac{1}{\frac{1 - {\tan}^{2} \left(\frac{x}{2}\right) - \left(1 + {\tan}^{2} \left(\frac{x}{2}\right)\right)}{1 + {\tan}^{2} \left(\frac{x}{2}\right)}} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = \int \setminus \frac{1 + {\tan}^{2} \left(\frac{x}{2}\right)}{1 - {\tan}^{2} \left(\frac{x}{2}\right) - 1 - {\tan}^{2} \left(\frac{x}{2}\right)} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = \int \setminus \frac{1 + {\tan}^{2} \left(\frac{x}{2}\right)}{- 2 {\tan}^{2} \left(\frac{x}{2}\right)} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = \int \setminus \frac{{\sec}^{2} \left(\frac{x}{2}\right)}{- 2 {\tan}^{2} \left(\frac{x}{2}\right)} \setminus \mathrm{dx}$

We can perform a substitution of the form:

$u = \tan \left(\frac{x}{2}\right) \implies \frac{\mathrm{du}}{\mathrm{dx}} = \frac{1}{2} {\sec}^{2} \left(\frac{x}{2}\right)$

If we substitute into the integral, we get:

${I}_{1} = \int - \frac{1}{u} ^ 2 \setminus \mathrm{du}$
$\setminus \setminus \setminus = \frac{1}{u} + C$

And restoring the earlier substitution, we get:

${I}_{1} = \frac{1}{\tan} \left(\frac{x}{2}\right) + C$
$\setminus \setminus \setminus = \cot \left(\frac{x}{2}\right) + C$

Now, let us return to the original integral [A], and apply Integration By Parts, using this result:

Let  { (u,=x, => (du)/dx,=1), ((dv)/dx,=1/(cosx-1), => v,=cot(x/2) ) :}

Then plugging into the IBP formula:

$\int \setminus \left(u\right) \left(\frac{\mathrm{dv}}{\mathrm{dx}}\right) \setminus \mathrm{dx} = \left(u\right) \left(v\right) - \int \setminus \left(v\right) \left(\frac{\mathrm{du}}{\mathrm{dx}}\right) \setminus \mathrm{dx}$

Gives us

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

$\therefore I = x \cot \left(\frac{x}{2}\right) - \int \setminus \cot \left(\frac{x}{2}\right) \setminus \mathrm{dx} + C$

And now we can manipulate the second integral:

${I}_{2} = \int \setminus \cot \left(\frac{x}{2}\right) \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus \cos \frac{\frac{x}{2}}{\sin} \left(\frac{x}{2}\right) \setminus \mathrm{dx}$

We can apply the substitution

$u = \sin \left(\frac{x}{2}\right) \implies \frac{\mathrm{du}}{\mathrm{dx}} = \frac{1}{2} \cos \left(\frac{x}{2}\right)$

Substituting, we get:

${I}_{2} = \int \setminus \left(2\right) \frac{\frac{1}{2} \cos \left(\frac{x}{2}\right)}{\sin} \left(\frac{x}{2}\right) \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus \left(2\right) \left(\frac{1}{u}\right) \setminus \mathrm{du}$
$\setminus \setminus \setminus = 2 \ln | u |$

And restoring the substitution we get:

${I}_{2} = 2 \ln | \sin \left(\frac{x}{2}\right) |$

Then, combining our results we have:

$I = x \cot \left(\frac{x}{2}\right) - 2 \ln | \sin \left(\frac{x}{2}\right) | + C$