<s>[INST] calculation of $\int_{0}^{1}\tan^{-1}(1-x+x^2)dx$ 
Compute the definite integral
  $$
\int_{0}^{1}\tan^{-1}(1-x+x^2)\,dx
$$

Failed Attempt:
Let $1-x+x^2=t$. Then
$$
\begin{align}
(2x-1)\,dx &= dt\\
dx &= \frac{1}{(2x-1)}dt
\end{align}
$$
Changing the limits of integration, we get
$$\int_{1}^{1}\tan^{-1}(t)\cdot \frac{1}{(2x-1)}dt = \int_{1}^{1}\tan^{-1}(t)\cdot f(t)dt = 0
$$
where $f(t)=\frac{1}{(2x-1)}$.
Is it true that $\int_{a}^{a}f(x)dx = 0$? If not, then where have I made a mistake in my attempted solution?
 [/INST] HINT:
As $\displaystyle 1-x+x^2=\frac{(2x-1)^2+3}4>0$ for real $x,$
using this, $\displaystyle \tan^{-1}(1-x+x^2)=\cot^{-1}\left(\frac1{1-x+x^2}\right)$
Now, we know $\displaystyle\cot^{-1}\left(\frac1{1-x+x^2}\right)=\frac\pi2-\tan^{-1}\left(\frac1{1-x+x^2}\right)$
Again, $\displaystyle\tan^{-1}\left(\frac1{1-x+x^2}\right)=\tan^{-1}\left(\frac{x+1-x}{1-x(1-x)}\right)=\tan^{-1}x+\tan^{-1}(1-x)$
From this, the last identity holds true if $\displaystyle x(1-x)\le1$ which is true as $\displaystyle x(1-x)=\frac{1-(2x-1)^2}4\le \frac14$ for real $x$
Finally, as $\displaystyle \int_a^bf(x)dx=\int_a^bf(a+b-x)dx,$
$\displaystyle \int_0^1\tan^{-1}(1-x)dx=\int_0^1\tan^{-1}\{1-(\underbrace{1+0-x})\}dx=\int_0^1\tan^{-1}xdx$
</s>