\(\int \frac {e^{-4 x} (e^{4 x} (-18 x^2-2 x^3)+e^{6 x} (6 x+6 x^2+2 x^3)+e^{2 x} (12 x^3-4 x^4-2 x^5))}{675+675 x+225 x^2+25 x^3} \, dx\) [5523]

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

Optimal result

Integrand size = 83, antiderivative size = 28 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=\frac {e^{2 x} x^2 \left (-1+e^{-2 x} x\right )^2}{25 (3+x)^2} \]

[Out]

1/25*exp(x)^2/(3+x)^2*(x/exp(2*x)-1)^2*x^2

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(109\) vs. \(2(28)=56\).

Time = 0.64 (sec) , antiderivative size = 109, normalized size of antiderivative = 3.89, number of steps used = 28, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.108, Rules used = {6820, 12, 6874, 75, 2230, 2225, 2207, 2208, 2209} \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=-\frac {2 x^3}{25 (x+3)^2}+\frac {1}{25} e^{-2 x} x^2-\frac {6}{25} e^{-2 x} x+\frac {27 e^{-2 x}}{25}+\frac {e^{2 x}}{25}-\frac {108 e^{-2 x}}{25 (x+3)}-\frac {6 e^{2 x}}{25 (x+3)}+\frac {81 e^{-2 x}}{25 (x+3)^2}+\frac {9 e^{2 x}}{25 (x+3)^2} \]

[In]

Int[(E^(4*x)*(-18*x^2 - 2*x^3) + E^(6*x)*(6*x + 6*x^2 + 2*x^3) + E^(2*x)*(12*x^3 - 4*x^4 - 2*x^5))/(E^(4*x)*(6
75 + 675*x + 225*x^2 + 25*x^3)),x]

[Out]

27/(25*E^(2*x)) + E^(2*x)/25 - (6*x)/(25*E^(2*x)) + x^2/(25*E^(2*x)) + 81/(25*E^(2*x)*(3 + x)^2) + (9*E^(2*x))
/(25*(3 + x)^2) - (2*x^3)/(25*(3 + x)^2) - 108/(25*E^(2*x)*(3 + x)) - (6*E^(2*x))/(25*(3 + x))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 75

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2, 0] &
& EqQ[a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)), 0]

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), 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] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2208

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] &&  !TrueQ[$UseGamm
a]

Rule 2209

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

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

