3.79.98 \(\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\)

Optimal. Leaf size=23 \[ 2+x-\log \left (\frac {1}{-4+(-2+x)^2 \left (-e^2+x\right )}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.27, antiderivative size = 33, normalized size of antiderivative = 1.43, number of steps used = 4, number of rules used = 3, integrand size = 53, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.057, Rules used = {6741, 6742, 1587} \begin {gather*} \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 \end {gather*}

Antiderivative was successfully verified.

[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 1587

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]*D[Qq, x])/(q*Coeff[Q
q, x, q])]]] /; PolyQ[Pp, x] && PolyQ[Qq, x]

Rule 6741

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

Rule 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 36, normalized size = 1.57 \begin {gather*} x+\log \left (4+4 e^2-4 x-4 e^2 x+4 x^2+e^2 x^2-x^3\right ) \end {gather*}

Antiderivative was successfully verified.

[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]

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 28, normalized size = 1.22 \begin {gather*} x + \log \left (x^{3} - 4 \, x^{2} - {\left (x^{2} - 4 \, x + 4\right )} e^{2} + 4 \, x - 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 33, normalized size = 1.43 \begin {gather*} 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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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))

________________________________________________________________________________________

maple [A]  time = 0.05, size = 31, normalized size = 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 (-4+x^{3}-4 x^{2}+4 x -x^{2} {\mathrm e}^{2}+4 \,{\mathrm e}^{2} x -4 \,{\mathrm e}^{2}\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\)



Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 28, normalized size = 1.22 \begin {gather*} x + \log \left (x^{3} - x^{2} {\left (e^{2} + 4\right )} + 4 \, x {\left (e^{2} + 1\right )} - 4 \, e^{2} - 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

mupad [B]  time = 0.22, size = 29, normalized size = 1.26 \begin {gather*} 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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

sympy [A]  time = 0.43, size = 31, normalized size = 1.35 \begin {gather*} x + \log {\left (x^{3} + x^{2} \left (- e^{2} - 4\right ) + x \left (4 + 4 e^{2}\right ) - 4 e^{2} - 4 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________