\(\int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 (54-198 x+162 x^2-36 x^3)}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx\) [3415]

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

Optimal result

Integrand size = 62, antiderivative size = 22 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=\frac {9 \left (1-3 x+x^2\right )^2}{2-e^2+x} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(55\) vs. \(2(22)=44\).

Time = 0.06 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.50, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {2011, 27, 1864} \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=9 x^3-9 \left (8-e^2\right ) x^2+9 \left (27-10 e^2+e^4\right ) x+\frac {9 \left (11-7 e^2+e^4\right )^2}{x-e^2+2} \]

[In]

Int[(-117 + 396*x - 225*x^2 - 36*x^3 + 27*x^4 + E^2*(54 - 198*x + 162*x^2 - 36*x^3))/(4 + E^4 + E^2*(-4 - 2*x)
 + 4*x + x^2),x]

[Out]

9*(27 - 10*E^2 + E^4)*x - 9*(8 - E^2)*x^2 + 9*x^3 + (9*(11 - 7*E^2 + E^4)^2)/(2 - E^2 + 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 1864

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[
{a, b, n}, x] && PolyQ[Pq, x] && (IGtQ[p, 0] || EqQ[n, 1])

Rule 2011

Int[(Pq_)*(u_)^(p_.), x_Symbol] :> Int[Pq*ExpandToSum[u, x]^p, x] /; FreeQ[p, x] && PolyQ[Pq, x] && QuadraticQ
[u, x] &&  !QuadraticMatchQ[u, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{\left (-2+e^2\right )^2+2 \left (2-e^2\right ) x+x^2} \, dx \\ & = \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{\left (2-e^2+x\right )^2} \, dx \\ & = \int \left (9 \left (27-10 e^2+e^4\right )-\frac {9 \left (11-7 e^2+e^4\right )^2}{\left (-2+e^2-x\right )^2}+18 \left (-8+e^2\right ) x+27 x^2\right ) \, dx \\ & = 9 \left (27-10 e^2+e^4\right ) x-9 \left (8-e^2\right ) x^2+9 x^3+\frac {9 \left (11-7 e^2+e^4\right )^2}{2-e^2+x} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(64\) vs. \(2(22)=44\).

Time = 0.04 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.91 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=-\frac {9 \left (309+4 e^8+148 x+11 x^2-6 x^3+x^4-2 e^6 (25+2 x)+e^4 (226+42 x)-2 e^2 (219+71 x)\right )}{-2+e^2-x} \]

[In]

Integrate[(-117 + 396*x - 225*x^2 - 36*x^3 + 27*x^4 + E^2*(54 - 198*x + 162*x^2 - 36*x^3))/(4 + E^4 + E^2*(-4
- 2*x) + 4*x + x^2),x]

[Out]

(-9*(309 + 4*E^8 + 148*x + 11*x^2 - 6*x^3 + x^4 - 2*E^6*(25 + 2*x) + E^4*(226 + 42*x) - 2*E^2*(219 + 71*x)))/(
-2 + E^2 - x)

Maple [A] (verified)

Time = 2.27 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.45

method result size
norman \(\frac {-99 x^{2}+54 x^{3}-9 x^{4}+54 \,{\mathrm e}^{2}-117}{{\mathrm e}^{2}-x -2}\) \(32\)
gosper \(\frac {-99 x^{2}+54 x^{3}-9 x^{4}+54 \,{\mathrm e}^{2}-117}{{\mathrm e}^{2}-x -2}\) \(33\)
parallelrisch \(-\frac {9 x^{4}-54 x^{3}+117+99 x^{2}-54 \,{\mathrm e}^{2}}{{\mathrm e}^{2}-x -2}\) \(33\)
risch \(9 x \,{\mathrm e}^{4}+9 x^{2} {\mathrm e}^{2}+9 x^{3}-90 \,{\mathrm e}^{2} x -72 x^{2}+243 x -\frac {9 \,{\mathrm e}^{8}}{{\mathrm e}^{2}-x -2}+\frac {126 \,{\mathrm e}^{6}}{{\mathrm e}^{2}-x -2}-\frac {639 \,{\mathrm e}^{4}}{{\mathrm e}^{2}-x -2}+\frac {1386 \,{\mathrm e}^{2}}{{\mathrm e}^{2}-x -2}-\frac {1089}{{\mathrm e}^{2}-x -2}\) \(95\)
meijerg \(\frac {27 \left ({\mathrm e}^{2}-2\right )^{4} \left (-\frac {x \left (-\frac {5 x^{3}}{\left ({\mathrm e}^{2}-2\right )^{3}}-\frac {10 x^{2}}{\left ({\mathrm e}^{2}-2\right )^{2}}-\frac {30 x}{{\mathrm e}^{2}-2}+60\right )}{15 \left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}-4 \ln \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )\right )}{2-{\mathrm e}^{2}}-\frac {\left ({\mathrm e}^{2}-2\right )^{3} \left (-36 \,{\mathrm e}^{2}-36\right ) \left (\frac {x \left (-\frac {2 x^{2}}{\left ({\mathrm e}^{2}-2\right )^{2}}-\frac {6 x}{{\mathrm e}^{2}-2}+12\right )}{4 \left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}+3 \ln \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )\right )}{2-{\mathrm e}^{2}}+\frac {\left ({\mathrm e}^{2}-2\right )^{2} \left (162 \,{\mathrm e}^{2}-225\right ) \left (-\frac {x \left (-\frac {3 x}{{\mathrm e}^{2}-2}+6\right )}{3 \left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}-2 \ln \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )\right )}{2-{\mathrm e}^{2}}+\left (-198 \,{\mathrm e}^{2}+396\right ) \left (\frac {x}{\left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}+\ln \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )\right )-\frac {54 \,{\mathrm e}^{2} x}{\left (2-{\mathrm e}^{2}\right ) \left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}+\frac {117 x}{\left (2-{\mathrm e}^{2}\right ) \left ({\mathrm e}^{2}-2\right ) \left (1-\frac {x}{{\mathrm e}^{2}-2}\right )}\) \(341\)

