Answer
$x\displaystyle \cos(\ln x)+\frac{1}{2}x\sin(\ln x)+C$
Work Step by Step
Substitute: $\left[\begin{array}{ll}
t=\ln x & x=e^{t}\\
dt=\frac{dx}{x} & dx=e^{t}dt
\end{array}\right]$
$I=\displaystyle \int\cos(\ln x)=\int e^{t}\cos tdt$
This is very similar to the integral solved in example4.
Take $\displaystyle \left[\begin{array}{ll}
u=\cos t & dv=e^{t}dt\\
& \\
du=-\sin tdt & v=e^{t}
\end{array}\right] \qquad\int udv=uv-\int vdu,$
$I=e^{t}\displaystyle \cos t+\int e^{t}\sin tdt$
By parts, again $\left[\begin{array}{ll}
u=\sin t & dv=e^{t}dt\\
& \\
du=-\cos tdt & v=e^{t}
\end{array}\right]$
$I_{1}=\displaystyle \int e^{t}\sin tdt=e^{t}\sin t+\int-e^{t}\cos tdt$
$I_{1}=e^{t}\sin t-I_{1}$
$2I_{1}=e^{t}\sin t$
$I_{1}=\displaystyle \frac{e^{t}\sin t}{2}$
$I=e^{t}\displaystyle \cos t+\frac{e^{t}\sin t}{2}+C$
...bring back the variable x...$(t=\ln x)$
$I=x\displaystyle \cos(\ln x)+\frac{1}{2}x\sin(\ln x)+C$