# Integrate $\int_0^\frac{\pi}{4} \frac{\tan^2(x)}{x^2+1} \: dx$

I have been trying to evaluate this integral:

$$\int_0^\frac{\pi}{4} \frac{\tan^2(x)}{x^2+1} \,dx$$

According to the answer key that I have, the answer is supposed to be simply $1/3$. But, inputting it into Wolfram Alpha yields the decimal approximation of $\approx 0.156503$. I am trying to find an exact answer and all my attempts have failed.

I cannot see that any basic integration technique would work (i.e. u-substitution, integration by parts, etc), and I have tried to use symmetry to evaluate this (i.e. substitute $x=\frac{\pi}{4}-u$) but to no avail.

Thank you!

• Are you sure is $\tan^2(x)$ and not $\arctan^2(x)$ or maybe $\tan^{-2}(x)$. I say it because $\frac1{1+x^2}$ happens to be the derivative of $\arctan(x)$. – Alejandro Nasif Salum Sep 10 '18 at 0:13
• Probably a typo in the problem. Wolfram estimate looks correct. – Vasya Sep 10 '18 at 0:18
• @AlejandroNasifSalum Yes, I double-checked, and this is the exact way the question is written (i.e. with no arctangent function). I believe the $1/3$ is definitely a typo, but I'm still unable to find a closed-form solution to this integral. – AJ123 Sep 10 '18 at 1:39
• Im pretty sure this was asked here before. This is an integral (wrong one) that appears at 2005 Integration BEE or something like that. Im pretty sure if you go to search the tag "integration" you should find it at the top somewhere. Anyway it is most probably that you wont find a closed form. – Zacky Sep 11 '18 at 6:47
• Possible duplicate of MIT 2015 Integration Question – James Arathoon Sep 11 '18 at 13:08

It's easy to see that $f(x)=\frac{\tan(x)^2}{x^2+1}$ is strictly increasing and convex on the integration interval $I=(0,\frac{\pi}{4})$. So on the interval $I$, the function $f$ assumes the maximum value in $x=\frac{\pi}{4}$: $f(\frac{\pi}{4})=\frac{\tan(\frac{\pi}{4})^2}{(\frac{\pi}{4})^2+1}=\frac{16}{16+\pi^2}$. Now construct a new function $g(x)=\frac{16}{16+\pi^2}x$. This is a line that pass trought the origin and the point $(\frac{\pi}{4},f(\frac{\pi}{4}))$. $f$ is convex on $I$ hence on the interval $I$: $$f(x)\leq g(x) \implies \int_{0}^{\frac{\pi}{4}}f(x)dx \leq \int_{0}^{\frac{\pi}{4}}g(x)dx = \int_{0}^{\frac{\pi}{4}}x\frac{16}{16+\pi^2}dx=\frac{\pi^2}{32+2\pi^2}\approx 0.19 < \frac{1}{3}$$ Finally $$\int_{0}^{\frac{\pi}{4}}f(x)dx < 0.19 < \frac{1}{3}$$