[In]

int(((-36*x^3+162*x^2-198*x+54)*exp(2)+27*x^4-36*x^3-225*x^2+396*x-117)/(exp(2)^2+(-2*x-4)*exp(2)+x^2+4*x+4),x
,method=_RETURNVERBOSE)

[Out]

(-99*x^2+54*x^3-9*x^4+54*exp(2)-117)/(exp(2)-x-2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (21) = 42\).

Time = 0.23 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.50 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=\frac {9 \, {\left (x^{4} - 6 \, x^{3} + 11 \, x^{2} - {\left (x + 14\right )} e^{6} + {\left (12 \, x + 71\right )} e^{4} - {\left (47 \, x + 154\right )} e^{2} + 54 \, x + e^{8} + 121\right )}}{x - e^{2} + 2} \]

[In]

integrate(((-36*x^3+162*x^2-198*x+54)*exp(2)+27*x^4-36*x^3-225*x^2+396*x-117)/(exp(2)^2+(-2*x-4)*exp(2)+x^2+4*
x+4),x, algorithm="fricas")

[Out]

9*(x^4 - 6*x^3 + 11*x^2 - (x + 14)*e^6 + (12*x + 71)*e^4 - (47*x + 154)*e^2 + 54*x + e^8 + 121)/(x - e^2 + 2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (17) = 34\).

Time = 0.19 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.55 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=9 x^{3} + x^{2} \left (-72 + 9 e^{2}\right ) + x \left (- 90 e^{2} + 243 + 9 e^{4}\right ) + \frac {- 126 e^{6} - 1386 e^{2} + 1089 + 9 e^{8} + 639 e^{4}}{x - e^{2} + 2} \]

[In]

