I tried to calculate this integral: $$\int \sin(\ln(x))\,dx$$ but it seems my result is wrong. My calculation is: $$\int \sin(\ln(x)) \,dx = \left| \begin{array}{c} u=\ln x \\ du=(1/x)dx\\ dx=xdu \end{array} \right|$$ with integration by parts: $$-\cos(u)x-\int -\cos(u) dx$$ $$-\cos(u)x+\sin(u)$$ $$\sin(ln|x|)-\cos(\ln|x|)x +C$$ The answer in the website is: $$0.5[\sin(\ln(x))x-\cos(\ln(x))x]$$
What did I do wrong?
$\endgroup$ 13 Answers
$\begingroup$Integration by parts gives: $$\int \sin\log x\,dx = x \sin\log x-\int \cos \log x $$ and integrating by parts again: $$\int \sin\log x\,dx = x\sin\log x-x\cos\log x-\int\sin\log x\,dx $$ so: $$\int \sin\log x\,dx = \frac{x}{2}\left(\sin\log x-\cos\log x\right).$$
$\endgroup$ 4 $\begingroup$The error you made came in the substitution. When you had $dx=xdu$ the $x$ should be replaced by $e^u$ before you place it back into the integral.
If we start with the integral $$\int \sin(\ln(x)) dx$$ we can use the substitution $u=\ln(x)$ which gives $du = (1/x)dx$ and $dx = xdu = e^{u} du$.
Thus the integral becomes: $$\int \sin(u) e^{u} du.$$ Integration by parts performed twice, together with the method of solving for the integral, will work to find the solution.
$$\int \sin(u) e^{u} du = \sin(u) e^{u} - \int \cos(u) e^u du$$ $$= \sin(u) e^u - \left( \cos(u) e^u + \int \sin(u) e^u du \right)$$
Finally moving the integral on the right over:
$$2 \int \sin(u) e^u du = e^{u} \left( \sin(u) - \cos(u) \right)$$
Dividing by two and substituting back $u=\ln x$ yields:
$$\int \sin(\ln(x)) dx = \frac{x}{2} \left( \sin(\ln(x)) - \cos(\ln(x)) \right)$$
$\endgroup$ $\begingroup$\begin{align} \int dx \sin\ln x &= \int du e^u \sin u\\ &= \int du \dfrac{e^{(1+i)u} - e^{(1-i) u}}{2i}\\ &= \dfrac{e^u}{2i} \left(\dfrac{e^{(1+i)u}}{1+i} - \dfrac{e^{(1-i)u}}{1-i}\right)\\ &= \dfrac{e^u}{2i} \left(\dfrac{(1-i)e^{iu} - (1+i) e^{-i u}}{2} \right)\\ &= \dfrac{e^u}{2i} \left(\dfrac{e^{iu} - e^{-iu}}{2} -i \dfrac{e^{iu} + e^{-iu}}{2} \right)\\ &=\dfrac{e^u}{2} \left(\sin u - \cos u \right)\\ &= \dfrac{x}{2}\left(\sin\ln x - \cos\ln x\right) \end{align}
$\endgroup$