\(\int \frac {4 x+x^2-x^3+e^2 (-2 x+x^2)}{4-4 x+4 x^2-x^3+e^2 (4-4 x+x^2)} \, dx\) [7898]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 53, antiderivative size = 23 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=2+x-\log \left (\frac {1}{-4+(-2+x)^2 \left (-e^2+x\right )}\right ) \]

[Out]

x-ln(1/((x-exp(2))*(-2+x)^2-4))+2

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.43, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.057, Rules used = {6873, 6874, 1601} \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=\log \left (-x^3+\left (4+e^2\right ) x^2-4 \left (1+e^2\right ) x+4 \left (1+e^2\right )\right )+x \]

[In]

Int[(4*x + x^2 - x^3 + E^2*(-2*x + x^2))/(4 - 4*x + 4*x^2 - x^3 + E^2*(4 - 4*x + x^2)),x]

[Out]

x + Log[4*(1 + E^2) - 4*(1 + E^2)*x + (4 + E^2)*x^2 - x^3]

Rule 1601

Int[(Pp_)/(Qq_), x_Symbol] :> With[{p = Expon[Pp, x], q = Expon[Qq, x]}, Simp[Coeff[Pp, x, p]*(Log[RemoveConte
nt[Qq, x]]/(q*Coeff[Qq, x, q])), x] /; EqQ[p, q - 1] && EqQ[Pp, Simplify[(Coeff[Pp, x, p]/(q*Coeff[Qq, x, q]))
*D[Qq, x]]]] /; PolyQ[Pp, x] && PolyQ[Qq, x]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {x \left (2 \left (2-e^2\right )+\left (1+e^2\right ) x-x^2\right )}{4 \left (1+e^2\right )-4 \left (1+e^2\right ) x+\left (4+e^2\right ) x^2-x^3} \, dx \\ & = \int \left (1-\frac {4 \left (1+e^2\right )-2 \left (4+e^2\right ) x+3 x^2}{4 \left (1+e^2\right )-4 \left (1+e^2\right ) x+\left (4+e^2\right ) x^2-x^3}\right ) \, dx \\ & = x-\int \frac {4 \left (1+e^2\right )-2 \left (4+e^2\right ) x+3 x^2}{4 \left (1+e^2\right )-4 \left (1+e^2\right ) x+\left (4+e^2\right ) x^2-x^3} \, dx \\ & = x+\log \left (4 \left (1+e^2\right )-4 \left (1+e^2\right ) x+\left (4+e^2\right ) x^2-x^3\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.57 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x+\log \left (4+4 e^2-4 x-4 e^2 x+4 x^2+e^2 x^2-x^3\right ) \]

[In]

Integrate[(4*x + x^2 - x^3 + E^2*(-2*x + x^2))/(4 - 4*x + 4*x^2 - x^3 + E^2*(4 - 4*x + x^2)),x]

[Out]

x + Log[4 + 4*E^2 - 4*x - 4*E^2*x + 4*x^2 + E^2*x^2 - x^3]

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.35

method result size
risch \(x +\ln \left (x^{3}+\left (-{\mathrm e}^{2}-4\right ) x^{2}+\left (4 \,{\mathrm e}^{2}+4\right ) x -4 \,{\mathrm e}^{2}-4\right )\) \(31\)
default \(x +\ln \left (x^{3}-4 x^{2}+4 x -x^{2} {\mathrm e}^{2}+4 \,{\mathrm e}^{2} x -4 \,{\mathrm e}^{2}-4\right )\) \(33\)
parallelrisch \(x +\ln \left (x^{3}-4 x^{2}+4 x -x^{2} {\mathrm e}^{2}+4 \,{\mathrm e}^{2} x -4 \,{\mathrm e}^{2}-4\right )\) \(33\)
norman \(x +\ln \left (x^{2} {\mathrm e}^{2}-x^{3}-4 \,{\mathrm e}^{2} x +4 x^{2}+4 \,{\mathrm e}^{2}-4 x +4\right )\) \(34\)

[In]

int(((x^2-2*x)*exp(2)-x^3+x^2+4*x)/((x^2-4*x+4)*exp(2)-x^3+4*x^2-4*x+4),x,method=_RETURNVERBOSE)

[Out]

x+ln(x^3+(-exp(2)-4)*x^2+(4*exp(2)+4)*x-4*exp(2)-4)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.22 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x + \log \left (x^{3} - 4 \, x^{2} - {\left (x^{2} - 4 \, x + 4\right )} e^{2} + 4 \, x - 4\right ) \]

[In]

integrate(((x^2-2*x)*exp(2)-x^3+x^2+4*x)/((x^2-4*x+4)*exp(2)-x^3+4*x^2-4*x+4),x, algorithm="fricas")

[Out]

x + log(x^3 - 4*x^2 - (x^2 - 4*x + 4)*e^2 + 4*x - 4)

Sympy [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.35 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x + \log {\left (x^{3} + x^{2} \left (- e^{2} - 4\right ) + x \left (4 + 4 e^{2}\right ) - 4 e^{2} - 4 \right )} \]

[In]

integrate(((x**2-2*x)*exp(2)-x**3+x**2+4*x)/((x**2-4*x+4)*exp(2)-x**3+4*x**2-4*x+4),x)

[Out]

x + log(x**3 + x**2*(-exp(2) - 4) + x*(4 + 4*exp(2)) - 4*exp(2) - 4)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.22 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x + \log \left (x^{3} - x^{2} {\left (e^{2} + 4\right )} + 4 \, x {\left (e^{2} + 1\right )} - 4 \, e^{2} - 4\right ) \]

[In]

integrate(((x^2-2*x)*exp(2)-x^3+x^2+4*x)/((x^2-4*x+4)*exp(2)-x^3+4*x^2-4*x+4),x, algorithm="maxima")

[Out]

x + log(x^3 - x^2*(e^2 + 4) + 4*x*(e^2 + 1) - 4*e^2 - 4)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.43 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x + \log \left ({\left | x^{3} - x^{2} e^{2} - 4 \, x^{2} + 4 \, x e^{2} + 4 \, x - 4 \, e^{2} - 4 \right |}\right ) \]

[In]

integrate(((x^2-2*x)*exp(2)-x^3+x^2+4*x)/((x^2-4*x+4)*exp(2)-x^3+4*x^2-4*x+4),x, algorithm="giac")

[Out]

x + log(abs(x^3 - x^2*e^2 - 4*x^2 + 4*x*e^2 + 4*x - 4*e^2 - 4))

Mupad [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.26 \[ \int \frac {4 x+x^2-x^3+e^2 \left (-2 x+x^2\right )}{4-4 x+4 x^2-x^3+e^2 \left (4-4 x+x^2\right )} \, dx=x+\ln \left (x^3+\left (-{\mathrm {e}}^2-4\right )\,x^2+\left (4\,{\mathrm {e}}^2+4\right )\,x-4\,{\mathrm {e}}^2-4\right ) \]

[In]

int((4*x - exp(2)*(2*x - x^2) + x^2 - x^3)/(exp(2)*(x^2 - 4*x + 4) - 4*x + 4*x^2 - x^3 + 4),x)

[Out]

x + log(x^3 - 4*exp(2) + x*(4*exp(2) + 4) - x^2*(exp(2) + 4) - 4)