Paradox in indefinite integral Today,I met a problem about calculating such an indefinite integral$$ I=\int \frac{1}{(1+x^2)(1+x^{2019})}$$ My thought is as follows $$
\begin{aligned} I & = \int \frac { 1 } { \left( 1 + x ^ { 2 } \right) \left( 1 + x ^ { 2019} \right) } d x \\ & = \int \frac { 1 } { \left( 1 + x ^ { - 2 } \right) \left( 1 + x ^ { - 2019} \right) } \left( - \frac { 1 } { x ^ { 2 } } \right) d x \\ & = \int \frac { - x ^ { 2019 } } { \left( 1 + x ^ { 2 } \right) \left( 1 + x ^ { 2019} \right) } d x \\ & = I - \int \frac { 1 } { 1 + x ^ { 2 } } d x \end{aligned}
$$ No doubt,it is wrong.However, I don’t know how to illustrate this paradox?
 A: Here's a simpler version of your “paradox”:
$$
I=\int \frac{1}{x}\,dx=\int-x\frac{1}{x^2}\,dx=-I+c
$$
so $I$ is constant. Er, no! There should be something wrong!
Where is the problem? You do substitutions without taking care of the limits of integration.
Here's a paradox free version of the above:
$$
F(x)=\int_1^x \frac{1}{t}\,dt=\int_1^{1/x}-t\frac{1}{t^2}\,dt=-F(1/x)
$$
and this simply shows that $F(x)=-F(1/x)$.
In your case, you know that, up to an additive constant, the antiderivative you're looking for, over the interval $(0,\infty)$, is
\begin{align}
F(x)
&=\int_1^x \frac{1}{(1+t^2)(1+t^{2019})}\,dt\\[2ex]
&=\int_1^{1/x}\frac{-t^{2019}}{(1+t^2)(1+t^{2019})}\,dt\\[2ex]
&=\int_{1}^{1/x}\frac{1}{(1+t^2)(1+t^{2019})}\,dt-\int_1^{1/x}\frac{1}{1+t^2}\,dt
\end{align}
This proves the functional equation
$$
F(x)=F(1/x)-\arctan\frac{1}{x}+\frac{\pi}{4}=F(1/x)+\arctan x-\frac{\pi}{4}
$$
and is no paradox at all.
A: In going from the first line to the second line, you make a substitution.  Thus, if
$$
I =\int \frac{1}{(1+x^2)(1+x^{2019})}dx = \int f(x)\,dx,
$$
Then
$$
\int \frac { 1 } { \left( 1 + x ^ { - 2 } \right) \left( 1 + x ^ { - 2019} \right) } \left( - \frac { 1 } { x ^ { 2 } } \right) d x = \int f(1/x)\,dx.
$$
We have no reason to believe that the two resulting antiderivatives should be identical.
A: Let $f_n$ denote an antiderivative of $\frac{1}{(1+x^2)(1+x^n)},\,n:=2019$ so $\int\frac{-x^ndx}{(1+x^2)(1+x^n)}=f_n^\prime(1/x)+C$. So you've actually shown $f_n(x)=f_n(1/x)-\arctan x+C_n$ for some $C_n$.
