Evaluate $\int\cos(\ln x^2)dx$ $$\int\cos(\ln x^2)dx$$
I've learned substitution method, integration by parts, and some other basic methods for integration, but I have no idea how to start this question.
How should I start this question?
 A: For ease, let's write $\ln x^2 = 2 \ln x$. If you do the substitution $u = 2 \ln x$, so that $\frac{du}{dx} = \frac{2}{x}$ and $x = e^{u/2}$, then you end up with
$$\frac 12 \int e^{u/2} \cos u \;\mathrm{d}u,$$
which can be done quickly with $2$ integration by parts (and which is a classical integration by parts problem).
A: Rewrite
$$
\int\cos(\ln x^2)dx=\int\cos(2\ln x)dx.
$$
Using IBP by taking $u=\cos(2\ln x)\;\Rightarrow\;du=-\dfrac2x\sin(2\ln x)\ dx$ and $dv=dx\;\Rightarrow\;v=x\,$ yields
$$
\int\cos(2\ln x)dx=x\cos(2\ln x)+2\int\sin(2\ln x)dx+C_1.\tag1
$$
Again using IBP by taking $u=\sin(2\ln x)\;\Rightarrow\;du=\dfrac2x\cos(2\ln x)\ dx$ and $dv=dx\;\Rightarrow\;v=x$ yields
$$
\int\sin(\ln x^2)dx=x\sin(2\ln x)-2\int\cos(2\ln x)dx+C_2.\tag2
$$
Plug in $(2)$ to $(1)$ yields
\begin{align}
\int\cos(2\ln x)dx&=x\cos(2\ln x)+2x\sin(2\ln x)-4\int\cos(2\ln x)dx+K\\
5\int\cos(2\ln x)dx&=x\cos(\ln x^2)+2x\sin(\ln x^2)+K.
\end{align}
A: taking $t=\ln x$ you get $dx=e^t dt$
$$\int\cos(\ln x^2)dx=\int\cos(2t)e^t dt=:I$$
Integrating by parts twice you get
$$I=\int\cos(2t)e^t dt=e^t\cos(2t)+2\int\sin(2t)e^t dt+C=$$
$$=e^t\cos(2t)+2\left(e^t\sin(2t) - 2\int\cos(2t)e^t dt\right)+C=$$
$$=e^t\cos(2t)+2e^t\sin(2t)-4I +C\ .$$
Thus,
$$I=\frac{1}{5}\left(e^t\cos(2t)+2e^t\sin(2t)\right)+C=\frac{1}{5}\left(x\cos(\ln x^2)+2x\sin(\ln x^2)\right)+C$$
A: Using the fact that $\cos \theta=\text{Re }e^{i\theta}$,
$$
\begin{align*}
\int \cos(\log x^2)\; dx &= \text{Re}\int e^{2i \log x} \; dx \\
&= \text{Re} \int x^{2i}\; dx \\
&= \text{Re}\left(\frac{x^{1+2i}}{1+2i} \right) \\
&= \frac{x}{5}\text{Re} \left( x^{2i} (1-2i)\right) \\
&= \frac{x}{5}\text{Re} \left( (\cos(2\log x)+i\sin(2\log x) ) (1-2i)\right)\\
&= x\frac{ \cos(2\log x)+2 \sin(2\log x)}{5}+C
\end{align*}
$$
