3.91.15 \(\int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7)}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx\) [9015]

Optimal. Leaf size=34 \[ -5-2 x-x \left (-e^x+\frac {\left (x+\frac {4}{-3+\frac {3}{x}+x}\right )^2}{x}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.30, antiderivative size = 55, normalized size of antiderivative = 1.62, number of steps used = 8, number of rules used = 5, integrand size = 103, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {6820, 2207, 2225, 1674, 1600} \begin {gather*} -x^2+\frac {8 (1-3 x)}{x^2-3 x+3}+\frac {48 (1-x)}{\left (x^2-3 x+3\right )^2}-2 x-e^x+e^x (x+1) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-54 - 132*x + 162*x^2 - 142*x^3 + 114*x^4 - 54*x^5 + 16*x^6 - 2*x^7 + E^x*(27 - 54*x + 27*x^2 + 27*x^3 -
45*x^4 + 27*x^5 - 8*x^6 + x^7))/(27 - 81*x + 108*x^2 - 81*x^3 + 36*x^4 - 9*x^5 + x^6),x]

[Out]

-E^x - 2*x - x^2 + E^x*(1 + x) + (48*(1 - x))/(3 - 3*x + x^2)^2 + (8*(1 - 3*x))/(3 - 3*x + x^2)

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1674

Int[(Pq_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x + c*
x^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x + c*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b
*x + c*x^2, x], x, 1]}, Simp[(b*f - 2*a*g + (2*c*f - b*g)*x)*((a + b*x + c*x^2)^(p + 1)/((p + 1)*(b^2 - 4*a*c)
)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1)*ExpandToSum[(p + 1)*(b^2 - 4*a*c)*Q - (
2*p + 3)*(2*c*f - b*g), x], x], x]] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[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 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 6820

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \left (e^x (1+x)-\frac {2 \left (27+66 x-81 x^2+71 x^3-57 x^4+27 x^5-8 x^6+x^7\right )}{\left (3-3 x+x^2\right )^3}\right ) \, dx\\ &=-\left (2 \int \frac {27+66 x-81 x^2+71 x^3-57 x^4+27 x^5-8 x^6+x^7}{\left (3-3 x+x^2\right )^3} \, dx\right )+\int e^x (1+x) \, dx\\ &=e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}-\frac {1}{3} \int \frac {198-6 x-90 x^2+54 x^3-30 x^4+6 x^5}{\left (3-3 x+x^2\right )^2} \, dx-\int e^x \, dx\\ &=-e^x+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}-\frac {1}{9} \int \frac {54-36 x^2+18 x^3}{3-3 x+x^2} \, dx\\ &=-e^x+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}-\frac {1}{9} \int (18+18 x) \, dx\\ &=-e^x-2 x-x^2+e^x (1+x)+\frac {48 (1-x)}{\left (3-3 x+x^2\right )^2}+\frac {8 (1-3 x)}{3-3 x+x^2}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 46, normalized size = 1.35 \begin {gather*} -2 x+e^x x-x^2-\frac {48 (-1+x)}{\left (3-3 x+x^2\right )^2}-\frac {8 (-1+3 x)}{3-3 x+x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-54 - 132*x + 162*x^2 - 142*x^3 + 114*x^4 - 54*x^5 + 16*x^6 - 2*x^7 + E^x*(27 - 54*x + 27*x^2 + 27*
x^3 - 45*x^4 + 27*x^5 - 8*x^6 + x^7))/(27 - 81*x + 108*x^2 - 81*x^3 + 36*x^4 - 9*x^5 + x^6),x]

[Out]

