# Integrate $\int^{\pi }_{0}\frac{x}{2-\tan ^{2}\left( x\right) }\mathrm dx$

The integral I tried to solve by using this rule

$$\int \limits^{a}_{0}f\left( x\right)\mathrm dx = \int \limits^{a}_{0}f\left( a-x\right)\mathrm dx.$$

The integral is

$$\int \limits^{\pi }_{0}\frac{x}{2-\tan ^{2}\left( x\right) }\mathrm dx$$

I tried Wolfram Alpha put it was useless... Is there any hint or solution?
Thanks for help.

• This integral is divergent. Please see my answer below. Thanks. – Olivier Oloa Aug 15 '15 at 21:26
• @OlivierOloa. OH that is correct.. you catch it well.... Thanks professor +1 – user257567 Aug 15 '15 at 21:30
• Your function is undefined at $\arctan\sqrt2$ and $\pi-\arctan\sqrt2$ so you can't use this method. – Mercy King Aug 16 '15 at 3:13

## 4 Answers

Let $f(x) = 2 - \tan^2 x$. Then, using $\tan(\pi - x) = -\tan(x)$, $f(x) = f(\pi - x)$.

$$\int_0^{\pi} \frac{x}{f(x)}dx = \int_0^{\pi} \frac{\pi - x}{f(x)}dx \implies \\ \int_0^{\pi} \frac{x}{f(x)}dx = \frac{\pi}2 \int_0^{\pi} \frac1{f(x)}dx$$

Can you proceed?

• Thanks... I will try this – user257567 Aug 15 '15 at 21:13

This integral is divergent, since by the Taylor expansion, as $x \to \frac\pi4$, the integrand behaves as

$$\frac{x}{2-\tan ^{2}\left( x\right) }=-\frac{\pi }{16 \left(x-\frac{\pi }{4}\right)}+\frac{\pi}{8}-\frac14+O \left(x-\frac{\pi }{4}\right).$$

Maybe there is a typo in the question. Unless you are dealing with the Cauchy principal value.

Let $$I=\int_{0}^{\pi}\frac{x}{2-\tan^2 x}dx\tag 1$$ Now, using rule of integration, we get $$I=\int_{0}^{\pi}\frac{(\pi-x)}{2-\tan^2 (\pi-x)}dx$$ $$I=\int_{0}^{\pi}\frac{(\pi-x)}{2-\tan^2x}dx\tag 2$$ Now, adding (1) & (2), $$I+I=\int_{0}^{\pi}\frac{x}{2-\tan^2x}dx+\int_{0}^{\pi}\frac{(\pi-x)}{2-\tan^2x}dx$$ $$2I=\int_{0}^{\pi}\frac{\pi}{2-\tan^2x}dx$$ $$I=\frac{\pi}{2}\int_{0}^{\pi}\frac{dx}{2-\tan^2x}$$ Now, using $$\int_{0}^{2a}f(x)dx=2\int_{0}^{a}f(x)dx\iff f(2a-x)=f(x)$$, we get $$I=\frac{\pi}{2}(2)\int_{0}^{\pi/2}\frac{dx}{2-\tan^2x}$$ $$=\pi\int_{0}^{\pi/2}\frac{\sec^2x dx}{\sec^2x(2-\tan^2x)}$$ $$=\pi\int_{0}^{\pi/2}\frac{\sec^2x dx}{(1+\tan^2x)(2-\tan^2x)}$$ Now, let $$\tan x=t\implies \sec^2x dx=dt$$ $$I=\pi\int_{0}^{\infty}\frac{dt}{(1+t^2)(2-t^2)}$$

$$I=\pi\int_{0}^{\infty}\frac{dt}{(\sqrt{2}-t)(\sqrt{2}+t)(1+t^2)}$$ I hope you can solve further by using partial fractions.

• Thanks sir for obvious solution.... but is this integration is divergent according to Taylor series as Olivier had explain??? – user257567 Aug 15 '15 at 23:31

The function $\displaystyle x\mapsto f(x)=\frac{x}{2-\tan^2x}$ is discontinuous at $x_1=\arctan\sqrt2 \in(\pi/4,\pi/2)$ and at $x_2=\pi-x_1$, and near $x_1$ we have $$2-\tan^2x=-6\sqrt2(x-x_1)-21(x-x_1)^2+\ldots.$$ It follows that $$f(x)\sim -\frac{1}{6\sqrt2}-\frac{x_1}{6\sqrt2}(x-x_1)^{-1}+\ldots$$ Thus the integral $$\int_0^{x_1} f(x)\,dx$$ is divergent, and so is the integral $\displaystyle \int_0^\pi f(x)\,dx$.

• Sorry... but could you please explain How we get $tan^{-1}\sqrt2$ from this function???... Thanks – user257567 Aug 16 '15 at 15:12
• @user257567 Find the solutions of the equation $2-\tan^2(x)=0$ for $x\in (0,\pi)$$. – Mercy King Aug 16 '15 at 22:36 • solutions are$ x_{1}= \pi k - \tan ^{-1}\left( \sqrt{2} \right) \& k\in \mathbb{Z} \text{and} x_{2}= \pi k + \tan ^{-1}\left( \sqrt{2} \right) \& k\in \mathbb{Z} $– user257567 Aug 17 '15 at 10:56 • @user257567 What do you get when you use the constraint$x \in (0,\pi)\$? – Mercy King Aug 17 '15 at 19:13