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?
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$
While lab bhattacharjee's hint is indeed excellent, it's also perhaps too high-brow for many students to notice unless pointed out to them, so I'd like to offer an alternative hint based on standard methods instead of "tricks".
Hint: Integrating by parts,
$$\int\tan^{-1}{\left(1-x+x^2\right)}\,dx=x\tan^{-1}{\left(1-x+x^2\right)}-\int x\cdot\frac{-1+2x}{\left(1-x+x^2\right)^2+1}dx\\ =x\tan^{-1}{\left(1-x+x^2\right)}-\int\frac{x\left(2x-1\right)}{\left(1-x+x^2\right)^2+1}dx.$$
Then consider using partial fractions to evaluate this new integral.