\(\int \frac {-12+3 e^5+6 x-x^2+e^{2 x} (-64+104 x-52 x^2+8 x^3+e^5 (64-104 x+52 x^2-8 x^3))}{9-6 x+x^2} \, dx\) [909]

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

Optimal result

Integrand size = 66, antiderivative size = 33 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=-4-x+\frac {\left (-1+e^5\right ) \left (e^{2 x} (4-2 x)^2+x\right )}{3-x} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(70\) vs. \(2(33)=66\).

Time = 0.30 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.12, number of steps used = 14, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {27, 6873, 6874, 697, 2230, 2225, 2208, 2209, 2207} \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=4 \left (1-e^5\right ) e^{2 x} x-x-\frac {4 \left (1-e^5\right ) e^{2 x}}{3-x}-\frac {3 \left (1-e^5\right )}{3-x}-4 \left (1-e^5\right ) e^{2 x} \]

[In]

Int[(-12 + 3*E^5 + 6*x - x^2 + E^(2*x)*(-64 + 104*x - 52*x^2 + 8*x^3 + E^5*(64 - 104*x + 52*x^2 - 8*x^3)))/(9
- 6*x + x^2),x]

[Out]

-4*E^(2*x)*(1 - E^5) - (3*(1 - E^5))/(3 - x) - (4*E^(2*x)*(1 - E^5))/(3 - x) - x + 4*E^(2*x)*(1 - E^5)*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 697

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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 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 {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{(-3+x)^2} \, dx \\ & = \int \frac {-12 \left (1-\frac {e^5}{4}\right )+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{(3-x)^2} \, dx \\ & = \int \left (\frac {-3 \left (4-e^5\right )+6 x-x^2}{(3-x)^2}-\frac {4 (-1+e) e^{2 x} \left (1+e+e^2+e^3+e^4\right ) (-2+x) \left (8-9 x+2 x^2\right )}{(-3+x)^2}\right ) \, dx \\ & = \left (4 \left (1-e^5\right )\right ) \int \frac {e^{2 x} (-2+x) \left (8-9 x+2 x^2\right )}{(-3+x)^2} \, dx+\int \frac {-3 \left (4-e^5\right )+6 x-x^2}{(3-x)^2} \, dx \\ & = \left (4 \left (1-e^5\right )\right ) \int \left (-e^{2 x}-\frac {e^{2 x}}{(-3+x)^2}+\frac {2 e^{2 x}}{-3+x}+2 e^{2 x} x\right ) \, dx+\int \left (-1+\frac {3 \left (-1+e^5\right )}{(-3+x)^2}\right ) \, dx \\ & = -\frac {3 \left (1-e^5\right )}{3-x}-x-\left (4 \left (1-e^5\right )\right ) \int e^{2 x} \, dx-\left (4 \left (1-e^5\right )\right ) \int \frac {e^{2 x}}{(-3+x)^2} \, dx+\left (8 \left (1-e^5\right )\right ) \int \frac {e^{2 x}}{-3+x} \, dx+\left (8 \left (1-e^5\right )\right ) \int e^{2 x} x \, dx \\ & = -2 e^{2 x} \left (1-e^5\right )-\frac {3 \left (1-e^5\right )}{3-x}-\frac {4 e^{2 x} \left (1-e^5\right )}{3-x}-x+4 e^{2 x} \left (1-e^5\right ) x+8 e^6 \left (1-e^5\right ) \operatorname {ExpIntegralEi}(-2 (3-x))-\left (4 \left (1-e^5\right )\right ) \int e^{2 x} \, dx-\left (8 \left (1-e^5\right )\right ) \int \frac {e^{2 x}}{-3+x} \, dx \\ & = -4 e^{2 x} \left (1-e^5\right )-\frac {3 \left (1-e^5\right )}{3-x}-\frac {4 e^{2 x} \left (1-e^5\right )}{3-x}-x+4 e^{2 x} \left (1-e^5\right ) x \\ \end{align*}

Mathematica [A] (verified)

Time = 2.87 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.42 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=\frac {3-3 e^5+4 e^{2 x} (-2+x)^2-4 e^{5+2 x} (-2+x)^2+3 x-x^2}{-3+x} \]

[In]

Integrate[(-12 + 3*E^5 + 6*x - x^2 + E^(2*x)*(-64 + 104*x - 52*x^2 + 8*x^3 + E^5*(64 - 104*x + 52*x^2 - 8*x^3)
))/(9 - 6*x + x^2),x]

[Out]

(3 - 3*E^5 + 4*E^(2*x)*(-2 + x)^2 - 4*E^(5 + 2*x)*(-2 + x)^2 + 3*x - x^2)/(-3 + x)

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.67

method result size
norman \(\frac {\left (16-16 \,{\mathrm e}^{5}\right ) {\mathrm e}^{2 x}+\left (-16+16 \,{\mathrm e}^{5}\right ) x \,{\mathrm e}^{2 x}+\left (-4 \,{\mathrm e}^{5}+4\right ) x^{2} {\mathrm e}^{2 x}-x^{2}+12-3 \,{\mathrm e}^{5}}{-3+x}\) \(55\)
risch \(-x +\frac {3}{-3+x}-\frac {3 \,{\mathrm e}^{5}}{-3+x}-\frac {4 \left (x^{2} {\mathrm e}^{5}-4 x \,{\mathrm e}^{5}-x^{2}+4 \,{\mathrm e}^{5}+4 x -4\right ) {\mathrm e}^{2 x}}{-3+x}\) \(57\)
parallelrisch \(-\frac {4 \,{\mathrm e}^{5} {\mathrm e}^{2 x} x^{2}-16 \,{\mathrm e}^{5} {\mathrm e}^{2 x} x -4 \,{\mathrm e}^{2 x} x^{2}+16 \,{\mathrm e}^{5} {\mathrm e}^{2 x}+16 x \,{\mathrm e}^{2 x}+x^{2}-12-16 \,{\mathrm e}^{2 x}+3 \,{\mathrm e}^{5}}{-3+x}\) \(67\)
parts \(-x -\frac {-3+3 \,{\mathrm e}^{5}}{-3+x}+\frac {4 \,{\mathrm e}^{2 x}}{-3+x}+64 \,{\mathrm e}^{5} \left (-\frac {{\mathrm e}^{2 x}}{-3+x}-2 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )\right )-4 \,{\mathrm e}^{2 x}+4 x \,{\mathrm e}^{2 x}-104 \,{\mathrm e}^{5} \left (-7 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {3 \,{\mathrm e}^{2 x}}{-3+x}\right )+52 \,{\mathrm e}^{5} \left (\frac {{\mathrm e}^{2 x}}{2}-24 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {9 \,{\mathrm e}^{2 x}}{-3+x}\right )-8 \,{\mathrm e}^{5} \left (\frac {11 \,{\mathrm e}^{2 x}}{4}+\frac {x \,{\mathrm e}^{2 x}}{2}-81 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {27 \,{\mathrm e}^{2 x}}{-3+x}\right )\) \(169\)
default \(\frac {3}{-3+x}-x -\frac {3 \,{\mathrm e}^{5}}{-3+x}+\frac {4 \,{\mathrm e}^{2 x}}{-3+x}+64 \,{\mathrm e}^{5} \left (-\frac {{\mathrm e}^{2 x}}{-3+x}-2 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )\right )-4 \,{\mathrm e}^{2 x}+4 x \,{\mathrm e}^{2 x}-104 \,{\mathrm e}^{5} \left (-7 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {3 \,{\mathrm e}^{2 x}}{-3+x}\right )+52 \,{\mathrm e}^{5} \left (\frac {{\mathrm e}^{2 x}}{2}-24 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {9 \,{\mathrm e}^{2 x}}{-3+x}\right )-8 \,{\mathrm e}^{5} \left (\frac {11 \,{\mathrm e}^{2 x}}{4}+\frac {x \,{\mathrm e}^{2 x}}{2}-81 \,{\mathrm e}^{6} \operatorname {Ei}_{1}\left (6-2 x \right )-\frac {27 \,{\mathrm e}^{2 x}}{-3+x}\right )\) \(172\)

