\(\int \frac {18-36 x+e^{x^2} (-18-36 x^2)}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+(-243-54 x+51 x^2+6 x^3-3 x^4) \log (4)+(-27-3 x+3 x^2) \log ^2(4)-\log ^3(4)+e^{2 x^2} (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4))+e^{x^2} (243 x+54 x^2-51 x^3-6 x^4+3 x^5+(54 x+6 x^2-6 x^3) \log (4)+3 x \log ^2(4))} \, dx\) [6873]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (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 [F(-1)]

Optimal result

Integrand size = 189, antiderivative size = 27 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{x^2 \left (-e^{x^2}-x+\frac {9+x+\log (4)}{x}\right )^2} \]

[Out]

9/((2*ln(2)+x+9)/x-exp(x^2)-x)^2/x^2

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.016, Rules used = {6820, 12, 6818} \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{\left (-x^2+\left (1-e^{x^2}\right ) x+9+\log (4)\right )^2} \]

[In]

Int[(18 - 36*x + E^x^2*(-18 - 36*x^2))/(-729 - 243*x + 216*x^2 + 53*x^3 + E^(3*x^2)*x^3 - 24*x^4 - 3*x^5 + x^6
 + (-243 - 54*x + 51*x^2 + 6*x^3 - 3*x^4)*Log[4] + (-27 - 3*x + 3*x^2)*Log[4]^2 - Log[4]^3 + E^(2*x^2)*(-27*x^
2 - 3*x^3 + 3*x^4 - 3*x^2*Log[4]) + E^x^2*(243*x + 54*x^2 - 51*x^3 - 6*x^4 + 3*x^5 + (54*x + 6*x^2 - 6*x^3)*Lo
g[4] + 3*x*Log[4]^2)),x]

[Out]

9/(9 + (1 - E^x^2)*x - x^2 + Log[4])^2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 6818

Int[(u_)*(y_)^(m_.), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*(y^(m + 1)/(m + 1)), x] /;  !F
alseQ[q]] /; FreeQ[m, x] && NeQ[m, -1]

Rule 6820

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {18 \left (1-2 x-e^{x^2} \left (1+2 x^2\right )\right )}{\left (\left (-1+e^{x^2}\right ) x+x^2-9 \left (1+\frac {2 \log (2)}{9}\right )\right )^3} \, dx \\ & = 18 \int \frac {1-2 x-e^{x^2} \left (1+2 x^2\right )}{\left (\left (-1+e^{x^2}\right ) x+x^2-9 \left (1+\frac {2 \log (2)}{9}\right )\right )^3} \, dx \\ & = \frac {9}{\left (9+\left (1-e^{x^2}\right ) x-x^2+\log (4)\right )^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.81 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{\left (-9+\left (-1+e^{x^2}\right ) x+x^2-\log (4)\right )^2} \]

[In]

Integrate[(18 - 36*x + E^x^2*(-18 - 36*x^2))/(-729 - 243*x + 216*x^2 + 53*x^3 + E^(3*x^2)*x^3 - 24*x^4 - 3*x^5
 + x^6 + (-243 - 54*x + 51*x^2 + 6*x^3 - 3*x^4)*Log[4] + (-27 - 3*x + 3*x^2)*Log[4]^2 - Log[4]^3 + E^(2*x^2)*(
-27*x^2 - 3*x^3 + 3*x^4 - 3*x^2*Log[4]) + E^x^2*(243*x + 54*x^2 - 51*x^3 - 6*x^4 + 3*x^5 + (54*x + 6*x^2 - 6*x
^3)*Log[4] + 3*x*Log[4]^2)),x]

[Out]

9/(-9 + (-1 + E^x^2)*x + x^2 - Log[4])^2

Maple [A] (verified)

Time = 1.04 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89