Rule 6820

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

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {2 e^{-2 x} x \left (-e^{2 x} x (9+x)-x^2 \left (-6+2 x+x^2\right )+e^{4 x} \left (3+3 x+x^2\right )\right )}{25 (3+x)^3} \, dx \\ & = \frac {2}{25} \int \frac {e^{-2 x} x \left (-e^{2 x} x (9+x)-x^2 \left (-6+2 x+x^2\right )+e^{4 x} \left (3+3 x+x^2\right )\right )}{(3+x)^3} \, dx \\ & = \frac {2}{25} \int \left (-\frac {x^2 (9+x)}{(3+x)^3}-\frac {e^{-2 x} x^3 \left (-6+2 x+x^2\right )}{(3+x)^3}+\frac {e^{2 x} x \left (3+3 x+x^2\right )}{(3+x)^3}\right ) \, dx \\ & = -\left (\frac {2}{25} \int \frac {x^2 (9+x)}{(3+x)^3} \, dx\right )-\frac {2}{25} \int \frac {e^{-2 x} x^3 \left (-6+2 x+x^2\right )}{(3+x)^3} \, dx+\frac {2}{25} \int \frac {e^{2 x} x \left (3+3 x+x^2\right )}{(3+x)^3} \, dx \\ & = -\frac {2 x^3}{25 (3+x)^2}-\frac {2}{25} \int \left (30 e^{-2 x}-7 e^{-2 x} x+e^{-2 x} x^2+\frac {81 e^{-2 x}}{(3+x)^3}+\frac {27 e^{-2 x}}{(3+x)^2}-\frac {108 e^{-2 x}}{3+x}\right ) \, dx+\frac {2}{25} \int \left (e^{2 x}-\frac {9 e^{2 x}}{(3+x)^3}+\frac {12 e^{2 x}}{(3+x)^2}-\frac {6 e^{2 x}}{3+x}\right ) \, dx \\ & = -\frac {2 x^3}{25 (3+x)^2}+\frac {2}{25} \int e^{2 x} \, dx-\frac {2}{25} \int e^{-2 x} x^2 \, dx-\frac {12}{25} \int \frac {e^{2 x}}{3+x} \, dx+\frac {14}{25} \int e^{-2 x} x \, dx-\frac {18}{25} \int \frac {e^{2 x}}{(3+x)^3} \, dx+\frac {24}{25} \int \frac {e^{2 x}}{(3+x)^2} \, dx-\frac {54}{25} \int \frac {e^{-2 x}}{(3+x)^2} \, dx-\frac {12}{5} \int e^{-2 x} \, dx-\frac {162}{25} \int \frac {e^{-2 x}}{(3+x)^3} \, dx+\frac {216}{25} \int \frac {e^{-2 x}}{3+x} \, dx \\ & = \frac {6 e^{-2 x}}{5}+\frac {e^{2 x}}{25}-\frac {7}{25} e^{-2 x} x+\frac {1}{25} e^{-2 x} x^2+\frac {81 e^{-2 x}}{25 (3+x)^2}+\frac {9 e^{2 x}}{25 (3+x)^2}-\frac {2 x^3}{25 (3+x)^2}+\frac {54 e^{-2 x}}{25 (3+x)}-\frac {24 e^{2 x}}{25 (3+x)}+\frac {216}{25} e^6 \text {Ei}(-2 (3+x))-\frac {12 \text {Ei}(2 (3+x))}{25 e^6}-\frac {2}{25} \int e^{-2 x} x \, dx+\frac {7}{25} \int e^{-2 x} \, dx-\frac {18}{25} \int \frac {e^{2 x}}{(3+x)^2} \, dx+\frac {48}{25} \int \frac {e^{2 x}}{3+x} \, dx+\frac {108}{25} \int \frac {e^{-2 x}}{3+x} \, dx+\frac {162}{25} \int \frac {e^{-2 x}}{(3+x)^2} \, dx \\ & = \frac {53 e^{-2 x}}{50}+\frac {e^{2 x}}{25}-\frac {6}{25} e^{-2 x} x+\frac {1}{25} e^{-2 x} x^2+\frac {81 e^{-2 x}}{25 (3+x)^2}+\frac {9 e^{2 x}}{25 (3+x)^2}-\frac {2 x^3}{25 (3+x)^2}-\frac {108 e^{-2 x}}{25 (3+x)}-\frac {6 e^{2 x}}{25 (3+x)}+\frac {324}{25} e^6 \text {Ei}(-2 (3+x))+\frac {36 \text {Ei}(2 (3+x))}{25 e^6}-\frac {1}{25} \int e^{-2 x} \, dx-\frac {36}{25} \int \frac {e^{2 x}}{3+x} \, dx-\frac {324}{25} \int \frac {e^{-2 x}}{3+x} \, dx \\ & = \frac {27 e^{-2 x}}{25}+\frac {e^{2 x}}{25}-\frac {6}{25} e^{-2 x} x+\frac {1}{25} e^{-2 x} x^2+\frac {81 e^{-2 x}}{25 (3+x)^2}+\frac {9 e^{2 x}}{25 (3+x)^2}-\frac {2 x^3}{25 (3+x)^2}-\frac {108 e^{-2 x}}{25 (3+x)}-\frac {6 e^{2 x}}{25 (3+x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 7.64 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.79 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=-\frac {e^{-2 x} \left (-e^{4 x} x^2-x^4+2 e^{2 x} \left (54+36 x+6 x^2+x^3\right )\right )}{25 (3+x)^2} \]

[In]

Integrate[(E^(4*x)*(-18*x^2 - 2*x^3) + E^(6*x)*(6*x + 6*x^2 + 2*x^3) + E^(2*x)*(12*x^3 - 4*x^4 - 2*x^5))/(E^(4
*x)*(675 + 675*x + 225*x^2 + 25*x^3)),x]

[Out]

-1/25*(-(E^(4*x)*x^2) - x^4 + 2*E^(2*x)*(54 + 36*x + 6*x^2 + x^3))/(E^(2*x)*(3 + x)^2)

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.75

method result size
risch \(-\frac {2 x}{25}+\frac {-\frac {54 x}{25}-\frac {108}{25}}{x^{2}+6 x +9}+\frac {x^{2} {\mathrm e}^{2 x}}{25 \left (3+x \right )^{2}}+\frac {x^{4} {\mathrm e}^{-2 x}}{25 \left (3+x \right )^{2}}\) \(49\)
parallelrisch \(-\frac {\left (-6 \,{\mathrm e}^{2 x} x^{4}+12 x^{3} \left ({\mathrm e}^{2 x}\right )^{2}-6 \,{\mathrm e}^{4 x} {\mathrm e}^{2 x} x^{2}\right ) {\mathrm e}^{-4 x}}{150 \left (x^{2}+6 x +9\right )}\) \(57\)
default \(-\frac {54}{25 \left (3+x \right )}+\frac {54}{25 \left (3+x \right )^{2}}-\frac {2 x}{25}-\frac {6 \,{\mathrm e}^{-2 x}}{25}-\frac {162 \,{\mathrm e}^{-2 x} \left (4 x +11\right )}{25 \left (x^{2}+6 x +9\right )}+\frac {\left (2 x -17\right ) {\mathrm e}^{-2 x}}{25}-\frac {54 \,{\mathrm e}^{-2 x} \left (14 x +39\right )}{25 \left (x^{2}+6 x +9\right )}+\frac {\left (x^{2}-8 x +50\right ) {\mathrm e}^{-2 x}}{25}+\frac {81 \,{\mathrm e}^{-2 x} \left (16 x +45\right )}{25 \left (x^{2}+6 x +9\right )}-\frac {6 \,{\mathrm e}^{2 x}}{25 \left (3+x \right )}+\frac {9 \,{\mathrm e}^{2 x}}{25 \left (3+x \right )^{2}}+\frac {{\mathrm e}^{2 x}}{25}\) \(141\)

[In]

int(((2*x^3+6*x^2+6*x)*exp(x)^2*exp(2*x)^2+(-2*x^3-18*x^2)*exp(x)^2*exp(2*x)+(-2*x^5-4*x^4+12*x^3)*exp(x)^2)/(
25*x^3+225*x^2+675*x+675)/exp(2*x)^2,x,method=_RETURNVERBOSE)

[Out]

-2/25*x+(-54/25*x-108/25)/(x^2+6*x+9)+1/25*x^2/(3+x)^2*exp(2*x)+1/25*x^4/(3+x)^2*exp(-2*x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.68 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=\frac {{\left (x^{4} + x^{2} e^{\left (4 \, x\right )} - 2 \, {\left (x^{3} + 6 \, x^{2} + 36 \, x + 54\right )} e^{\left (2 \, x\right )}\right )} e^{\left (-2 \, x\right )}}{25 \, {\left (x^{2} + 6 \, x + 9\right )}} \]

[In]

integrate(((2*x^3+6*x^2+6*x)*exp(x)^2*exp(2*x)^2+(-2*x^3-18*x^2)*exp(x)^2*exp(2*x)+(-2*x^5-4*x^4+12*x^3)*exp(x
)^2)/(25*x^3+225*x^2+675*x+675)/exp(2*x)^2,x, algorithm="fricas")

[Out]

1/25*(x^4 + x^2*e^(4*x) - 2*(x^3 + 6*x^2 + 36*x + 54)*e^(2*x))*e^(-2*x)/(x^2 + 6*x + 9)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 80 vs. \(2 (24) = 48\).

Time = 0.12 (sec) , antiderivative size = 80, normalized size of antiderivative = 2.86 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=- \frac {2 x}{25} - \frac {54 x + 108}{25 x^{2} + 150 x + 225} + \frac {\left (25 x^{4} + 150 x^{3} + 225 x^{2}\right ) e^{2 x} + \left (25 x^{6} + 150 x^{5} + 225 x^{4}\right ) e^{- 2 x}}{625 x^{4} + 7500 x^{3} + 33750 x^{2} + 67500 x + 50625} \]

