# How do you integrate int (lnx)^2 by parts?

Dec 21, 2016

The answer is $= x \left({\left(\ln x\right)}^{2} - 2 \ln x + 2\right) + C$

#### Explanation:

The integration by parts is

$\int u ' v \mathrm{dx} = u v - \int u v ' \mathrm{dx}$

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

$u ' = 1$, $\implies$, $u = x$

Therefore,

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

We do theintegration by parts a second time

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

$u ' = 1$, $\implies$, $u = x$

$\int \ln x \mathrm{dx} = x \ln x - \int x \cdot \frac{1}{x} \cdot \mathrm{dx}$

$= x \ln x - x$

Therefore,

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

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

Dec 21, 2016

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

#### Explanation:

The formula for integration by parts states that:

$\int u \cdot \mathrm{dv} = u \cdot v - \int v \cdot \mathrm{du}$

In this case we take $u \left(x\right) = {\left(\ln x\right)}^{2}$ and $v \left(x\right) = x$, so that:

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

We solve this last integral again by parts:

$\int \ln x = x \ln x - \int x \cdot \left(\frac{1}{x}\right) \mathrm{dx} = x \ln x - \int \mathrm{dx} = x \ln x - x + C$

Plugging this in the previous result:

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