I'm asked to find the anti-derivative of $\cos (\ln x)$.
Here is my approach : $$\int \cos (\ln x) \, \mathrm dx$$ $$=\int \dfrac{e^{i\ln x}+e^{-i\ln x}}{2} \, \mathrm dx$$ $$=\int \dfrac{x^i+x^{-i}}{2} \, \mathrm dx$$
Then I get stuck. $\cos (\ln x)$ has an elementary, real-valued anti-derivative. So, how do I get to that now? Any help would be appreciated.
Substitute $u=\ln\left(x\right)$ thus $\mathrm{d}x=x\,\mathrm{d}u$ $$I={\displaystyle\int}\mathrm{e}^u\cos\left(u\right)\,\mathrm{d}u$$
$$I=e^ucos(u)+\int e^u\sin u \mathrm{d}u$$ $$I=e^ucos(u)+e^u\sin u -\int e^u \cos u \mathrm{d}u$$ $$2I=e^ucos(u)+e^u\sin u$$ $$I=\frac{e^u}{2}(\cos u+\sin u)+C$$ $$I=\frac{x}{2}(\cos \ln x+\sin \ln x)+C$$