[In]

int((((-8*x^3+52*x^2-104*x+64)*exp(5)+8*x^3-52*x^2+104*x-64)*exp(x)^2+3*exp(5)-x^2+6*x-12)/(x^2-6*x+9),x,metho
d=_RETURNVERBOSE)

[Out]

((16-16*exp(5))*exp(x)^2+(-16+16*exp(5))*x*exp(x)^2+(-4*exp(5)+4)*x^2*exp(x)^2-x^2+12-3*exp(5))/(-3+x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.36 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=-\frac {x^{2} - 4 \, {\left (x^{2} - {\left (x^{2} - 4 \, x + 4\right )} e^{5} - 4 \, x + 4\right )} e^{\left (2 \, x\right )} - 3 \, x + 3 \, e^{5} - 3}{x - 3} \]

[In]

integrate((((-8*x^3+52*x^2-104*x+64)*exp(5)+8*x^3-52*x^2+104*x-64)*exp(x)^2+3*exp(5)-x^2+6*x-12)/(x^2-6*x+9),x
, algorithm="fricas")

[Out]

-(x^2 - 4*(x^2 - (x^2 - 4*x + 4)*e^5 - 4*x + 4)*e^(2*x) - 3*x + 3*e^5 - 3)/(x - 3)

Sympy [B] (verification not implemented)

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

