# Evaluating indefinite integral using substitution

I have the following integral to evaluate. I'm not sure whether to use the reverse chain rule or integration by parts, as my calculation hits a bit of a snag. Any suggestions would be appreciated!

$$\int{\frac{\ln{x}\sec^2{((\ln{x})^2)}}{x}\,\,dx}$$

My calculation involves the reverse chain rule for the following substitutions:

$$\int{g'(f(x))\cdot f(x)}\,\,dx = g(f(x)) + c$$

However, I can't figure a way to neatly factor $(\ln(x))^2$ as it just becomes messy when I integrate or find derivatives. Is there a simpler method, perhaps an identity I'm overlooking here?

Thanks!

Let $\{\ln(x)\}^2=u\implies2\dfrac{\ln(x)}x\ dx=du$
We have $\dfrac12\cdot\int\sec^2(u)\ du=\dfrac12\cdot\tan u+K$
The derivative of $(\log{x})^2$ is $$\frac{2\log{x}}{x}$$ using the chain rule, so setting $u=(\log{x})^2$, we have $du = 2x^{-1}\log{x} \, dx$, and hence the integral becomes $$\left. \frac{1}{2}\int \sec^2{u} \, du \right|_{u=(\log{x})^2} = \left. \frac{1}{2}\tan{u} \right|_{u=(\log{x})^2} + C = \frac{1}{2} \tan{((\log{x})^2)} +C$$
You can use two iterations of substitution. First, $u=\ln(x)$ and $du=\frac1x dx$. After that, $v=u^{2}$ and $dv=2udu$. Then you can solve it.