\(\int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} (-6+2 x-2 x^2)} \, dx\) [5861]

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

Optimal result

Integrand size = 59, antiderivative size = 25 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=-2+\frac {2 (-3+x) x}{3-\sqrt {e}-x+x^2} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(61\) vs. \(2(25)=50\).

Time = 0.07 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.44, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.068, Rules used = {1694, 12, 1828, 8} \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=-\frac {8 \left (2 \left (11-4 \sqrt {e}\right ) \left (x-\frac {1}{2}\right )+4 e-27 \sqrt {e}+44\right )}{\left (11-4 \sqrt {e}\right ) \left (4 \left (x-\frac {1}{2}\right )^2-4 \sqrt {e}+11\right )} \]

[In]

Int[(-18 + Sqrt[E]*(6 - 4*x) + 12*x + 4*x^2)/(9 + E - 6*x + 7*x^2 - 2*x^3 + x^4 + Sqrt[E]*(-6 + 2*x - 2*x^2)),
x]

[Out]

(-8*(44 - 27*Sqrt[E] + 4*E + 2*(11 - 4*Sqrt[E])*(-1/2 + x)))/((11 - 4*Sqrt[E])*(11 - 4*Sqrt[E] + 4*(-1/2 + x)^
2))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, 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 1694

Int[(Pq_)*(Q4_)^(p_), x_Symbol] :> With[{a = Coeff[Q4, x, 0], b = Coeff[Q4, x, 1], c = Coeff[Q4, x, 2], d = Co
eff[Q4, x, 3], e = Coeff[Q4, x, 4]}, Subst[Int[SimplifyIntegrand[(Pq /. x -> -d/(4*e) + x)*(a + d^4/(256*e^3)
- b*(d/(8*e)) + (c - 3*(d^2/(8*e)))*x^2 + e*x^4)^p, x], x], x, d/(4*e) + x] /; EqQ[d^3 - 4*c*d*e + 8*b*e^2, 0]
 && NeQ[d, 0]] /; FreeQ[p, x] && PolyQ[Pq, x] && PolyQ[Q4, x, 4] &&  !IGtQ[p, 0]

Rule 1828

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[(a*
g - b*f*x)*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {16 \left (-11+4 \sqrt {e}+4 \left (4-\sqrt {e}\right ) x+4 x^2\right )}{\left (11-4 \sqrt {e}+4 x^2\right )^2} \, dx,x,-\frac {1}{2}+x\right ) \\ & = 16 \text {Subst}\left (\int \frac {-11+4 \sqrt {e}+4 \left (4-\sqrt {e}\right ) x+4 x^2}{\left (11-4 \sqrt {e}+4 x^2\right )^2} \, dx,x,-\frac {1}{2}+x\right ) \\ & = -\frac {8 \left (44-27 \sqrt {e}+4 e-\left (11-4 \sqrt {e}\right ) (1-2 x)\right )}{\left (11-4 \sqrt {e}\right ) \left (11-4 \sqrt {e}+(-1+2 x)^2\right )}-\frac {8 \text {Subst}\left (\int 0 \, dx,x,-\frac {1}{2}+x\right )}{11-4 \sqrt {e}} \\ & = -\frac {8 \left (44-27 \sqrt {e}+4 e-\left (11-4 \sqrt {e}\right ) (1-2 x)\right )}{\left (11-4 \sqrt {e}\right ) \left (11-4 \sqrt {e}+(-1+2 x)^2\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.16 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=\frac {2 \left (-3+\sqrt {e}-2 x\right )}{3-\sqrt {e}-x+x^2} \]

[In]

Integrate[(-18 + Sqrt[E]*(6 - 4*x) + 12*x + 4*x^2)/(9 + E - 6*x + 7*x^2 - 2*x^3 + x^4 + Sqrt[E]*(-6 + 2*x - 2*
x^2)),x]

[Out]

(2*(-3 + Sqrt[E] - 2*x))/(3 - Sqrt[E] - x + x^2)

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
gosper \(-\frac {2 \left (-3-2 x +{\mathrm e}^{\frac {1}{2}}\right )}{-x^{2}+{\mathrm e}^{\frac {1}{2}}+x -3}\) \(22\)
norman \(\frac {4 x -2 \,{\mathrm e}^{\frac {1}{2}}+6}{-x^{2}+{\mathrm e}^{\frac {1}{2}}+x -3}\) \(23\)
risch \(\frac {4 x -2 \,{\mathrm e}^{\frac {1}{2}}+6}{-x^{2}+{\mathrm e}^{\frac {1}{2}}+x -3}\) \(23\)
parallelrisch \(-\frac {2 \,{\mathrm e}^{\frac {1}{2}}-4 x -6}{-x^{2}+{\mathrm e}^{\frac {1}{2}}+x -3}\) \(24\)

[In]

int(((6-4*x)*exp(1/2)+4*x^2+12*x-18)/(exp(1/2)^2+(-2*x^2+2*x-6)*exp(1/2)+x^4-2*x^3+7*x^2-6*x+9),x,method=_RETU
RNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=-\frac {2 \, {\left (2 \, x - e^{\frac {1}{2}} + 3\right )}}{x^{2} - x - e^{\frac {1}{2}} + 3} \]

[In]

integrate(((6-4*x)*exp(1/2)+4*x^2+12*x-18)/(exp(1/2)^2+(-2*x^2+2*x-6)*exp(1/2)+x^4-2*x^3+7*x^2-6*x+9),x, algor
ithm="fricas")

[Out]

-2*(2*x - e^(1/2) + 3)/(x^2 - x - e^(1/2) + 3)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (19) = 38\).

