# Evaluate the integral?  int ln tanh(x/2)/cosh^2x dx

Jul 24, 2017

I got

$= \tanh \left(x\right) \ln \left(\tanh \left(\frac{x}{2}\right)\right) - 2 \arctan \left(\tanh \left(\frac{x}{2}\right)\right) + C$, $\text{ } x > 0$

DISCLAIMER: VERY LONG ANSWER!

Well, I don't work with hyperbolics much, but I do know that:

• the derivative of $\tanh \left(x\right)$ is still ${\sech}^{2} \left(x\right)$.
• we still have $\cosh \left(x\right) = \frac{1}{\sech \left(x\right)}$.
• we however, have that $- {\sinh}^{2} \left(x\right) + {\cosh}^{2} \left(x\right) = 1$, so that ${\tanh}^{2} \left(x\right) + {\sech}^{2} \left(x\right) = 1$ and $1 + {\csch}^{2} \left(x\right) = {\coth}^{2} \left(x\right)$.

So, we have:

$= \int {\sech}^{2} \left(x\right) \ln \left(\tanh \left(\frac{x}{2}\right)\right) \mathrm{dx}$

Now let's try an integration by parts. Let:

$u = \ln \left(\tanh \left(\frac{x}{2}\right)\right)$
$\mathrm{dv} = {\sech}^{2} \left(x\right) \mathrm{dx}$
$\mathrm{du} = \frac{{\sech}^{2} \left(\frac{x}{2}\right)}{2 \tanh \left(\frac{x}{2}\right)} \mathrm{dx}$
$v = \tanh \left(x\right)$

$u v - \int v \mathrm{du}$

$= \tanh \left(x\right) \ln \left(\tanh \left(\frac{x}{2}\right)\right) - \int \frac{\tanh \left(x\right) {\sech}^{2} \left(\frac{x}{2}\right)}{2 \tanh \left(\frac{x}{2}\right)} \mathrm{dx}$

With the above $\sech$ identity, this integral becomes:

$\int \frac{\tanh \left(x\right) {\sech}^{2} \left(\frac{x}{2}\right)}{2 \tanh \left(\frac{x}{2}\right)} \mathrm{dx}$

$= \int \frac{\tanh \left(x\right)}{2 \tanh \left(\frac{x}{2}\right)} \mathrm{dx} - \int \frac{\tanh \left(x\right) {\tanh}^{\cancel{2}} \left(\frac{x}{2}\right)}{2 \cancel{\tanh \left(\frac{x}{2}\right)}} \mathrm{dx}$

I had to look these identities up to verify them though:

• $\sinh \left(u \pm v\right) = \sinh u \cosh v \pm \cosh u \sinh v$
• $\cosh \left(u \pm v\right) = \cosh u \cosh v \pm \sinh u \sinh v$

Thus,

$\tanh \left(x\right) = \tanh \left(\frac{x}{2} + \frac{x}{2}\right) = \sinh \frac{\frac{x}{2} + \frac{x}{2}}{\cosh \left(\frac{x}{2} + \frac{x}{2}\right)}$

$= \frac{2 \sinh \left(\frac{x}{2}\right) \cosh \left(\frac{x}{2}\right)}{{\cosh}^{2} \left(\frac{x}{2}\right) + {\sinh}^{2} \left(\frac{x}{2}\right)} \times \frac{{\cosh}^{2} \left(\frac{x}{2}\right)}{{\cosh}^{2} \left(\frac{x}{2}\right)}$

$= \frac{2 \tanh \left(\frac{x}{2}\right)}{1 + {\tanh}^{2} \left(\frac{x}{2}\right)}$

Therefore, the integral becomes:

$= \int \frac{\cancel{\left(2 \tanh \left(\frac{x}{2}\right)\right)}}{\left(1 + {\tanh}^{2} \left(\frac{x}{2}\right)\right) \cancel{2 \tanh \left(\frac{x}{2}\right)}} \mathrm{dx} - \cancel{\frac{1}{2}} \int \frac{\cancel{2} \tanh \left(\frac{x}{2}\right) \tanh \left(\frac{x}{2}\right)}{1 + {\tanh}^{2} \left(\frac{x}{2}\right)} \times \frac{1 / {\tanh}^{2} \left(\frac{x}{2}\right)}{1 / {\tanh}^{2} \left(\frac{x}{2}\right)} \mathrm{dx}$

$= \underline{\int \frac{1}{1 + {\tanh}^{2} \left(\frac{x}{2}\right)} \mathrm{dx} - \int \frac{1}{{\coth}^{2} \left(\frac{x}{2}\right) + 1} \mathrm{dx}}$ $\text{ } \boldsymbol{\left(1\right) + \left(2\right)}$

For $\left(1\right)$, let $u = \tanh \left(\frac{x}{2}\right)$. Then, $\mathrm{du} = \frac{1}{2} {\sech}^{2} \left(\frac{x}{2}\right) \mathrm{dx} = \frac{1}{2} \left(1 - {\tanh}^{2} \left(\frac{x}{2}\right)\right) \mathrm{dx}$, so:

$2 \int \frac{1}{1 + {\tanh}^{2} \left(\frac{x}{2}\right)} \mathrm{dx}$

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

$= 2 \int \frac{1}{\left(1 + {u}^{2}\right) \left(1 + u\right) \left(1 - u\right)} \mathrm{du} = 2 \int \frac{A x + B}{1 + {u}^{2}} + \frac{C}{1 + u} + \frac{D}{1 - u} \mathrm{du}$

Through getting common denominators and using partial fraction decomposition, we obtain:

$A = 0 , B = \frac{1}{2} , C = \frac{1}{4} , D = - \frac{1}{4}$

This gives for $\left(1\right)$:

