# How do you integrate cos(log(x)) dx?

May 14, 2015

(I will assume $\log x$ is natural log. (If not, insert ln10 where needed.)

$\int \cos \left(\log \left(x\right)\right) \mathrm{dx} = \int x \cos \left(\log \left(x\right)\right) \cdot \frac{1}{x} \mathrm{dx}$

Let $u = x$ and $\mathrm{dv}$ is the rest of the integrand.
Now we can integrate $v = \int \cos \left(\log \left(x\right)\right) \cdot \frac{1}{x} \mathrm{dx} = \sin \left(\log \left(x\right)\right)$
(Use substitution with $w = \log \left(x\right)$)

Parts gives us:

$\int \cos \left(\log \left(x\right)\right) \mathrm{dx} = x \sin \left(\log \left(x\right)\right) - \int \sin \left(\log \left(x\right)\right) \mathrm{dx}$

Do the same trick again to get

$\int \cos \left(\log \left(x\right)\right) \mathrm{dx} = x \sin \left(\log \left(x\right)\right) + x \cos \left(\log \left(x\right)\right) - \int \cos \left(\log \left(x\right)\right) \mathrm{dx}$

So

$\int \cos \left(\log \left(x\right)\right) \mathrm{dx} = \frac{1}{2} \left(x \sin \left(\log \left(x\right)\right) + x \cos \left(\log \left(x\right)\right)\right)$