# What is int_0^pi sin^2(lnx)?

Jan 9, 2016

Guy, i wanted to sleep now... but the integral is so attractive...

Let's $u = \ln \left(x\right)$
$\mathrm{du} = \frac{1}{x} \mathrm{dx}$
$\mathrm{dx} = x \mathrm{du}$
$x = {e}^{u}$

$\int {e}^{u} {\sin}^{2} \left(u\right) \mathrm{du}$ $\implies \left(a\right)$

by the way ${\sin}^{2} \left(u\right) = \frac{1}{2} \left(1 - \cos \left(2 u\right)\right)$

$\frac{1}{2} \int {e}^{u} \left(1 - \cos \left(2 u\right)\right) \mathrm{du}$

$\frac{1}{2} \left(\int {e}^{u} \mathrm{du} - \int {e}^{u} \cos \left(2 u\right) \mathrm{du}\right)$ $\implies \left(b\right)$

We keep our interest on $\int {e}^{u} \cos \left(2 u\right) \mathrm{du}$ because the first is trivial

by part :

$v = {e}^{u}$
$\mathrm{dv} = {e}^{u}$
$\mathrm{dw} = \cos \left(2 u\right)$
$w = \frac{1}{2} \sin \left(2 u\right)$

at this point i consider $\int \cos \left(2 u\right) \mathrm{du}$ as trivial too

$= \frac{1}{2} \left[\sin \left(2 u\right) {e}^{u}\right] - \frac{1}{2} \int {e}^{u} \sin \left(2 u\right) \mathrm{du}$

by part again :

$v = {e}^{u}$
$\mathrm{dv} = {e}^{u}$
$\mathrm{dw} = \sin \left(2 u\right)$
$w = - \frac{1}{2} \cos \left(2 u\right)$

$= - \frac{1}{2} \left[{e}^{u} \cos \left(2 u\right)\right] + \frac{1}{2} \int {e}^{u} \cos \left(2 u\right) \mathrm{du}$

Now this is interesting

$\int {e}^{u} \cos \left(2 u\right) \mathrm{du} = \frac{1}{2} \left[\sin \left(2 u\right) {e}^{u}\right] - \frac{1}{2} \left(- \frac{1}{2} \left[{e}^{u} \cos \left(2 u\right)\right] + \frac{1}{2} \int {e}^{u} \cos \left(2 u\right) \mathrm{du}\right)$

$\int {e}^{u} \cos \left(2 u\right) \mathrm{du} = \frac{1}{2} \left[\sin \left(2 u\right) {e}^{u}\right] + \frac{1}{4} \left[{e}^{u} \cos \left(2 u\right)\right] - \frac{1}{4} \int {e}^{u} \cos \left(2 u\right) \mathrm{du}$

adding $\frac{1}{4} \int {e}^{u} \cos \left(2 u\right) \mathrm{du}$ both side

$\frac{5}{4} \int {e}^{u} \cos \left(2 u\right) \mathrm{du} = \frac{1}{2} \left[\sin \left(2 u\right) {e}^{u}\right] + \frac{1}{4} \left[{e}^{u} \cos \left(2 u\right)\right]$

$\int {e}^{u} \cos \left(2 u\right) \mathrm{du} = \frac{4}{10} \left[\sin \left(2 u\right) {e}^{u}\right] + \frac{1}{5} \left[{e}^{u} \cos \left(2 u\right)\right]$

Introducing in $\left(b\right)$

$\frac{1}{2} \left(\int {e}^{u} \mathrm{du} - \left(\frac{4}{10} \left[\sin \left(2 u\right) {e}^{u}\right] + \frac{1}{5} \left[{e}^{u} \cos \left(2 u\right)\right]\right)\right)$

$\frac{1}{2} \left(\left[{e}^{u}\right] - \left(\frac{4}{10} \left[\sin \left(2 u\right) {e}^{u}\right] + \frac{1}{5} \left[{e}^{u} \cos \left(2 u\right)\right]\right)\right)$

$\frac{1}{2} \left[{e}^{u}\right] - \frac{2}{10} \left[\sin \left(2 u\right) {e}^{u}\right] - \frac{1}{10} \left[{e}^{u} \cos \left(2 u\right)\right]$

Substitute back for $u = \ln \left(x\right)$

$\frac{1}{2} \left[x\right] - \frac{2}{10} {\left[\sin \left(2 \ln \left(x\right)\right) x\right]}_{0}^{\pi} - \frac{1}{10} {\left[x \cos \left(2 \ln \left(x\right)\right)\right]}_{0}^{\pi}$

You can factorize by $- \frac{1}{10} x$ and rewrite

$\frac{1}{2} \left[x\right] - \frac{2}{10} \left[\sin \left(2 \ln \left(x\right)\right) x\right] - \frac{1}{10} \left[x \cos \left(2 \ln \left(x\right)\right)\right]$

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

now apply

${\left[- \frac{1}{10} x \left(2 \sin \left(2 \ln \left(x\right)\right) + \cos \left(2 \ln \left(x\right)\right) - 5\right)\right]}_{0}^{\pi}$

$= \left[- \frac{1}{10} \pi \left(\sin \left(2 \ln \left(\pi\right)\right) + \cos \left(2 \ln \left(\pi\right)\right) - 5\right)\right]$