# What is the antiderivative of sin (lnx)?

Jan 18, 2016

$\frac{\cos \left(\ln x\right)}{x}$

#### Explanation:

According to the chain rule, $\frac{d}{\mathrm{dx}} \left[\sin \left(u\right)\right] = \cos \left(u\right) \cdot \frac{\mathrm{du}}{\mathrm{dx}}$.

Thus,

$\frac{d}{\mathrm{dx}} \left[\sin \left(\ln x\right)\right] = \cos \left(\ln x\right) \cdot \frac{d}{\mathrm{dx}} \left[\ln x\right]$

$= \cos \left(\ln x\right) \cdot \frac{1}{x} = \frac{\cos \left(\ln x\right)}{x}$

Jan 18, 2016

$\frac{x}{2} \left(\sin \left(\ln \left(x\right)\right) - \cos \left(\ln \left(x\right)\right)\right) + C$

#### Explanation:

In the given context, finding the antiderivative of $\sin \left(\ln \left(x\right)\right)$ is equivalent to solving the indefinite integral $\int \sin \left(\ln \left(x\right)\right) \mathrm{dx}$

To do so, we will make use of integration by substitution and integration by parts. We will need to do some additional tricks with these beyond the standard basic methods as well.

To begin, we let $I = \int \sin \left(\ln \left(x\right)\right) \mathrm{dx}$

Substitution:

Let $t = \ln \left(x\right) \implies \mathrm{dt} = \frac{1}{x} \mathrm{dx}$

Unfortunately, this is not enough, as we do not have $\frac{1}{x} \mathrm{dx}$ in our integral. To fix this, note that from the substitution:

${e}^{t} = {e}^{\ln} \left(x\right) = x$

Then, multiplying both sides of our derivative above by $x$, we have

$\mathrm{dx} = x \mathrm{dt} = {e}^{t} \mathrm{dt}$

Continuing with the substitution,

$I = \int \sin \left(t\right) {e}^{t} \mathrm{dt}$

Integration by parts (i):

Let $u = \sin \left(t\right)$ and $\mathrm{dv} = {e}^{t} \mathrm{dt}$
$\implies \mathrm{du} = \cos \left(t\right) \mathrm{dt}$ and $v = {e}^{t}$

Applying the integration by parts formula $\int u \mathrm{dv} = u v - \int v \mathrm{du}$

$\int {e}^{t} \sin \left(t\right) \mathrm{dt} = {e}^{t} \sin \left(t\right) - \int {e}^{t} \cos \left(t\right) \mathrm{dt}$

Integration by parts (ii):

Let $u = \cos \left(t\right)$ and $\mathrm{dv} = {e}^{t} \mathrm{dt}$
$\implies \mathrm{du} = - \sin \left(t\right) \mathrm{dt}$ and $v = {e}^{t}$

Again, applying the formula,

$\int {e}^{t} \cos \left(t\right) \mathrm{dt} = {e}^{t} \cos \left(t\right) - \int \left(- {e}^{t} \sin \left(t\right)\right) \mathrm{dt}$

Substituting this into the result of the first integration by parts,

$I = {e}^{t} \sin \left(t\right) - {e}^{t} \cos \left(t\right) - \int {e}^{t} \sin \left(t\right) \mathrm{dt}$

$= {e}^{t} \left(\sin \left(t\right) - \cos \left(t\right)\right) - I$

$\implies 2 I = {e}^{t} \left(\sin \left(t\right) - \cos \left(t\right)\right)$

$\implies I = {e}^{t} / 2 \left(\sin \left(t\right) - \cos \left(t\right)\right)$

substituting $t = \ln \left(x\right)$ back in, this gives

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

And since we lost the constant when we did the trick adding $I$ to both sides, let's put it back in now to get the final result.

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