# How do you evaluate the integral int cos(lnx)dx?

Mar 7, 2017

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

#### Explanation:

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

$\int \cos \left(\ln x\right) + i \sin \left(\ln x\right) \mathrm{dx}$

Chosen because we can use of Euler's Formula

$= \int {e}^{i \ln x} \mathrm{dx}$

$= \int {e}^{\ln {x}^{i}} \mathrm{dx}$

$= \int {x}^{i} \mathrm{dx}$

$= {x}^{i + 1} / \left(i + 1\right) + C$

And the we reverse back into the original form:

$= {e}^{\left(\ln {x}^{i + 1}\right)} / \left(i + 1\right) + C$

$= {e}^{\left(i + 1\right) \left(\ln x\right)} / \left(i + 1\right) + C$

$= \frac{{e}^{i \ln \left(x\right)} {e}^{\ln \left(x\right)}}{i + 1} + C$

$= \frac{\left(\cos \left(\ln x\right) + i \sin \left(\ln x\right)\right) x}{i + 1} + C$

Use the conjugate of the denominator:

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

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

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

We started with a real integrand so we take the first term and the constant:

$\implies \int \cos \left(\ln x\right) \mathrm{dx} = \frac{x \left(\cos \left(\ln x\right) + \sin \left(\ln x\right)\right)}{2} + C$