method result size
norman \(\frac {9}{\left (-{\mathrm e}^{x^{2}} x -x^{2}+2 \ln \left (2\right )+x +9\right )^{2}}\) \(24\)
risch \(\frac {9}{\left (-{\mathrm e}^{x^{2}} x -x^{2}+2 \ln \left (2\right )+x +9\right )^{2}}\) \(24\)
parallelrisch \(\frac {9}{x^{4}+2 x^{3} {\mathrm e}^{x^{2}}+{\mathrm e}^{2 x^{2}} x^{2}-4 x^{2} \ln \left (2\right )-4 x \ln \left (2\right ) {\mathrm e}^{x^{2}}-2 x^{3}-2 x^{2} {\mathrm e}^{x^{2}}+4 \ln \left (2\right )^{2}+4 x \ln \left (2\right )-17 x^{2}-18 \,{\mathrm e}^{x^{2}} x +36 \ln \left (2\right )+18 x +81}\) \(89\)

[In]

int(((-36*x^2-18)*exp(x^2)-36*x+18)/(x^3*exp(x^2)^3+(-6*x^2*ln(2)+3*x^4-3*x^3-27*x^2)*exp(x^2)^2+(12*x*ln(2)^2
+2*(-6*x^3+6*x^2+54*x)*ln(2)+3*x^5-6*x^4-51*x^3+54*x^2+243*x)*exp(x^2)-8*ln(2)^3+4*(3*x^2-3*x-27)*ln(2)^2+2*(-
3*x^4+6*x^3+51*x^2-54*x-243)*ln(2)+x^6-3*x^5-24*x^4+53*x^3+216*x^2-243*x-729),x,method=_RETURNVERBOSE)

[Out]

9/(-exp(x^2)*x-x^2+2*ln(2)+x+9)^2

Fricas [B] (verification not implemented)

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

Time = 0.23 (sec) , antiderivative size = 73, normalized size of antiderivative = 2.70 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{x^{4} - 2 \, x^{3} + x^{2} e^{\left (2 \, x^{2}\right )} - 17 \, x^{2} + 2 \, {\left (x^{3} - x^{2} - 2 \, x \log \left (2\right ) - 9 \, x\right )} e^{\left (x^{2}\right )} - 4 \, {\left (x^{2} - x - 9\right )} \log \left (2\right ) + 4 \, \log \left (2\right )^{2} + 18 \, x + 81} \]

[In]

integrate(((-36*x^2-18)*exp(x^2)-36*x+18)/(x^3*exp(x^2)^3+(-6*x^2*log(2)+3*x^4-3*x^3-27*x^2)*exp(x^2)^2+(12*x*
log(2)^2+2*(-6*x^3+6*x^2+54*x)*log(2)+3*x^5-6*x^4-51*x^3+54*x^2+243*x)*exp(x^2)-8*log(2)^3+4*(3*x^2-3*x-27)*lo
g(2)^2+2*(-3*x^4+6*x^3+51*x^2-54*x-243)*log(2)+x^6-3*x^5-24*x^4+53*x^3+216*x^2-243*x-729),x, algorithm="fricas
")

[Out]

9/(x^4 - 2*x^3 + x^2*e^(2*x^2) - 17*x^2 + 2*(x^3 - x^2 - 2*x*log(2) - 9*x)*e^(x^2) - 4*(x^2 - x - 9)*log(2) +
4*log(2)^2 + 18*x + 81)

Sympy [B] (verification not implemented)

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

Time = 0.18 (sec) , antiderivative size = 82, normalized size of antiderivative = 3.04 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{x^{4} - 2 x^{3} + x^{2} e^{2 x^{2}} - 17 x^{2} - 4 x^{2} \log {\left (2 \right )} + 4 x \log {\left (2 \right )} + 18 x + \left (2 x^{3} - 2 x^{2} - 18 x - 4 x \log {\left (2 \right )}\right ) e^{x^{2}} + 4 \log {\left (2 \right )}^{2} + 36 \log {\left (2 \right )} + 81} \]

[In]

