# How do you integrate int sin(lnx) by integration by parts method?

Oct 8, 2016

Let $I = \int \sin \left(\ln x\right) \mathrm{dx}$

We need to decide (guess) whether to use $\sin \left(\ln x\right)$as $u$ or $\mathrm{dv}$. It turns out that either will work.

Method 1
Let $u = \sin \left(\ln x\right)$ and $\mathrm{dv} = \mathrm{dx}$.

Then $\mathrm{du} = \frac{1}{x} \cos \left(\ln x\right) \mathrm{dx}$ and $v = x$

$I = u v - \int v \mathrm{du}$

$= x \sin \left(\ln x\right) - \int \cos \left(\ln x\right) \mathrm{dx}$

Repeat with $u = \cos \left(\ln x\right)$ and $\mathrm{dv} = \mathrm{dx}$,

so $\mathrm{du} = - \frac{1}{x} \sin \left(\ln x\right)$ and $v = x$.

$I = x \sin \left(\ln x\right) - \left[x \cos \left(\ln x\right) - \int - \sin \left(\ln x\right) \mathrm{dx}\right]$

so

$I = x \sin \left(\ln x\right) - x \cos \left(\ln x\right) - {\underbrace{\int \sin \left(\ln x\right) \mathrm{dx}}}_{I}$

$2 I = x \sin \left(\ln x\right) - x \cos \left(\ln x\right)$

$I = \frac{1}{2} \left(x \sin \left(\ln x\right) - x \cos \left(\ln x\right)\right)$

Method 2

Let $I = \int \sin \left(\ln x\right) \mathrm{dx}$

In order to use $\sin \left(\ln x\right) \mathrm{dx}$ in $\mathrm{dv}$, we'll need to be able to integrate $\mathrm{dv}$.
We could use substitution if we had the derivative of $\ln x$ as a factor, so we'll introduce it.

$I = \int x \sin \left(\ln x\right) \frac{1}{x} \mathrm{dx}$

Let $u = x$ and $\mathrm{dv} = \sin \left(\ln x\right) \frac{1}{x} \mathrm{dx}$.

Then $\mathrm{du} = \mathrm{dx}$ and $v = - \cos \left(\ln x\right)$

$I = u v - \int v \mathrm{du}$

$= - x \cos \left(\ln x\right) + \int \cos \left(\ln x\right) \mathrm{dx}$

We'll use parts again. (And we'll hope that it works. If it doesn't, we'll try something else.)

$= - x \cos \left(\ln x\right) + \int x \cos \left(\ln x\right) \frac{1}{x} \mathrm{dx}$

Let $u = x$ and $\mathrm{dv} = \cos \left(\ln x\right) \frac{1}{x} \mathrm{dx}$.

Then $\mathrm{du} = \mathrm{dx}$ and $v = \sin \left(\ln x\right)$

$I = - x \cos \left(\ln x\right) + \left[x \sin \left(\ln x\right) - {\underbrace{\int \sin \left(\ln x\right) \mathrm{dx}}}_{I}\right]$

$2 I = - x \cos \left(\ln x\right) + x \sin \left(\ln x\right)$

$I = \frac{1}{2} \left(x \sin \left(\ln x\right) - x \cos \left(\ln x\right)\right)$