-2*x + E^x*x - x^2 - (48*(-1 + x))/(3 - 3*x + x^2)^2 - (8*(-1 + 3*x))/(3 - 3*x + x^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(534\) vs. \(2(33)=66\).
time = 0.84, size = 535, normalized size = 15.74

method result size
risch \(-x^{2}-2 x +\frac {-24 x^{3}+80 x^{2}-144 x +72}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}+{\mathrm e}^{x} x\) \(50\)
norman \(\frac {x^{5} {\mathrm e}^{x}-54 x -9 x^{4}+17 x^{2}+4 x^{5}-x^{6}+9 \,{\mathrm e}^{x} x -18 \,{\mathrm e}^{x} x^{2}+15 \,{\mathrm e}^{x} x^{3}-6 \,{\mathrm e}^{x} x^{4}+18}{\left (x^{2}-3 x +3\right )^{2}}\) \(69\)
default \(-2 x -x^{2}-8 \,{\mathrm e}^{x}+\left (x +8\right ) {\mathrm e}^{x}+\frac {27 \,{\mathrm e}^{x} \left (8 x^{3}-37 x^{2}+63 x -42\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-18 x^{2}+15 x +3\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {22 \left (3 x -6\right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {142 \left (3 x^{3}-14 x^{2}+24 x -\frac {33}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {270 x^{3}-1215 x^{2}+2106 x -1458}{\left (x^{2}-3 x +3\right )^{2}}+\frac {570 x^{3}-2907 x^{2}+5130 x -3591}{\left (x^{2}-3 x +3\right )^{2}}+\frac {81 \,{\mathrm e}^{x} \left (5 x^{3}-31 x^{2}+60 x -45\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {45 \,{\mathrm e}^{x} \left (13 x^{3}-66 x^{2}+117 x -81\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {-432 x^{2}+1152 x -1080}{\left (x^{2}-3 x +3\right )^{2}}+\frac {9 \,{\mathrm e}^{x} \left (4 x^{3}-17 x^{2}+29 x -18\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {36 \,{\mathrm e}^{x} \left (7 x^{2}-19 x +18\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-30 x^{2}+51 x -33\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}-\frac {9 \left (2 x -3\right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {84 \left (2 x -3\right )}{x^{2}-3 x +3}-\frac {18 \left (-3 x^{3}+\frac {15}{2} x^{2}-6 x -\frac {3}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {9 \,{\mathrm e}^{x} \left (13 x^{3}-57 x^{2}+96 x -63\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {54 \left (6 x^{3}-\frac {75}{2} x^{2}+72 x -54\right )}{\left (x^{2}-3 x +3\right )^{2}}\) \(535\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-54*x^5+114*x^4-142*x^3+162*x^2-132*x-
54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-81*x+27),x,method=_RETURNVERBOSE)

[Out]

-2*x-x^2-8*exp(x)+(x+8)*exp(x)+27/2*exp(x)*(8*x^3-37*x^2+63*x-42)/(x^4-6*x^3+15*x^2-18*x+9)-9/2*exp(x)*(7*x^3-
18*x^2+15*x+3)/(x^4-6*x^3+15*x^2-18*x+9)-22*(3*x-6)/(x^2-3*x+3)^2-142*(3*x^3-14*x^2+24*x-33/2)/(x^2-3*x+3)^2+1
62*(5/3*x^3-15/2*x^2+13*x-9)/(x^2-3*x+3)^2+114*(5*x^3-51/2*x^2+45*x-63/2)/(x^2-3*x+3)^2+81/2*exp(x)*(5*x^3-31*
x^2+60*x-45)/(x^4-6*x^3+15*x^2-18*x+9)-45/2*exp(x)*(13*x^3-66*x^2+117*x-81)/(x^4-6*x^3+15*x^2-18*x+9)+144*(-3*
x^2+8*x-15/2)/(x^2-3*x+3)^2+9/2*exp(x)*(4*x^3-17*x^2+29*x-18)/(x^4-6*x^3+15*x^2-18*x+9)+36*exp(x)*(7*x^2-19*x+
18)/(x^4-6*x^3+15*x^2-18*x+9)-9*exp(x)*(7*x^3-30*x^2+51*x-33)/(x^4-6*x^3+15*x^2-18*x+9)-9*(2*x-3)/(x^2-3*x+3)^
2-84*(2*x-3)/(x^2-3*x+3)-18*(-3*x^3+15/2*x^2-6*x-3/2)/(x^2-3*x+3)^2+9/2*exp(x)*(13*x^3-57*x^2+96*x-63)/(x^4-6*
x^3+15*x^2-18*x+9)-54*(6*x^3-75/2*x^2+72*x-54)/(x^2-3*x+3)^2

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (33) = 66\).
time = 0.51, size = 304, normalized size = 8.94 \begin {gather*} -x^{2} + x e^{x} - 2 \, x + \frac {27 \, {\left (10 \, x^{3} - 45 \, x^{2} + 78 \, x - 54\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {57 \, {\left (10 \, x^{3} - 51 \, x^{2} + 90 \, x - 63\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {71 \, {\left (6 \, x^{3} - 28 \, x^{2} + 48 \, x - 33\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {9 \, {\left (4 \, x^{3} - 18 \, x^{2} + 32 \, x - 21\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {81 \, {\left (4 \, x^{3} - 25 \, x^{2} + 48 \, x - 36\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {27 \, {\left (2 \, x^{3} - 5 \, x^{2} + 4 \, x + 1\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {66 \, {\left (2 \, x^{3} - 9 \, x^{2} + 16 \, x - 11\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {72 \, {\left (6 \, x^{2} - 16 \, x + 15\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-54*x^5+114*x^4-142*x^3+162*x^2-
132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-81*x+27),x, algorithm="maxima")

[Out]

-x^2 + x*e^x - 2*x + 27*(10*x^3 - 45*x^2 + 78*x - 54)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) + 57*(10*x^3 - 51*x^2
+ 90*x - 63)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 71*(6*x^3 - 28*x^2 + 48*x - 33)/(x^4 - 6*x^3 + 15*x^2 - 18*x
+ 9) - 9*(4*x^3 - 18*x^2 + 32*x - 21)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 81*(4*x^3 - 25*x^2 + 48*x - 36)/(x^4
 - 6*x^3 + 15*x^2 - 18*x + 9) + 27*(2*x^3 - 5*x^2 + 4*x + 1)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 66*(2*x^3 - 9
*x^2 + 16*x - 11)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 72*(6*x^2 - 16*x + 15)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (33) = 66\).
time = 0.38, size = 76, normalized size = 2.24 \begin {gather*} -\frac {x^{6} - 4 \, x^{5} + 3 \, x^{4} + 36 \, x^{3} - 107 \, x^{2} - {\left (x^{5} - 6 \, x^{4} + 15 \, x^{3} - 18 \, x^{2} + 9 \, x\right )} e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-54*x^5+114*x^4-142*x^3+162*x^2-
132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-81*x+27),x, algorithm="fricas")

[Out]

-(x^6 - 4*x^5 + 3*x^4 + 36*x^3 - 107*x^2 - (x^5 - 6*x^4 + 15*x^3 - 18*x^2 + 9*x)*e^x + 162*x - 72)/(x^4 - 6*x^
3 + 15*x^2 - 18*x + 9)

________________________________________________________________________________________

Sympy [A]
time = 0.10, size = 44, normalized size = 1.29 \begin {gather*} - x^{2} + x e^{x} - 2 x - \frac {24 x^{3} - 80 x^{2} + 144 x - 72}{x^{4} - 6 x^{3} + 15 x^{2} - 18 x + 9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**7-8*x**6+27*x**5-45*x**4+27*x**3+27*x**2-54*x+27)*exp(x)-2*x**7+16*x**6-54*x**5+114*x**4-142*x*
*3+162*x**2-132*x-54)/(x**6-9*x**5+36*x**4-81*x**3+108*x**2-81*x+27),x)

[Out]

-x**2 + x*exp(x) - 2*x - (24*x**3 - 80*x**2 + 144*x - 72)/(x**4 - 6*x**3 + 15*x**2 - 18*x + 9)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (33) = 66\).
time = 0.40, size = 83, normalized size = 2.44 \begin {gather*} -\frac {x^{6} - x^{5} e^{x} - 4 \, x^{5} + 6 \, x^{4} e^{x} + 3 \, x^{4} - 15 \, x^{3} e^{x} + 36 \, x^{3} + 18 \, x^{2} e^{x} - 107 \, x^{2} - 9 \, x e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-54*x^5+114*x^4-142*x^3+162*x^2-
132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-81*x+27),x, algorithm="giac")

[Out]

-(x^6 - x^5*e^x - 4*x^5 + 6*x^4*e^x + 3*x^4 - 15*x^3*e^x + 36*x^3 + 18*x^2*e^x - 107*x^2 - 9*x*e^x + 162*x - 7
2)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9)

________________________________________________________________________________________

Mupad [B]
time = 7.38, size = 50, normalized size = 1.47 \begin {gather*} x\,{\mathrm {e}}^x-2\,x-x^2-\frac {24\,x^3-80\,x^2+144\,x-72}{x^4-6\,x^3+15\,x^2-18\,x+9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(132*x - exp(x)*(27*x^2 - 54*x + 27*x^3 - 45*x^4 + 27*x^5 - 8*x^6 + x^7 + 27) - 162*x^2 + 142*x^3 - 114*x
^4 + 54*x^5 - 16*x^6 + 2*x^7 + 54)/(108*x^2 - 81*x - 81*x^3 + 36*x^4 - 9*x^5 + x^6 + 27),x)

[Out]

x*exp(x) - 2*x - x^2 - (144*x - 80*x^2 + 24*x^3 - 72)/(15*x^2 - 18*x - 6*x^3 + x^4 + 9)

________________________________________________________________________________________