Can somebody verify this solution for me? Thanks!
Evaluate $\displaystyle \int \sin(\ln(x))dx$.
First, lets simplify things a bit by making the substitution $y=ln(x)$. Then $dy = \frac{1}{x}dx$ and we have our original integral now equals: $$\int \sin(y)x dy$$.
But since $y=\ln(x)$, we have $e^y=e^{\ln(x)}=x$ and so our original integral equals $$\int \sin(y)e^y dy$$
Evaluating integrals of this form has an extra trick you need to be aware of. Let's get started by setting $u=\sin(y)$ and $dv=e^ydy$. Then $du=\cos(y)dy$ and $v=e^y$ so we have:
$\int \sin(y)e^y dy$
$=\int udv = uv - \int vdu = \sin(y)e^y - \int e^y \cos(y)dy$
Now lets do integration by parts on $\int e^y \cos(y)dy$
set $u=\cos(y)$ and $dv = e^ydy$ so $du = -\sin(y)dy$ and $v=e^y$ and we have:
$\int e^y \cos(y)dy = \int udv = uv - \int vdu = \cos(y)e^y - \int e^y(-\sin(y))dy = \cos(y)e^y + \int e^y\sin(y)dy$
So, looking back at what this equals (after our long chain of equalities and two different cases of integration by parts, we have: $$\int \sin(y)e^y dy=\sin(y)e^y - (\cos(y)e^y + \int e^y\sin(y)dy)$$
distributing the negative...
$$\int \sin(y)e^y dy=\sin(y)e^y - \cos(y)e^y - \int e^y\sin(y)dy$$
HERES THE TRICK: we now add $\int e^y\sin(y)dy$ to both sides of the equation to get:
$$2\int \sin(y)e^y dy=\sin(y)e^y - \cos(y)e^y + C$$
Thus:
$$\int \sin(y)e^y dy=\frac{e^y}{2}(\sin(y)-\cos(y)) + C$$
now substitute $y=\ln(x)$ (so e^y=x) and $dy=\frac{1}{x}dx$ to get:
$$\int \sin(\ln(x))dx=\frac{x}{2}(\sin(\ln(x))-\cos(\ln(x)) + C$$
I want to point out that because of that "tricky" step, it's kind of weird to see where the constant of integration shows up... But eh, the point is it's gonna be there, even though we didn't really "integrate" the last summand in our integration by parts.
$\endgroup$ 32 Answers
$\begingroup$Sort of ok, but you could do it more directly:$$\int \sin(\ln x) \, dx= \int x \ \sin(\ln x) \,\frac1x\; dx= -x \cos(\ln x)+\int \cos(\ln x)\,dx $$and$$ \int \cos(\ln x) \, dx= \int x \ \cos(\ln x) \,\frac1x\; dx= x \sin(\ln x)-\int \sin(\ln x)\,dx$$from which you may deduce $\int \sin(\ln x) \, dx$ and $ \int \cos(\ln x) \, dx$.
$\endgroup$ 1 $\begingroup$Or more concisely,$$\int\sin\ln xdx=\Im\int x^idx=\Im\left(\frac{1-i}{2}x^{1+i}\right)+C=\frac12x(\sin\ln x-\cos\ln x)+C.$$
$\endgroup$ 1