[In]

integrate(((2*x**3+6*x**2+6*x)*exp(x)**2*exp(2*x)**2+(-2*x**3-18*x**2)*exp(x)**2*exp(2*x)+(-2*x**5-4*x**4+12*x
**3)*exp(x)**2)/(25*x**3+225*x**2+675*x+675)/exp(2*x)**2,x)

[Out]

-2*x/25 - (54*x + 108)/(25*x**2 + 150*x + 225) + ((25*x**4 + 150*x**3 + 225*x**2)*exp(2*x) + (25*x**6 + 150*x*
*5 + 225*x**4)*exp(-2*x))/(625*x**4 + 7500*x**3 + 33750*x**2 + 67500*x + 50625)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.54 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=\frac {x^{4} e^{\left (-2 \, x\right )} - 2 \, x^{3} + x^{2} e^{\left (2 \, x\right )} - 12 \, x^{2} - 72 \, x - 108}{25 \, {\left (x^{2} + 6 \, x + 9\right )}} \]

[In]

integrate(((2*x^3+6*x^2+6*x)*exp(x)^2*exp(2*x)^2+(-2*x^3-18*x^2)*exp(x)^2*exp(2*x)+(-2*x^5-4*x^4+12*x^3)*exp(x
)^2)/(25*x^3+225*x^2+675*x+675)/exp(2*x)^2,x, algorithm="maxima")

