\(\int \frac {-27-24 x+e^{x^2} (-93-126 x+122 x^2+144 x^3+32 x^4)}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx\) [6532]

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

Optimal result

Integrand size = 54, antiderivative size = 21 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {e^{x^2}+x}{x-\frac {3}{9+4 x}} \]

[Out]

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

Rubi [F]

\[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx \]

[In]

Int[(-27 - 24*x + E^x^2*(-93 - 126*x + 122*x^2 + 144*x^3 + 32*x^4))/(9 - 54*x + 57*x^2 + 72*x^3 + 16*x^4),x]

[Out]

(280*E^x^2)/(43*(9 - Sqrt[129] + 8*x)) - (12*(9 - Sqrt[129])*E^x^2)/(43*(9 - Sqrt[129] + 8*x)) + (280*E^x^2)/(
43*(9 + Sqrt[129] + 8*x)) - (12*(9 + Sqrt[129])*E^x^2)/(43*(9 + Sqrt[129] + 8*x)) - 3/(3 - 9*x - 4*x^2) - (27*
Sqrt[Pi]*Erfi[x])/43 + (3*(9 - Sqrt[129])*Sqrt[Pi]*Erfi[x])/86 + (3*(9 + Sqrt[129])*Sqrt[Pi]*Erfi[x])/86 - 16*
Sqrt[3/43]*Defer[Int][E^x^2/(-9 + Sqrt[129] - 8*x), x] - (70*(9 - Sqrt[129])*Defer[Int][E^x^2/(-9 + Sqrt[129]
- 8*x), x])/43 + (3*(9 - Sqrt[129])^2*Defer[Int][E^x^2/(-9 + Sqrt[129] - 8*x), x])/43 - 16*Sqrt[3/43]*Defer[In
t][E^x^2/(9 + Sqrt[129] + 8*x), x] + (70*(9 + Sqrt[129])*Defer[Int][E^x^2/(9 + Sqrt[129] + 8*x), x])/43 - (3*(
9 + Sqrt[129])^2*Defer[Int][E^x^2/(9 + Sqrt[129] + 8*x), x])/43

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {3 (9+8 x)}{\left (-3+9 x+4 x^2\right )^2}+\frac {e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{\left (-3+9 x+4 x^2\right )^2}\right ) \, dx \\ & = -\left (3 \int \frac {9+8 x}{\left (-3+9 x+4 x^2\right )^2} \, dx\right )+\int \frac {e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{\left (-3+9 x+4 x^2\right )^2} \, dx \\ & = -\frac {3}{3-9 x-4 x^2}+\int \left (2 e^{x^2}-\frac {3 e^{x^2} (35+12 x)}{\left (-3+9 x+4 x^2\right )^2}+\frac {2 e^{x^2}}{-3+9 x+4 x^2}\right ) \, dx \\ & = -\frac {3}{3-9 x-4 x^2}+2 \int e^{x^2} \, dx+2 \int \frac {e^{x^2}}{-3+9 x+4 x^2} \, dx-3 \int \frac {e^{x^2} (35+12 x)}{\left (-3+9 x+4 x^2\right )^2} \, dx \\ & = -\frac {3}{3-9 x-4 x^2}+\sqrt {\pi } \text {erfi}(x)+2 \int \left (-\frac {8 e^{x^2}}{\sqrt {129} \left (-9+\sqrt {129}-8 x\right )}-\frac {8 e^{x^2}}{\sqrt {129} \left (9+\sqrt {129}+8 x\right )}\right ) \, dx-3 \int \left (\frac {35 e^{x^2}}{\left (-3+9 x+4 x^2\right )^2}+\frac {12 e^{x^2} x}{\left (-3+9 x+4 x^2\right )^2}\right ) \, dx \\ & = -\frac {3}{3-9 x-4 x^2}+\sqrt {\pi } \text {erfi}(x)-36 \int \frac {e^{x^2} x}{\left (-3+9 x+4 x^2\right )^2} \, dx-105 \int \frac {e^{x^2}}{\left (-3+9 x+4 x^2\right )^2} \, dx-\frac {16 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{\sqrt {129}}-\frac {16 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{\sqrt {129}} \\ & = -\frac {3}{3-9 x-4 x^2}+\sqrt {\pi } \text {erfi}(x)-36 \int \left (\frac {8 \left (-9+\sqrt {129}\right ) e^{x^2}}{129 \left (-9+\sqrt {129}-8 x\right )^2}-\frac {8 \sqrt {\frac {3}{43}} e^{x^2}}{43 \left (-9+\sqrt {129}-8 x\right )}+\frac {8 \left (-9-\sqrt {129}\right ) e^{x^2}}{129 \left (9+\sqrt {129}+8 x\right )^2}-\frac {8 \sqrt {\frac {3}{43}} e^{x^2}}{43 \left (9+\sqrt {129}+8 x\right )}\right ) \, dx-105 \int \left (\frac {64 e^{x^2}}{129 \left (-9+\sqrt {129}-8 x\right )^2}+\frac {64 e^{x^2}}{129 \sqrt {129} \left (-9+\sqrt {129}-8 x\right )}+\frac {64 e^{x^2}}{129 \left (9+\sqrt {129}+8 x\right )^2}+\frac {64 e^{x^2}}{129 \sqrt {129} \left (9+\sqrt {129}+8 x\right )}\right ) \, dx-\frac {16 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{\sqrt {129}}-\frac {16 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{\sqrt {129}} \\ & = -\frac {3}{3-9 x-4 x^2}+\sqrt {\pi } \text {erfi}(x)-\frac {2240}{43} \int \frac {e^{x^2}}{\left (-9+\sqrt {129}-8 x\right )^2} \, dx-\frac {2240}{43} \int \frac {e^{x^2}}{\left (9+\sqrt {129}+8 x\right )^2} \, dx+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx-\frac {16 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{\sqrt {129}}-\frac {16 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{\sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{43 \sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{43 \sqrt {129}}+\frac {1}{43} \left (96 \left (9-\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{\left (-9+\sqrt {129}-8 x\right )^2} \, dx+\frac {1}{43} \left (96 \left (9+\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{\left (9+\sqrt {129}+8 x\right )^2} \, dx \\ & = \frac {280 e^{x^2}}{43 \left (9-\sqrt {129}+8 x\right )}-\frac {12 \left (9-\sqrt {129}\right ) e^{x^2}}{43 \left (9-\sqrt {129}+8 x\right )}+\frac {280 e^{x^2}}{43 \left (9+\sqrt {129}+8 x\right )}-\frac {12 \left (9+\sqrt {129}\right ) e^{x^2}}{43 \left (9+\sqrt {129}+8 x\right )}-\frac {3}{3-9 x-4 x^2}+\sqrt {\pi } \text {erfi}(x)-2 \left (\frac {70}{43} \int e^{x^2} \, dx\right )+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx-\frac {16 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{\sqrt {129}}-\frac {16 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{\sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{43 \sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{43 \sqrt {129}}+\frac {1}{43} \left (3 \left (9-\sqrt {129}\right )\right ) \int e^{x^2} \, dx-\frac {1}{43} \left (70 \left (9-\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (3 \left (9-\sqrt {129}\right )^2\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (3 \left (9+\sqrt {129}\right )\right ) \int e^{x^2} \, dx+\frac {1}{43} \left (70 \left (9+\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx-\frac {1}{43} \left (3 \left (9+\sqrt {129}\right )^2\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx \\ & = \frac {280 e^{x^2}}{43 \left (9-\sqrt {129}+8 x\right )}-\frac {12 \left (9-\sqrt {129}\right ) e^{x^2}}{43 \left (9-\sqrt {129}+8 x\right )}+\frac {280 e^{x^2}}{43 \left (9+\sqrt {129}+8 x\right )}-\frac {12 \left (9+\sqrt {129}\right ) e^{x^2}}{43 \left (9+\sqrt {129}+8 x\right )}-\frac {3}{3-9 x-4 x^2}-\frac {27}{43} \sqrt {\pi } \text {erfi}(x)+\frac {3}{86} \left (9-\sqrt {129}\right ) \sqrt {\pi } \text {erfi}(x)+\frac {3}{86} \left (9+\sqrt {129}\right ) \sqrt {\pi } \text {erfi}(x)+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (288 \sqrt {\frac {3}{43}}\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx-\frac {16 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{\sqrt {129}}-\frac {16 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{\sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx}{43 \sqrt {129}}-\frac {2240 \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx}{43 \sqrt {129}}-\frac {1}{43} \left (70 \left (9-\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (3 \left (9-\sqrt {129}\right )^2\right ) \int \frac {e^{x^2}}{-9+\sqrt {129}-8 x} \, dx+\frac {1}{43} \left (70 \left (9+\sqrt {129}\right )\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx-\frac {1}{43} \left (3 \left (9+\sqrt {129}\right )^2\right ) \int \frac {e^{x^2}}{9+\sqrt {129}+8 x} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 2.13 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.24 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {3+e^{x^2} (9+4 x)}{-3+9 x+4 x^2} \]

[In]

Integrate[(-27 - 24*x + E^x^2*(-93 - 126*x + 122*x^2 + 144*x^3 + 32*x^4))/(9 - 54*x + 57*x^2 + 72*x^3 + 16*x^4
),x]

[Out]

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

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.38

method result size
norman \(\frac {3+4 \,{\mathrm e}^{x^{2}} x +9 \,{\mathrm e}^{x^{2}}}{4 x^{2}+9 x -3}\) \(29\)
parallelrisch \(\frac {12+16 \,{\mathrm e}^{x^{2}} x +36 \,{\mathrm e}^{x^{2}}}{16 x^{2}+36 x -12}\) \(30\)
risch \(\frac {3}{4 \left (x^{2}+\frac {9}{4} x -\frac {3}{4}\right )}+\frac {\left (4 x +9\right ) {\mathrm e}^{x^{2}}}{4 x^{2}+9 x -3}\) \(36\)
parts \(\frac {4 \,{\mathrm e}^{x^{2}} x +9 \,{\mathrm e}^{x^{2}}}{4 x^{2}+9 x -3}+\frac {3}{4 x^{2}+9 x -3}\) \(43\)

[In]

int(((32*x^4+144*x^3+122*x^2-126*x-93)*exp(x^2)-24*x-27)/(16*x^4+72*x^3+57*x^2-54*x+9),x,method=_RETURNVERBOSE
)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {{\left (4 \, x + 9\right )} e^{\left (x^{2}\right )} + 3}{4 \, x^{2} + 9 \, x - 3} \]

[In]

integrate(((32*x^4+144*x^3+122*x^2-126*x-93)*exp(x^2)-24*x-27)/(16*x^4+72*x^3+57*x^2-54*x+9),x, algorithm="fri
cas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (14) = 28\).

Time = 0.09 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.48 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {\left (4 x + 9\right ) e^{x^{2}}}{4 x^{2} + 9 x - 3} + \frac {3}{4 x^{2} + 9 x - 3} \]

[In]

integrate(((32*x**4+144*x**3+122*x**2-126*x-93)*exp(x**2)-24*x-27)/(16*x**4+72*x**3+57*x**2-54*x+9),x)

[Out]

(4*x + 9)*exp(x**2)/(4*x**2 + 9*x - 3) + 3/(4*x**2 + 9*x - 3)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (20) = 40\).

Time = 0.31 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.90 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {{\left (4 \, x + 9\right )} e^{\left (x^{2}\right )}}{4 \, x^{2} + 9 \, x - 3} + \frac {9 \, {\left (8 \, x + 9\right )}}{43 \, {\left (4 \, x^{2} + 9 \, x - 3\right )}} - \frac {24 \, {\left (3 \, x - 2\right )}}{43 \, {\left (4 \, x^{2} + 9 \, x - 3\right )}} \]

[In]

integrate(((32*x^4+144*x^3+122*x^2-126*x-93)*exp(x^2)-24*x-27)/(16*x^4+72*x^3+57*x^2-54*x+9),x, algorithm="max
ima")

[Out]

(4*x + 9)*e^(x^2)/(4*x^2 + 9*x - 3) + 9/43*(8*x + 9)/(4*x^2 + 9*x - 3) - 24/43*(3*x - 2)/(4*x^2 + 9*x - 3)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.33 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {4 \, x e^{\left (x^{2}\right )} + 9 \, e^{\left (x^{2}\right )} + 3}{4 \, x^{2} + 9 \, x - 3} \]

[In]

integrate(((32*x^4+144*x^3+122*x^2-126*x-93)*exp(x^2)-24*x-27)/(16*x^4+72*x^3+57*x^2-54*x+9),x, algorithm="gia
c")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.14 \[ \int \frac {-27-24 x+e^{x^2} \left (-93-126 x+122 x^2+144 x^3+32 x^4\right )}{9-54 x+57 x^2+72 x^3+16 x^4} \, dx=\frac {\left (x+{\mathrm {e}}^{x^2}\right )\,\left (4\,x+9\right )}{4\,x^2+9\,x-3} \]

[In]

int(-(24*x - exp(x^2)*(122*x^2 - 126*x + 144*x^3 + 32*x^4 - 93) + 27)/(57*x^2 - 54*x + 72*x^3 + 16*x^4 + 9),x)

[Out]

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