$\left(1\right) = 2 \cdot \left[\frac{1}{2} \arctan \left(\tanh \left(\frac{x}{2}\right)\right) + \frac{1}{4} \ln | 1 + \tanh \left(\frac{x}{2}\right) | - \frac{1}{4} \ln | 1 - \tanh \left(\frac{x}{2}\right) |\right]$

$= \underline{\arctan \left(\tanh \left(\frac{x}{2}\right)\right) + \frac{1}{2} \ln | \frac{1 + \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)} |}$

Now, for $\left(2\right)$, we obtain the same thing, except in terms of $\coth \left(\frac{x}{2}\right)$ and we account for the opposite sign out front:

$\left(2\right) = - \arctan \left(\coth \left(\frac{x}{2}\right)\right) - \frac{1}{2} \ln | \frac{1 + \coth \left(\frac{x}{2}\right)}{1 - \coth \left(\frac{x}{2}\right)} |$

$= \arctan \left(\tanh \left(\frac{x}{2}\right)\right) - \frac{1}{2} \ln | \frac{\tanh \left(\frac{x}{2}\right) + 1}{\tanh \left(\frac{x}{2}\right) - 1} |$

$= \underline{\arctan \left(\tanh \left(\frac{x}{2}\right)\right) - \frac{1}{2} \ln | \frac{1 + \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)} |}$

In adding $\left(1\right)$ and $\left(2\right)$ together, the $\ln$ terms cancel to give:

$\left(1\right) + \left(2\right) = 2 \arctan \left(\tanh \left(\frac{x}{2}\right)\right)$

Therefore, the overall integral (the answer!) is:

$\textcolor{b l u e}{\overline{\underline{| \stackrel{\text{ ")(" "tanh(x)ln(tanh(x/2)) - 2arctan(tanh(x/2)) + C" }}{|}}}}$

Jul 24, 2017

$\int \setminus \ln \tanh \frac{\frac{x}{2}}{\cosh} ^ 2 x \setminus \mathrm{dx} = \tanh \left(x\right) \setminus \ln \tanh \left(\frac{x}{2}\right) - 2 \arctan \left(\tanh \left(\frac{x}{2}\right)\right) + C$

#### Explanation:

We seek:

$I = \int \setminus \ln \tanh \frac{\frac{x}{2}}{\cosh} ^ 2 x \setminus \mathrm{dx}$

I will take a very similar approach to that of Truong-Son N. but I will simplify the expression in the integrand via an initial substitution. We can remove the half-angle via a substitution of the form:

$u = \frac{x}{2} \implies \frac{\mathrm{du}}{\mathrm{dx}} = \frac{1}{2}$ and $x = 2 u$

So then substituting into the integral, it becomes:

$I = \int \setminus \ln \tanh \frac{u}{\cosh} ^ 2 \left(2 u\right) \setminus 2 \setminus \mathrm{du}$
$\therefore \frac{I}{2} = \int \setminus \ln \tanh u \setminus {\sech}^{2} \left(2 u\right) \setminus \mathrm{du}$

Then an application of Integration By Parts (IBP) will rmove the logarithm from the integrand:

Let $\left\{\begin{matrix}U & = \ln \tanh u & \implies & U ' & = {\sech}^{2} \frac{u}{\tanh} u \\ V ' & = {\sech}^{2} \left(2 u\right) & \implies & V & = \frac{1}{2} \tanh \left(2 u\right)\end{matrix}\right.$

Then plugging into the IBP formula:

$\int \setminus \left(U\right) \left(V '\right) \setminus \mathrm{dx} = \left(U\right) \left(V\right) - \int \setminus \left(V\right) \left(U '\right) \setminus \mathrm{dx}$

Gives us

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

$\therefore \frac{I}{2} = \frac{1}{2} \setminus \tanh \left(2 u\right) \setminus \ln \tanh u - \frac{1}{2} J$
$\therefore \setminus \setminus I = \tanh \left(2 u\right) \setminus \ln \tanh u - J$ ..... [A]

Where $J = \int \setminus \tanh \left(2 u\right) \left({\sech}^{2} \frac{u}{\tanh} u\right) \setminus \mathrm{du}$, then. Using the hyperbolic identity:

$\tanh \left(2 A\right) = \frac{2 \tanh \left(A\right)}{1 + {\tanh}^{2} A}$

We have:

$J = \int \setminus \left(\frac{2 \tanh \left(u\right)}{1 + {\tanh}^{2} u}\right) \left({\sech}^{2} \frac{u}{\tanh} u\right) \setminus \mathrm{du}$
$\setminus \setminus = 2 \setminus \int \setminus \frac{{\sech}^{2} u}{1 + {\tanh}^{2} u} \setminus \mathrm{du}$

And with this second integral, a simple substitution of the form:

$v = \tanh u \implies \frac{\mathrm{dv}}{\mathrm{du}} = {\sech}^{2} u$

Gives us after substituting into $J$:

$J = 2 \setminus \int \setminus \frac{1}{1 + {v}^{2}} \setminus \mathrm{dv}$
$\setminus \setminus = 2 \arctan \left(v\right) + C '$

Inserting this result into [A] we get:

$I = \tanh \left(2 u\right) \setminus \ln \tanh u - 2 \arctan \left(v\right) + C$

And restoring the substitutions we get:

$I = \tanh \left(2 \frac{x}{2}\right) \setminus \ln \tanh \left(\frac{x}{2}\right) - 2 \arctan \left(\tanh u\right) + C$
$\setminus \setminus = \tanh \left(x\right) \setminus \ln \tanh \left(\frac{x}{2}\right) - 2 \arctan \left(\tanh \left(\frac{x}{2}\right)\right) + C$