3.9.65 \(\int \frac {-2 x^2+e^{4+x} (-24 x+12 x^2+e (-12+12 x))}{e^2 x^2+2 e x^3+x^4} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.78, antiderivative size = 30, normalized size of antiderivative = 1.30, number of steps used = 12, number of rules used = 5, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.104, Rules used = {1594, 27, 6742, 2177, 2178} \begin {gather*} -\frac {12 e^{x+3}}{x+e}+\frac {2}{x+e}+\frac {12 e^{x+3}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(12*E^(3 + x))/x + 2/(E + x) - (12*E^(3 + x))/(E + x)

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 1594

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 2177

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[((c + d*x)^(m
 + 1)*(b*F^(g*(e + f*x)))^n)/(d*(m + 1)), x] - Dist[(f*g*n*Log[F])/(d*(m + 1)), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !$UseGamma ===
True

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$UseGamma === True

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 {-2 x^2+e^{4+x} \left (-24 x+12 x^2+e (-12+12 x)\right )}{x^2 \left (e^2+2 e x+x^2\right )} \, dx\\ &=\int \frac {-2 x^2+e^{4+x} \left (-24 x+12 x^2+e (-12+12 x)\right )}{x^2 (e+x)^2} \, dx\\ &=\int \left (-\frac {2}{(e+x)^2}+\frac {12 e^{4+x} \left (-e-(2-e) x+x^2\right )}{x^2 (e+x)^2}\right ) \, dx\\ &=\frac {2}{e+x}+12 \int \frac {e^{4+x} \left (-e-(2-e) x+x^2\right )}{x^2 (e+x)^2} \, dx\\ &=\frac {2}{e+x}+12 \int \left (-\frac {e^{3+x}}{x^2}+\frac {e^{3+x}}{x}+\frac {e^{3+x}}{(e+x)^2}-\frac {e^{3+x}}{e+x}\right ) \, dx\\ &=\frac {2}{e+x}-12 \int \frac {e^{3+x}}{x^2} \, dx+12 \int \frac {e^{3+x}}{x} \, dx+12 \int \frac {e^{3+x}}{(e+x)^2} \, dx-12 \int \frac {e^{3+x}}{e+x} \, dx\\ &=\frac {12 e^{3+x}}{x}+\frac {2}{e+x}-\frac {12 e^{3+x}}{e+x}+12 e^3 \text {Ei}(x)-12 e^{3-e} \text {Ei}(e+x)-12 \int \frac {e^{3+x}}{x} \, dx+12 \int \frac {e^{3+x}}{e+x} \, dx\\ &=\frac {12 e^{3+x}}{x}+\frac {2}{e+x}-\frac {12 e^{3+x}}{e+x}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \left (6 e^{4+x}+x\right )}{e x+x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(2*(6*E^(4 + x) + x))/(E*x + x^2)

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \, {\left (x + 6 \, e^{\left (x + 4\right )}\right )}}{x^{2} + x e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(x + 6*e^(x + 4))/(x^2 + x*e)

________________________________________________________________________________________

giac [A]  time = 0.32, size = 20, normalized size = 0.87 \begin {gather*} \frac {2 \, {\left (x + 6 \, e^{\left (x + 4\right )}\right )}}{x^{2} + x e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(x + 6*e^(x + 4))/(x^2 + x*e)

________________________________________________________________________________________

maple [A]  time = 0.30, size = 21, normalized size = 0.91




method result size



norman \(\frac {12 \,{\mathrm e}^{4+x}+2 x}{x \left (x +{\mathrm e}\right )}\) \(21\)
risch \(\frac {2}{x +{\mathrm e}}+\frac {12 \,{\mathrm e}^{4+x}}{\left (x +{\mathrm e}\right ) x}\) \(25\)
derivativedivides \(\frac {64 \,{\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (64-8 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (-128+16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (-128+32 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (64+2 \,{\mathrm e}^{2}-16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \left ({\mathrm e}-4\right ) {\mathrm e}^{-2} \left (-16+2 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}-\frac {288 \,{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-288 \,{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-288 \,{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-60 \,{\mathrm e} \left (-\frac {{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )-\frac {120 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}+120 \,{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-120 \,{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-\frac {12 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}^{2}-4 \,{\mathrm e}^{2}-8 \left (4+x \right ) {\mathrm e}+48 \,{\mathrm e}+32 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-96 \,{\mathrm e}^{-2} \left (3 \,{\mathrm e}-4\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-12 \,{\mathrm e}^{-2} \left ({\mathrm e} \,{\mathrm e}^{2}-8 \,{\mathrm e}^{2}+8 \,{\mathrm e}+32\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )+12 \,{\mathrm e} \left (\frac {{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )+{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )\) \(626\)
default \(\frac {64 \,{\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (64-8 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (-128+16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \,{\mathrm e}^{-2} \left (-128+32 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}+\frac {\left (64+2 \,{\mathrm e}^{2}-16 \,{\mathrm e}\right ) {\mathrm e}^{-2} \left (4+x \right )-4 \left ({\mathrm e}-4\right ) {\mathrm e}^{-2} \left (-16+2 \,{\mathrm e}\right )}{x \left (x +{\mathrm e}\right )}-\frac {288 \,{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-288 \,{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-288 \,{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-60 \,{\mathrm e} \left (-\frac {{\mathrm e}^{4+x} \left ({\mathrm e}+2 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left ({\mathrm e}-2\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-{\mathrm e}^{-2} \left ({\mathrm e}+2\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )-\frac {120 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}+120 \,{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-120 \,{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )-\frac {12 \,{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}^{2}-4 \,{\mathrm e}^{2}-8 \left (4+x \right ) {\mathrm e}+48 \,{\mathrm e}+32 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-96 \,{\mathrm e}^{-2} \left (3 \,{\mathrm e}-4\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )-12 \,{\mathrm e}^{-2} \left ({\mathrm e} \,{\mathrm e}^{2}-8 \,{\mathrm e}^{2}+8 \,{\mathrm e}+32\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )+12 \,{\mathrm e} \left (\frac {{\mathrm e}^{4+x} \left (\left (4+x \right ) {\mathrm e}-8 \,{\mathrm e}-8 x \right ) {\mathrm e}^{-2}}{\left (4+x \right ) {\mathrm e}+\left (4+x \right )^{2}-4 \,{\mathrm e}-16-8 x}-{\mathrm e}^{-2} \left (5 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4} \expIntegralEi \left (1, -x \right )+{\mathrm e}^{-2} \left ({\mathrm e}^{2}-3 \,{\mathrm e}-8\right ) {\mathrm e}^{-1} {\mathrm e}^{4-{\mathrm e}} \expIntegralEi \left (1, -{\mathrm e}-x \right )\right )\) \(626\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(12*exp(4+x)+2*x)/x/(x+exp(1))

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 25, normalized size = 1.09 \begin {gather*} \frac {12 \, e^{\left (x + 4\right )}}{x^{2} + x e} + \frac {2}{x + e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

12*e^(x + 4)/(x^2 + x*e) + 2/(x + e)

________________________________________________________________________________________

mupad [B]  time = 0.17, size = 25, normalized size = 1.09 \begin {gather*} \frac {2\,{\mathrm {e}}^{-1}\,\left (6\,{\mathrm {e}}^{x+5}-x^2\right )}{x\,\left (x+\mathrm {e}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*exp(-1)*(6*exp(x + 5) - x^2))/(x*(x + exp(1)))

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 20, normalized size = 0.87 \begin {gather*} \frac {12 e^{x + 4}}{x^{2} + e x} + \frac {2}{x + e} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

12*exp(x + 4)/(x**2 + E*x) + 2/(x + E)

________________________________________________________________________________________