<s>[INST] Smarter way to solve $ \int_0^1\arctan(x^2)\,dx$ I'm trying to solve the following definite integral:
\begin{equation}
\int_0^1 \arctan(x^2)dx
\end{equation}
I tryed first by parial integration, finding:
\begin{equation}
x\arctan(x^2)\Bigl|_0^1-\int_0^1 \dfrac{2x^2}{1+x^4}dx
\end{equation}
Then:
\begin{equation}
\int_0^1 \dfrac{2x^2}{1+x^4}dx=\int_0^1 \dfrac{(x^2+1)+(x^2-1)}{1+x^4}dx=\int_0^1 \dfrac{x^2+1}{1+x^4}dx+\int_0^1 \dfrac{x^2-1}{1+x^4}dx
\end{equation}
and i introduced the following substitution:
\begin{equation}
t=x-\dfrac{1}{x}\qquad s=x+\dfrac{1}{x}
\end{equation}
Than I used this weird substitution:
\begin{equation}
\dfrac{\sqrt{2}}{2}\arctan\left( \dfrac{t}{\sqrt{2}} \right)\Bigl|_0^1+\int_0^1\dfrac{ds}{(s-2)(s+2)}
\end{equation}
In the end simple fraction:
\begin{equation}
\left[\dfrac{\sqrt{2}}{2}\arctan\left( \dfrac{t}{\sqrt 2} \right)+\dfrac{1}{4}\log(2-s)-\dfrac{1}{4}\log(s+2)\right]_0^1
\end{equation}
and that is the solution.
Now: does it exist a simpler path to solve this integral?
 [/INST] First you need to write $x^4+1$ as a product of factors that are irreducible in the ring of real polynomials.$$x^4+1=(x^2+1)^2-(\sqrt 2 x)^2 $$ $$(x^2+1-\sqrt2 x)(x^2+1+\sqrt 2 x)$$ $$=(x^2-\sqrt 2 x+1)(x^2+\sqrt 2 x+1)$$.Then decompose $$\frac{2x^2}{(x^2-\sqrt 2 x+1)(x^2+\sqrt 2 x+1)}$$ into partial fractions as $$\frac{Ax+B}{x^2-\sqrt 2 x+1}+\frac{Cx+D}{x^2+\sqrt 2 x+1} $$. Find $A,B,C,D$. Then you should have no troble integrating to obtain terms involving ln and arctan functions.
</s>