# U-Substitution with Integration by Parts

I've been told to evaluate the indefinite integral of this function:

$$\int \sin {\ln {x}} dx$$

I'm supposed to make a $u$-substitution in the beginning, then complete it using integration by parts. Every time I try, I just end up going in circles. Could someone please help me? Thanks!

Hint: Let $u = \ln{x}$. Then $du = \frac{1}{x} dx$, or $x du = dx$. Using the fact that $x = e^u$, we can write

$$\int \sin \ln{x} dx = \int e^u \sin{u}du$$

This is a common integral that can be done by using parts twice, or by recognizing that

$$\sin{u} = \operatorname{Im} e^{iu}$$

This integral can be done directly by using parts twice,

$$u=\sin(\ln x)\Rightarrow du=\dfrac{\cos(\ln x)}{x}\,dx$$ and $$dv=dx \Rightarrow v=x$$

$$\therefore\;\;\int\sin(\ln x)\, dx = x\sin(\ln x)- \int\cos(\ln x)\, dx$$

$$u= \cos(\ln x)\Rightarrow du= -\dfrac{\sin(\ln x)}{x}\,dx$$ and $$dv=dx \Rightarrow v=x$$

$$\therefore\;\; \int\sin(\ln x)\, dx = x\sin(\ln x)- \left[x\cos(\ln x)+\int\sin(\ln x)\, dx\right]$$

We now add $$\int\sin(\ln x)\, dx$$ to the left and clear,

$$\therefore\;\; \int\sin(\ln x)\, dx = \dfrac{x\sin(\ln x)- x\cos(\ln x)}{2}+C$$