Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Compute the following integral \begin{equation} \int_0^{\Large\frac{\pi}{4}}\left[\frac{(1-x^2)\ln(1+x^2)+(1+x^2)-(1-x^2)\ln(1-x^2)}{(1-x^4)(1+x^2)}\right] x\, \exp\left[\frac{x^2-1}{x^2+1}\right]\, dx \end{equation}

I was given two integral questions by my teacher. I can answer this one although it took a lot of time to compute it. I want to share this problem to the other users here and I would love to see how Mathematics SE users compute this monster. Thank you.

share|cite|improve this question
up vote 60 down vote accepted

Rewrite \begin{align} &\int\left[\frac{(1-x^2)\ln(1+x^2)+(1+x^2)-(1-x^2)\ln(1-x^2)}{(1-x^4)(1+x^2)}\right] x\ \exp\left[\frac{x^2-1}{x^2+1}\right]\ dx\\ &=-\int\left[\frac{(1-x^2)\ln\left(\dfrac{1-x^2}{1+x^2}\right)-(1+x^2)}{(1-x^2)(1+x^2)(1+x^2)}\right] x\ \exp\left[-\frac{1-x^2}{1+x^2}\right]\ dx\\ &=-\frac14\int\left[\frac{(1-x^2)\ln\left(\dfrac{1-x^2}{1+x^2}\right)-(1+x^2)}{(1-x^2)}\right] \frac{2x}{1+x^2}\, \exp\left[-\frac{1-x^2}{1+x^2}\right]\ \frac{2\ dx}{1+x^2}\\ &=-\frac14\int\left[\ln\left(\frac{1-x^2}{1+x^2}\right)-\frac{1+x^2}{1-x^2}\right] \frac{2x}{1+x^2}\, \exp\left[-\frac{1-x^2}{1+x^2}\right]\ \frac{2\ dx}{1+x^2}.\tag1 \end{align} Now, consider Weierstrass substitution: $$ x=\tan\frac{t}{2}\;,\;\sin t=\frac{2x}{1+x^2}\;,\;\cos t=\frac{1-x^2}{1+x^2}\;,\;\text{ and }\;dt=\frac{2\ dx}{1+x^2}. $$ The integral in $(1)$ turns out to be $$ -\frac14\int\left[\ln\left(\cos t\right)-\frac{1}{\cos t}\right] \sin t\, \exp\left[-\cos t\right]\ dt.\tag2 $$ Let $y=\cos t\;\Rightarrow\;dy=-\sin t\ dt$, then $(2)$ becomes $$ \frac14\int\left[\ln y-\frac{1}{y}\right] e^{-y}\ dy=\frac14\left[\int e^{-y}\ln y\ dy-\int\frac{e^{-y}}{y}\ dy\right].\tag3 $$ The second integral in the RHS $(3)$ can be evaluated by using IBP. Taking $u=e^{-y}\;\Rightarrow\;du=-e^{-y}\ dy$ and $dv=\dfrac1y\ dy\;\Rightarrow\;v=\ln y$, then $$ \int\frac{e^{-y}}{y}\ dy=e^{-y}\ln y+\int e^{-y}\ln y\ dy.\tag4 $$ Substituting $(4)$ to $(3)$, we obtain $$ \frac14\left[\int e^{-y}\ln y\ dy-e^{-y}\ln y-\int e^{-y}\ln y\ dy\right]=-\frac14e^{-y}\ln y+C. $$ Thus \begin{align} &\int\left[\frac{(1-x^2)\ln(1+x^2)+(1+x^2)-(1-x^2)\ln(1-x^2)}{(1-x^4)(1+x^2)}\right] x\ \exp\left[\frac{x^2-1}{x^2+1}\right]\ dx\\ &=\color{blue}{-\frac14\exp\left[-\frac{1-x^2}{1+x^2}\right]\ln \left|\frac{1-x^2}{1+x^2}\right|+C} \end{align} and \begin{align} &\int_0^{\Large\frac\pi4}\left[\frac{(1-x^2)\ln(1+x^2)+(1+x^2)-(1-x^2)\ln(1-x^2)}{(1-x^4)(1+x^2)}\right] x\ \exp\left[\frac{x^2-1}{x^2+1}\right]\ dx\\ &=\color{blue}{-\frac14\exp\left[-\frac{16-\pi^2}{16+\pi^2}\right]\ln \left|\frac{16-\pi^2}{16+\pi^2}\right|}. \end{align}

share|cite|improve this answer
I choose your answer since it's very detail and it's also nice-formatted. Thanks! (>‿◠)✌ – Anastasiya-Romanova 秀 Jun 1 '14 at 14:13
For prettiness factor why not write $\exp\left[\frac{\pi^2-16}{\pi^2+16}\right]$? – Ali Caglayan Dec 17 '14 at 14:52

From the numerator, collect the logarithmic terms first.

$$\displaystyle \int_0^{\pi/4} x\frac{(1+x^2)+(x^2-1)\ln\left(\frac{1-x^2}{1+x^2}\right)}{(1-x^4)(1+x^2)}\exp\left(\frac{x^2-1}{x^2+1}\right)\,dx$$

Rewrite $(1-x^4)=(1-x^2)(1+x^2)$ and divide the numerator by $(1+x^2)$.

$$\displaystyle \int_0^{\pi/4} \frac{x}{(1-x^2)(1+x^2)}\left(1+\frac{x^2-1}{x^2+1}\ln\left(\frac{1-x^2}{1+x^2}\right)\right)\exp\left(\frac{x^2-1}{x^2+1}\right)\,dx $$

Use the substitution $\displaystyle \frac{x^2-1}{x^2+1}=t \Rightarrow \frac{4x}{(1+x^2)^2}\,dx=dt$ to get:

$$\displaystyle \frac{1}{4}\int_{a}^{-1}\frac{e^t}{t}\left(1+t\ln(-t)\right)\,dt= \frac{1}{4}\int_{a}^{-1}e^t\left(\frac{1}{t}+\ln(-t)\right)\,dt$$

where $\displaystyle a=\frac{\pi^2/16-1}{\pi^2/16+1}$

Since $\displaystyle \int e^x(f'(x)+f(x))\,dx=e^xf(x)+C $, the above definite integral is:

$$\displaystyle \frac{1}{4}\left(e^t \ln(-t) \right|_{a}^{-1}=-\frac{1}{4}e^a\ln(-a) \approx \boxed{0.284007} $$

share|cite|improve this answer
That was fast... – Nameless May 31 '14 at 10:33
The FLASH!! LOL – Anastasiya-Romanova 秀 May 31 '14 at 10:34
@Nameless: Yeah, the reason being that V-Moy recently posted this problem on a problem solving website and I posted the very same solution there so all I had to was just copy-paste. ;) – Pranav Arora May 31 '14 at 10:34
@Nameless Please don't be so surprise. I've posted this question on Brilliant and Pranav has already answer it there $\ddot\smile$ – Anastasiya-Romanova 秀 May 31 '14 at 10:35
@Nameless Here is the link to the problem. – Anastasiya-Romanova 秀 May 31 '14 at 10:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.