Time = 0.11 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.48 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=- x + \frac {\left (- 4 x^{2} e^{5} + 4 x^{2} - 16 x + 16 x e^{5} - 16 e^{5} + 16\right ) e^{2 x}}{x - 3} - \frac {-3 + 3 e^{5}}{x - 3} \]

[In]

integrate((((-8*x**3+52*x**2-104*x+64)*exp(5)+8*x**3-52*x**2+104*x-64)*exp(x)**2+3*exp(5)-x**2+6*x-12)/(x**2-6
*x+9),x)

[Out]

-x + (-4*x**2*exp(5) + 4*x**2 - 16*x + 16*x*exp(5) - 16*exp(5) + 16)*exp(2*x)/(x - 3) - (-3 + 3*exp(5))/(x - 3
)

Maxima [F]

\[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=\int { -\frac {x^{2} - 4 \, {\left (2 \, x^{3} - 13 \, x^{2} - {\left (2 \, x^{3} - 13 \, x^{2} + 26 \, x - 16\right )} e^{5} + 26 \, x - 16\right )} e^{\left (2 \, x\right )} - 6 \, x - 3 \, e^{5} + 12}{x^{2} - 6 \, x + 9} \,d x } \]

[In]

integrate((((-8*x^3+52*x^2-104*x+64)*exp(5)+8*x^3-52*x^2+104*x-64)*exp(x)^2+3*exp(5)-x^2+6*x-12)/(x^2-6*x+9),x
, algorithm="maxima")

[Out]

-x - 4*(x^3*(e^5 - 1) - 7*x^2*(e^5 - 1) + 16*x*(e^5 - 1))*e^(2*x)/(x^2 - 6*x + 9) + 64*e^6*exp_integral_e(2, -
2*x + 6)/(x - 3) - 3*e^5/(x - 3) + 3/(x - 3) + integrate(32*(x*(3*e^5 - 1) - 12*e^5 + 6)*e^(2*x)/(x^3 - 9*x^2
+ 27*x - 27), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (29) = 58\).

Time = 0.28 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.12 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=\frac {4 \, x^{2} e^{\left (2 \, x\right )} - 4 \, x^{2} e^{\left (2 \, x + 5\right )} - x^{2} - 16 \, x e^{\left (2 \, x\right )} + 16 \, x e^{\left (2 \, x + 5\right )} + 3 \, x - 3 \, e^{5} + 16 \, e^{\left (2 \, x\right )} - 16 \, e^{\left (2 \, x + 5\right )} + 3}{x - 3} \]

[In]

integrate((((-8*x^3+52*x^2-104*x+64)*exp(5)+8*x^3-52*x^2+104*x-64)*exp(x)^2+3*exp(5)-x^2+6*x-12)/(x^2-6*x+9),x
, algorithm="giac")

[Out]

(4*x^2*e^(2*x) - 4*x^2*e^(2*x + 5) - x^2 - 16*x*e^(2*x) + 16*x*e^(2*x + 5) + 3*x - 3*e^5 + 16*e^(2*x) - 16*e^(
2*x + 5) + 3)/(x - 3)

Mupad [B] (verification not implemented)

Time = 8.48 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.67 \[ \int \frac {-12+3 e^5+6 x-x^2+e^{2 x} \left (-64+104 x-52 x^2+8 x^3+e^5 \left (64-104 x+52 x^2-8 x^3\right )\right )}{9-6 x+x^2} \, dx=-\frac {x\,\left ({\mathrm {e}}^5-4\right )+{\mathrm {e}}^{2\,x}\,\left (16\,{\mathrm {e}}^5-16\right )+x^2-x\,{\mathrm {e}}^{2\,x}\,\left (16\,{\mathrm {e}}^5-16\right )+x^2\,{\mathrm {e}}^{2\,x}\,\left (4\,{\mathrm {e}}^5-4\right )}{x-3} \]

[In]

int(-(exp(2*x)*(exp(5)*(104*x - 52*x^2 + 8*x^3 - 64) - 104*x + 52*x^2 - 8*x^3 + 64) - 3*exp(5) - 6*x + x^2 + 1
2)/(x^2 - 6*x + 9),x)

[Out]

-(x*(exp(5) - 4) + exp(2*x)*(16*exp(5) - 16) + x^2 - x*exp(2*x)*(16*exp(5) - 16) + x^2*exp(2*x)*(4*exp(5) - 4)
)/(x - 3)