# Problem with evaluating the exact value of an integral

Evaluate the integral $\int_0^1 \cos(\ln(x)) \, dx$

I was able to evaluate the improper integral which is:

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

I was using the substitution $u = \ln x$, and afterward I did integration by parts twice and got the result:

$$\frac{e^u\left( \sin(u) + \cos(u) \right)}{2}$$

Applying $x=1$ we get $u = 0$ and applying $x=0$ we get $u=-\infty$.

So how can it be calculated?

• So what exactly do you want to evaluate? Do you wish to simplify the result you've got? – Kugelblitz Feb 26 '15 at 13:05
• The value of the integral between $0$ to $1$. – AlonAlon Feb 26 '15 at 13:06
• Wolfram Alpha says you get approximately 0.5 wolframalpha.com/input/… I guess it considered the terms for your split improper integral to be 1/2 * 1 - 1/2 * 0 by inputting 1 and 0 respectively and for some reason disregarding the problems which arise when you input zero for the natural log.. – Kugelblitz Feb 26 '15 at 13:22

Set

\begin{align} u &= \ln(x) \implies e^{u}du = dx \\ x &= 0 \implies u = -\infty \\ x &= 1 \implies u = 0 \end{align}

Hence, you get

$$I = \int_{-\infty}^{0} e^{u}\cos(u) du$$

Integrating by parts twice, first with $v = e^{u}$, $w' = \cos(u)$ and secondly with $v = e^{u}$, $w' = \sin(u)$

\begin{align} I &= \int_{-\infty}^{0} e^{u}\cos(u) du \\ &= e^{u}\sin(u) \biggr|_{-\infty}^{0} - \int_{-\infty}^{0} e^{u}\sin(u) du \\ &= 0 - \int_{-\infty}^{0} e^{u}\sin(u) du \\ &= -\bigg[ -e^{u}\cos(u)\biggr|_{-\infty}^{0} + \int_{-\infty}^{0} e^{u}\cos(u) du \biggr] \\ &= 1 - \int_{-\infty}^{0} e^{u}\cos(u) du \\ &= 1 - I \end{align}

Therefore

\begin{align} I &= 1 - I \\ \implies I &= \frac{1}{2} \\ \end{align}

Wolfram gives the same result.

• Thank you very much! @Mattos – AlonAlon Feb 26 '15 at 13:27
• @AlonAlon Happy to help. – mattos Feb 26 '15 at 13:27

Hint

$$\lim_{x\to 0^+} -\frac{x}{2}\leq \lim_{x\to 0^+} \frac{x\sin(\ln(x))}{2}\leq \lim_{x\to 0^+} \frac{x}{2}$$

Works also for $x\cos(\ln(x))$.