integrate(((-36*x**3+162*x**2-198*x+54)*exp(2)+27*x**4-36*x**3-225*x**2+396*x-117)/(exp(2)**2+(-2*x-4)*exp(2)+
x**2+4*x+4),x)

[Out]

9*x**3 + x**2*(-72 + 9*exp(2)) + x*(-90*exp(2) + 243 + 9*exp(4)) + (-126*exp(6) - 1386*exp(2) + 1089 + 9*exp(8
) + 639*exp(4))/(x - exp(2) + 2)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (21) = 42\).

Time = 0.19 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.41 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=9 \, x^{3} + 9 \, x^{2} {\left (e^{2} - 8\right )} + 9 \, x {\left (e^{4} - 10 \, e^{2} + 27\right )} + \frac {9 \, {\left (e^{8} - 14 \, e^{6} + 71 \, e^{4} - 154 \, e^{2} + 121\right )}}{x - e^{2} + 2} \]

[In]

integrate(((-36*x^3+162*x^2-198*x+54)*exp(2)+27*x^4-36*x^3-225*x^2+396*x-117)/(exp(2)^2+(-2*x-4)*exp(2)+x^2+4*
x+4),x, algorithm="maxima")

[Out]

9*x^3 + 9*x^2*(e^2 - 8) + 9*x*(e^4 - 10*e^2 + 27) + 9*(e^8 - 14*e^6 + 71*e^4 - 154*e^2 + 121)/(x - e^2 + 2)

Giac [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 58, normalized size of antiderivative = 2.64 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=9 \, x^{3} + 9 \, x^{2} e^{2} - 72 \, x^{2} + 9 \, x e^{4} - 90 \, x e^{2} + 243 \, x + \frac {9 \, {\left (e^{8} - 14 \, e^{6} + 71 \, e^{4} - 154 \, e^{2} + 121\right )}}{x - e^{2} + 2} \]

[In]

integrate(((-36*x^3+162*x^2-198*x+54)*exp(2)+27*x^4-36*x^3-225*x^2+396*x-117)/(exp(2)^2+(-2*x-4)*exp(2)+x^2+4*
x+4),x, algorithm="giac")

[Out]

9*x^3 + 9*x^2*e^2 - 72*x^2 + 9*x*e^4 - 90*x*e^2 + 243*x + 9*(e^8 - 14*e^6 + 71*e^4 - 154*e^2 + 121)/(x - e^2 +
 2)

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 73, normalized size of antiderivative = 3.32 \[ \int \frac {-117+396 x-225 x^2-36 x^3+27 x^4+e^2 \left (54-198 x+162 x^2-36 x^3\right )}{4+e^4+e^2 (-4-2 x)+4 x+x^2} \, dx=x\,\left (162\,{\mathrm {e}}^2-27\,{\left ({\mathrm {e}}^2-2\right )}^2+\left (2\,{\mathrm {e}}^2-4\right )\,\left (18\,{\mathrm {e}}^2-144\right )-225\right )+x^2\,\left (9\,{\mathrm {e}}^2-72\right )+\frac {639\,{\mathrm {e}}^4-1386\,{\mathrm {e}}^2-126\,{\mathrm {e}}^6+9\,{\mathrm {e}}^8+1089}{x-{\mathrm {e}}^2+2}+9\,x^3 \]

[In]

int(-(exp(2)*(198*x - 162*x^2 + 36*x^3 - 54) - 396*x + 225*x^2 + 36*x^3 - 27*x^4 + 117)/(4*x + exp(4) + x^2 -
exp(2)*(2*x + 4) + 4),x)

[Out]

x*(162*exp(2) - 27*(exp(2) - 2)^2 + (2*exp(2) - 4)*(18*exp(2) - 144) - 225) + x^2*(9*exp(2) - 72) + (639*exp(4
) - 1386*exp(2) - 126*exp(6) + 9*exp(8) + 1089)/(x - exp(2) + 2) + 9*x^3