[Out]

1/25*(x^4*e^(-2*x) - 2*x^3 + x^2*e^(2*x) - 12*x^2 - 72*x - 108)/(x^2 + 6*x + 9)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.54 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=\frac {x^{4} e^{\left (-2 \, x\right )} - 2 \, x^{3} + x^{2} e^{\left (2 \, x\right )} - 12 \, x^{2} - 72 \, x - 108}{25 \, {\left (x^{2} + 6 \, x + 9\right )}} \]

[In]

integrate(((2*x^3+6*x^2+6*x)*exp(x)^2*exp(2*x)^2+(-2*x^3-18*x^2)*exp(x)^2*exp(2*x)+(-2*x^5-4*x^4+12*x^3)*exp(x
)^2)/(25*x^3+225*x^2+675*x+675)/exp(2*x)^2,x, algorithm="giac")

[Out]

1/25*(x^4*e^(-2*x) - 2*x^3 + x^2*e^(2*x) - 12*x^2 - 72*x - 108)/(x^2 + 6*x + 9)

Mupad [B] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.86 \[ \int \frac {e^{-4 x} \left (e^{4 x} \left (-18 x^2-2 x^3\right )+e^{6 x} \left (6 x+6 x^2+2 x^3\right )+e^{2 x} \left (12 x^3-4 x^4-2 x^5\right )\right )}{675+675 x+225 x^2+25 x^3} \, dx=\frac {x^2\,{\mathrm {e}}^{-2\,x}\,{\left (x-{\mathrm {e}}^{2\,x}\right )}^2}{25\,{\left (x+3\right )}^2} \]

[In]

int(-(exp(-4*x)*(exp(4*x)*(18*x^2 + 2*x^3) - exp(6*x)*(6*x + 6*x^2 + 2*x^3) + exp(2*x)*(4*x^4 - 12*x^3 + 2*x^5
)))/(675*x + 225*x^2 + 25*x^3 + 675),x)

[Out]

(x^2*exp(-2*x)*(x - exp(2*x))^2)/(25*(x + 3)^2)