TITLE: calculation of $\int_{0}^{1}\tan^{-1}(1-x+x^2)dx$
QUESTION [11 upvotes]: 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?

REPLY [8 votes]: 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.