\[ \int \frac {4 e^4+e^2 (-1-8 x)+4 x^2+e^4 \left (e^4-2 e^2 x+x^2\right )}{e^4-2 e^2 x+x^2} \, dx \]
Optimal antiderivative \[ x \left (\frac {1}{x -{\mathrm e}^{2}}+4+{\mathrm e}^{4}\right ) \]
command
integrate(((exp(2)^2-2*exp(2)*x+x^2)*exp(4)+4*exp(2)^2+(-8*x-1)*exp(2)+4*x^2)/(exp(2)^2-2*exp(2)*x+x^2),x, algorithm="giac")
Giac 1.9.0-11 via sagemath 9.6 output
\[ x e^{4} + 4 \, x + \frac {e^{2}}{x - e^{2}} \]
Giac 1.7.0 via sagemath 9.3 output
\[ \text {Exception raised: NotImplementedError} \]________________________________________________________________________________________