# How do I evaluate int(ln(3x))^2 dx?

Jan 31, 2015

Using Integration by substitution I set: $\ln \left(3 x\right) = t$ so:
$3 x = {e}^{t}$
$x = {e}^{t} / 3$ and
$\mathrm{dx} = \frac{1}{3} {e}^{t} \mathrm{dt}$

$\int {t}^{2} \cdot \frac{1}{3} {e}^{t} \mathrm{dt} =$

Which can now be solved by parts (twice).

By parts you have:

$\int f \left(x\right) \cdot g \left(x\right) \mathrm{dx} = F \left(x\right) \cdot g \left(x\right) - \int F \left(x\right) \cdot g ' \left(x\right) \mathrm{dx}$

Where:

$F \left(x\right) = \int f \left(x\right) \mathrm{dy}$
$g ' \left(x\right)$ is the derivative of $g \left(x\right)$
We can choose:
$f \left(x\right) = {e}^{t}$
$g \left(x\right) = {t}^{2}$

The integral becomes:

$\int {t}^{2} \cdot \frac{1}{3} {e}^{t} \mathrm{dt} = \frac{1}{3} \left[{e}^{t} \cdot {t}^{2} - \int {e}^{t} 2 t \mathrm{dt}\right] =$ by parts again:
$= \frac{1}{3} \left[{e}^{t} \cdot {t}^{2} - {e}^{t} \cdot 2 t + \int {e}^{t} \cdot 2 \mathrm{dt}\right] =$
$\frac{1}{3} \left[{e}^{t} \cdot {t}^{2} - {e}^{t} \cdot 2 t + 2 \cdot {e}^{t}\right] =$
$\frac{1}{3} {e}^{t} \left({t}^{2} - 2 t + 2\right)$
but $\ln \left(3 x\right) = t$ so going back to $x$:
$= \frac{1}{3} \cdot 3 x \left({\ln}^{2} \left(3 x\right) - 2 \ln \left(3 x\right) + 2\right) + c$
$= x \left({\ln}^{2} \left(3 x\right) - 2 \ln \left(3 x\right) + 2\right) + c$