integrate(((-36*x**2-18)*exp(x**2)-36*x+18)/(x**3*exp(x**2)**3+(-6*x**2*ln(2)+3*x**4-3*x**3-27*x**2)*exp(x**2)
**2+(12*x*ln(2)**2+2*(-6*x**3+6*x**2+54*x)*ln(2)+3*x**5-6*x**4-51*x**3+54*x**2+243*x)*exp(x**2)-8*ln(2)**3+4*(
3*x**2-3*x-27)*ln(2)**2+2*(-3*x**4+6*x**3+51*x**2-54*x-243)*ln(2)+x**6-3*x**5-24*x**4+53*x**3+216*x**2-243*x-7
29),x)

[Out]

9/(x**4 - 2*x**3 + x**2*exp(2*x**2) - 17*x**2 - 4*x**2*log(2) + 4*x*log(2) + 18*x + (2*x**3 - 2*x**2 - 18*x -
4*x*log(2))*exp(x**2) + 4*log(2)**2 + 36*log(2) + 81)

Maxima [B] (verification not implemented)

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

Time = 0.36 (sec) , antiderivative size = 78, normalized size of antiderivative = 2.89 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{x^{4} - 2 \, x^{3} - x^{2} {\left (4 \, \log \left (2\right ) + 17\right )} + x^{2} e^{\left (2 \, x^{2}\right )} + 2 \, x {\left (2 \, \log \left (2\right ) + 9\right )} + 2 \, {\left (x^{3} - x^{2} - x {\left (2 \, \log \left (2\right ) + 9\right )}\right )} e^{\left (x^{2}\right )} + 4 \, \log \left (2\right )^{2} + 36 \, \log \left (2\right ) + 81} \]

[In]

integrate(((-36*x^2-18)*exp(x^2)-36*x+18)/(x^3*exp(x^2)^3+(-6*x^2*log(2)+3*x^4-3*x^3-27*x^2)*exp(x^2)^2+(12*x*
log(2)^2+2*(-6*x^3+6*x^2+54*x)*log(2)+3*x^5-6*x^4-51*x^3+54*x^2+243*x)*exp(x^2)-8*log(2)^3+4*(3*x^2-3*x-27)*lo
g(2)^2+2*(-3*x^4+6*x^3+51*x^2-54*x-243)*log(2)+x^6-3*x^5-24*x^4+53*x^3+216*x^2-243*x-729),x, algorithm="maxima
")

[Out]

9/(x^4 - 2*x^3 - x^2*(4*log(2) + 17) + x^2*e^(2*x^2) + 2*x*(2*log(2) + 9) + 2*(x^3 - x^2 - x*(2*log(2) + 9))*e
^(x^2) + 4*log(2)^2 + 36*log(2) + 81)

Giac [B] (verification not implemented)

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

Time = 0.56 (sec) , antiderivative size = 88, normalized size of antiderivative = 3.26 \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\frac {9}{x^{4} + 2 \, x^{3} e^{\left (x^{2}\right )} - 2 \, x^{3} + x^{2} e^{\left (2 \, x^{2}\right )} - 2 \, x^{2} e^{\left (x^{2}\right )} - 4 \, x^{2} \log \left (2\right ) - 4 \, x e^{\left (x^{2}\right )} \log \left (2\right ) - 17 \, x^{2} - 18 \, x e^{\left (x^{2}\right )} + 4 \, x \log \left (2\right ) + 4 \, \log \left (2\right )^{2} + 18 \, x + 36 \, \log \left (2\right ) + 81} \]

[In]

integrate(((-36*x^2-18)*exp(x^2)-36*x+18)/(x^3*exp(x^2)^3+(-6*x^2*log(2)+3*x^4-3*x^3-27*x^2)*exp(x^2)^2+(12*x*
log(2)^2+2*(-6*x^3+6*x^2+54*x)*log(2)+3*x^5-6*x^4-51*x^3+54*x^2+243*x)*exp(x^2)-8*log(2)^3+4*(3*x^2-3*x-27)*lo
g(2)^2+2*(-3*x^4+6*x^3+51*x^2-54*x-243)*log(2)+x^6-3*x^5-24*x^4+53*x^3+216*x^2-243*x-729),x, algorithm="giac")

