\(I=\int cos\left(lnx\right)dx\) \(\Rightarrow\left\{{}\begin{matrix}u=cos\left(lnx\right)\\dv=dx\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}du=\dfrac{-sin\left(lnx\right)}{x}dx\\v=x\end{matrix}\right.\)
\(\Rightarrow I=x.cos\left(lnx\right)+\int sin\left(lnx\right)dx=x.cos\left(lnx\right)+I_1\)
Xét \(I_1=\int sin\left(lnx\right)dx\) \(\Rightarrow\left\{{}\begin{matrix}u=sin\left(lnx\right)\\dv=dx\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}du=\dfrac{cos\left(lnx\right)}{x}dx\\v=x\end{matrix}\right.\)
\(\Rightarrow I_1=x.sin\left(lnx\right)-\int cos\left(lnx\right)dx=x.sin\left(lnx\right)-I\)
\(\Rightarrow I=x.cos\left(lnx\right)+x.sin\left(lnx\right)-I\Rightarrow2I=x.cos\left(lnx\right)+x.sin\left(lnx\right)\)
\(\Rightarrow I=\dfrac{x}{2}\left(cos\left(lnx\right)+sin\left(lnx\right)\right)+C\)