Time = 0.45 (sec) , antiderivative size = 87, normalized size of antiderivative = 3.48 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=\frac {x \left (-484 - 64 e + 352 e^{\frac {1}{2}}\right ) - 272 e - 726 + 32 e^{\frac {3}{2}} + 770 e^{\frac {1}{2}}}{x^{2} \left (- 88 e^{\frac {1}{2}} + 16 e + 121\right ) + x \left (-121 - 16 e + 88 e^{\frac {1}{2}}\right ) - 385 e^{\frac {1}{2}} - 16 e^{\frac {3}{2}} + 363 + 136 e} \]

[In]

integrate(((6-4*x)*exp(1/2)+4*x**2+12*x-18)/(exp(1/2)**2+(-2*x**2+2*x-6)*exp(1/2)+x**4-2*x**3+7*x**2-6*x+9),x)

[Out]

(x*(-484 - 64*E + 352*exp(1/2)) - 272*E - 726 + 32*exp(3/2) + 770*exp(1/2))/(x**2*(-88*exp(1/2) + 16*E + 121)
+ x*(-121 - 16*E + 88*exp(1/2)) - 385*exp(1/2) - 16*exp(3/2) + 363 + 136*E)

Maxima [F]

\[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=\int { \frac {2 \, {\left (2 \, x^{2} - {\left (2 \, x - 3\right )} e^{\frac {1}{2}} + 6 \, x - 9\right )}}{x^{4} - 2 \, x^{3} + 7 \, x^{2} - 2 \, {\left (x^{2} - x + 3\right )} e^{\frac {1}{2}} - 6 \, x + e + 9} \,d x } \]

[In]

integrate(((6-4*x)*exp(1/2)+4*x^2+12*x-18)/(exp(1/2)^2+(-2*x^2+2*x-6)*exp(1/2)+x^4-2*x^3+7*x^2-6*x+9),x, algor
ithm="maxima")

[Out]

2*integrate((2*x^2 - (2*x - 3)*e^(1/2) + 6*x - 9)/(x^4 - 2*x^3 + 7*x^2 - 2*(x^2 - x + 3)*e^(1/2) - 6*x + e + 9
), x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=-\frac {2 \, {\left (2 \, x - e^{\frac {1}{2}} + 3\right )}}{x^{2} - x - e^{\frac {1}{2}} + 3} \]

[In]

integrate(((6-4*x)*exp(1/2)+4*x^2+12*x-18)/(exp(1/2)^2+(-2*x^2+2*x-6)*exp(1/2)+x^4-2*x^3+7*x^2-6*x+9),x, algor
ithm="giac")

[Out]

-2*(2*x - e^(1/2) + 3)/(x^2 - x - e^(1/2) + 3)

Mupad [B] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88 \[ \int \frac {-18+\sqrt {e} (6-4 x)+12 x+4 x^2}{9+e-6 x+7 x^2-2 x^3+x^4+\sqrt {e} \left (-6+2 x-2 x^2\right )} \, dx=\frac {4\,x-2\,\sqrt {\mathrm {e}}+6}{-x^2+x+\sqrt {\mathrm {e}}-3} \]

[In]

int((12*x + 4*x^2 - exp(1/2)*(4*x - 6) - 18)/(exp(1) - 6*x - exp(1/2)*(2*x^2 - 2*x + 6) + 7*x^2 - 2*x^3 + x^4
+ 9),x)

[Out]

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