[Out]

9/(x^4 + 2*x^3*e^(x^2) - 2*x^3 + x^2*e^(2*x^2) - 2*x^2*e^(x^2) - 4*x^2*log(2) - 4*x*e^(x^2)*log(2) - 17*x^2 -
18*x*e^(x^2) + 4*x*log(2) + 4*log(2)^2 + 18*x + 36*log(2) + 81)

Mupad [F(-1)]

Timed out. \[ \int \frac {18-36 x+e^{x^2} \left (-18-36 x^2\right )}{-729-243 x+216 x^2+53 x^3+e^{3 x^2} x^3-24 x^4-3 x^5+x^6+\left (-243-54 x+51 x^2+6 x^3-3 x^4\right ) \log (4)+\left (-27-3 x+3 x^2\right ) \log ^2(4)-\log ^3(4)+e^{2 x^2} \left (-27 x^2-3 x^3+3 x^4-3 x^2 \log (4)\right )+e^{x^2} \left (243 x+54 x^2-51 x^3-6 x^4+3 x^5+\left (54 x+6 x^2-6 x^3\right ) \log (4)+3 x \log ^2(4)\right )} \, dx=\int \frac {36\,x+{\mathrm {e}}^{x^2}\,\left (36\,x^2+18\right )-18}{243\,x+4\,{\ln \left (2\right )}^2\,\left (-3\,x^2+3\,x+27\right )+{\mathrm {e}}^{2\,x^2}\,\left (6\,x^2\,\ln \left (2\right )+27\,x^2+3\,x^3-3\,x^4\right )+2\,\ln \left (2\right )\,\left (3\,x^4-6\,x^3-51\,x^2+54\,x+243\right )-{\mathrm {e}}^{x^2}\,\left (243\,x+2\,\ln \left (2\right )\,\left (-6\,x^3+6\,x^2+54\,x\right )+12\,x\,{\ln \left (2\right )}^2+54\,x^2-51\,x^3-6\,x^4+3\,x^5\right )+8\,{\ln \left (2\right )}^3-x^3\,{\mathrm {e}}^{3\,x^2}-216\,x^2-53\,x^3+24\,x^4+3\,x^5-x^6+729} \,d x \]

[In]

int((36*x + exp(x^2)*(36*x^2 + 18) - 18)/(243*x + 4*log(2)^2*(3*x - 3*x^2 + 27) + exp(2*x^2)*(6*x^2*log(2) + 2
7*x^2 + 3*x^3 - 3*x^4) + 2*log(2)*(54*x - 51*x^2 - 6*x^3 + 3*x^4 + 243) - exp(x^2)*(243*x + 2*log(2)*(54*x + 6
*x^2 - 6*x^3) + 12*x*log(2)^2 + 54*x^2 - 51*x^3 - 6*x^4 + 3*x^5) + 8*log(2)^3 - x^3*exp(3*x^2) - 216*x^2 - 53*
x^3 + 24*x^4 + 3*x^5 - x^6 + 729),x)

[Out]

int((36*x + exp(x^2)*(36*x^2 + 18) - 18)/(243*x + 4*log(2)^2*(3*x - 3*x^2 + 27) + exp(2*x^2)*(6*x^2*log(2) + 2
7*x^2 + 3*x^3 - 3*x^4) + 2*log(2)*(54*x - 51*x^2 - 6*x^3 + 3*x^4 + 243) - exp(x^2)*(243*x + 2*log(2)*(54*x + 6
*x^2 - 6*x^3) + 12*x*log(2)^2 + 54*x^2 - 51*x^3 - 6*x^4 + 3*x^5) + 8*log(2)^3 - x^3*exp(3*x^2) - 216*x^2 - 53*
x^3 + 24*x^4 + 3*x^5 - x^6 + 729), x)