Integrating by parts:
I'm having a hard time choosing the $u$, $du$, $v$ and $dv$... I gave it a shot.
$u = \ln x \implies du = 1/x \ dx$
$v= \ ?$ $dv = \cos \ dx$
$\endgroup$ 05 Answers
$\begingroup$Choose $u = \cos\log x$ and $dv = dx$.
$$\int \cos\log x \; dx = x\cos\log x + \int \sin\log x \; dx.$$
For the second integral choose $u = \sin \log x$ and $dv = dx$.
$$\int \sin\log x \; dx = x\sin\log x-\int \cos\log x \; dx.$$
We then have
$$\int \cos\log x \; dx = x\cos\log x + x\sin\log x- \int \cos\log x \; dx.$$
$$= \frac{x}{2} \sin \log x + \frac{x}{2}\cos\log x + K.$$
$\endgroup$ 10 $\begingroup$I think you're better off using $u$-substitution here. Setting $\ln x = u$, you get $du = \frac{dx}{x} = \frac{dx}{e^u}$, and so, $dx = e^u\,du$. Then, your integral becomes $$\int \cos\left( \ln x \right) \, dx = \int e^u\cos u \, du,$$ which you can evaluate by using integration by parts twice.
$\endgroup$ 4 $\begingroup$Hint: $\int \cos(\ln(x)) dx= \int \cos(u)xdu=\int \cos(u)e^{u}du$
$\endgroup$ $\begingroup$$$ \int \cos(\ln x)\ dx $$ $$ \mbox{Let}\ u=\ln x \Rightarrow du=\frac{1}{x}dx\Rightarrow e^udu =dx $$ $$ \int e^u\cos u\ du $$ Now we can use the fact that $$ \int e^{\alpha u}\cos(\beta u)\ du =\frac{e^{\alpha u}(\alpha\cos(\beta u)+\beta\sin(\beta u))}{\alpha^2+\beta^2}+C $$ To see that $$ \int e^u\cos u\ du= \frac{e^{u}(\cos u+\sin u)}{2} +C $$ Therefore $$ \int \cos(\ln x)\ dx = \frac{1}{2}x(\cos(\ln x)+\sin(\ln x)) +C $$
$\endgroup$ $\begingroup$Hint
Another possible way starting with $$I=\int \cos(\ln(x)) dx= \int \cos(u)xdu=\int \cos(u)e^{u}du$$ $$J=\int \sin(\ln(x)) dx= \int \sin(u)xdu=\int \sin(u)e^{u}du$$ So $$I+iJ=\int e^{(1+i)u}du=\frac{1}{1+i}e^{(1+i)u}=\frac{1}{2}(1-i)e^u(\cos(u)+i\sin(u))$$ Take the real part as $I$ and the imaginary part for $J$.
$\endgroup$