# What is int ((1+lnx)/x)^2dx?

May 24, 2018

The answer is $= - \frac{5}{x} - 4 \ln \frac{| x |}{x} - {\left(\ln \left(| x |\right)\right)}^{2} / x + C$

#### Explanation:

The integral is

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

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

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

$= {I}_{1} + {I}_{2} + {I}_{3}$

Therefore,

${I}_{1} = \int \frac{\mathrm{dx}}{x} ^ 2 = \int {x}^{-} 2 \mathrm{dx} = - \frac{1}{x}$

For the calculation of ${I}_{2}$, perform an integration by parts

$\int u v ' = u v - \int u ' v$

$u = \ln x$, $\implies$, $u ' = \frac{1}{x}$

$v ' = \frac{2}{x} ^ 2$, $\implies$, $v = - \frac{2}{x}$

So,

${I}_{2} = - 2 \ln \frac{x}{x} - 2 \int \frac{- \mathrm{dx}}{x} ^ 2$

$= - 2 \ln \frac{x}{x} - \frac{2}{x}$

For the calculation of ${I}_{3}$, perform an integration by parts

$u = {\left(\ln x\right)}^{2}$, $\implies$, $u ' = 2 \ln \frac{x}{x}$

$v ' = \frac{1}{x} ^ 2$, $\implies$, $v = - \frac{1}{x}$

${I}_{3} = - {\left(\ln x\right)}^{2} / x - 2 \int \frac{- \ln x \mathrm{dx}}{x} ^ 2$

$= - {\left(\ln x\right)}^{2} / x - 2 \ln \frac{x}{x} - \frac{2}{x}$

Finally,

$I = {I}_{1} + {I}_{2} + {I}_{3}$

$= - \frac{1}{x} - 2 \ln \frac{x}{x} - \frac{2}{x} - {\left(\ln x\right)}^{2} / x - 2 \ln \frac{x}{x} - \frac{2}{x} + C$

$= - \frac{5}{x} - 4 \ln \frac{x}{x} - {\left(\ln x\right)}^{2} / x + C$