\(\int \frac {16+8 x+e^{\frac {x^2}{2}} (4+98 x-4 x^2-x^3)}{9216-768 x-176 x^2+8 x^3+x^4} \, dx\) [5754]

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

Optimal result

Integrand size = 51, antiderivative size = 24 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=\frac {4+e^{\frac {x^2}{2}}}{(8-x) (12+x)} \]

[Out]

(4+exp(1/2*x^2))/(8-x)/(x+12)

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(53\) vs. \(2(24)=48\).

Time = 0.31 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.21, number of steps used = 9, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.078, Rules used = {6874, 75, 2252, 2235} \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=\frac {e^{\frac {x^2}{2}}}{20 (x+12)}+\frac {e^{\frac {x^2}{2}}}{20 (8-x)}+\frac {4}{(x+12) (8-x)} \]

[In]

Int[(16 + 8*x + E^(x^2/2)*(4 + 98*x - 4*x^2 - x^3))/(9216 - 768*x - 176*x^2 + 8*x^3 + x^4),x]

[Out]

E^(x^2/2)/(20*(8 - x)) + E^(x^2/2)/(20*(12 + x)) + 4/((8 - x)*(12 + x))

Rule 75

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2, 0] &
& EqQ[a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)), 0]

Rule 2235

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erfi[(c + d*x)*Rt[b*Log[F], 2
]]/(2*d*Rt[b*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2252

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2)*((e_.) + (f_.)*(x_))^(m_), x_Symbol] :> Simp[f*(e + f*x)^(m +
1)*(F^(a + b*(c + d*x)^2)/((m + 1)*f^2)), x] + (-Dist[2*b*d^2*(Log[F]/(f^2*(m + 1))), Int[(e + f*x)^(m + 2)*F^
(a + b*(c + d*x)^2), x], x] + Dist[2*b*d*(d*e - c*f)*(Log[F]/(f^2*(m + 1))), Int[(e + f*x)^(m + 1)*F^(a + b*(c
 + d*x)^2), x], x]) /; FreeQ[{F, a, b, c, d, e, f}, x] && NeQ[d*e - c*f, 0] && LtQ[m, -1]

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {8 (2+x)}{(-8+x)^2 (12+x)^2}-\frac {e^{\frac {x^2}{2}} \left (-4-98 x+4 x^2+x^3\right )}{(-8+x)^2 (12+x)^2}\right ) \, dx \\ & = 8 \int \frac {2+x}{(-8+x)^2 (12+x)^2} \, dx-\int \frac {e^{\frac {x^2}{2}} \left (-4-98 x+4 x^2+x^3\right )}{(-8+x)^2 (12+x)^2} \, dx \\ & = \frac {4}{(8-x) (12+x)}-\int \left (-\frac {e^{\frac {x^2}{2}}}{20 (-8+x)^2}+\frac {2 e^{\frac {x^2}{2}}}{5 (-8+x)}+\frac {e^{\frac {x^2}{2}}}{20 (12+x)^2}+\frac {3 e^{\frac {x^2}{2}}}{5 (12+x)}\right ) \, dx \\ & = \frac {4}{(8-x) (12+x)}+\frac {1}{20} \int \frac {e^{\frac {x^2}{2}}}{(-8+x)^2} \, dx-\frac {1}{20} \int \frac {e^{\frac {x^2}{2}}}{(12+x)^2} \, dx-\frac {2}{5} \int \frac {e^{\frac {x^2}{2}}}{-8+x} \, dx-\frac {3}{5} \int \frac {e^{\frac {x^2}{2}}}{12+x} \, dx \\ & = \frac {e^{\frac {x^2}{2}}}{20 (8-x)}+\frac {e^{\frac {x^2}{2}}}{20 (12+x)}+\frac {4}{(8-x) (12+x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.62 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.96 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=-\frac {4+e^{\frac {x^2}{2}}}{-96+4 x+x^2} \]

[In]

Integrate[(16 + 8*x + E^(x^2/2)*(4 + 98*x - 4*x^2 - x^3))/(9216 - 768*x - 176*x^2 + 8*x^3 + x^4),x]

[Out]

-((4 + E^(x^2/2))/(-96 + 4*x + x^2))

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92

method result size
norman \(\frac {-4-{\mathrm e}^{\frac {x^{2}}{2}}}{x^{2}+4 x -96}\) \(22\)
parallelrisch \(\frac {-4-{\mathrm e}^{\frac {x^{2}}{2}}}{x^{2}+4 x -96}\) \(22\)
risch \(-\frac {4}{x^{2}+4 x -96}-\frac {{\mathrm e}^{\frac {x^{2}}{2}}}{x^{2}+4 x -96}\) \(32\)
parts \(\frac {1}{5 x +60}-\frac {1}{5 \left (-8+x \right )}-\frac {{\mathrm e}^{\frac {x^{2}}{2}}}{x^{2}+4 x -96}\) \(34\)

[In]

int(((-x^3-4*x^2+98*x+4)*exp(1/2*x^2)+8*x+16)/(x^4+8*x^3-176*x^2-768*x+9216),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=-\frac {e^{\left (\frac {1}{2} \, x^{2}\right )} + 4}{x^{2} + 4 \, x - 96} \]

[In]

integrate(((-x^3-4*x^2+98*x+4)*exp(1/2*x^2)+8*x+16)/(x^4+8*x^3-176*x^2-768*x+9216),x, algorithm="fricas")

[Out]

-(e^(1/2*x^2) + 4)/(x^2 + 4*x - 96)

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=- \frac {e^{\frac {x^{2}}{2}}}{x^{2} + 4 x - 96} - \frac {4}{x^{2} + 4 x - 96} \]

[In]

integrate(((-x**3-4*x**2+98*x+4)*exp(1/2*x**2)+8*x+16)/(x**4+8*x**3-176*x**2-768*x+9216),x)

[Out]

-exp(x**2/2)/(x**2 + 4*x - 96) - 4/(x**2 + 4*x - 96)

Maxima [B] (verification not implemented)

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

Time = 0.22 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.04 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=-\frac {2 \, {\left (x + 2\right )}}{25 \, {\left (x^{2} + 4 \, x - 96\right )}} + \frac {2 \, {\left (x - 48\right )}}{25 \, {\left (x^{2} + 4 \, x - 96\right )}} - \frac {e^{\left (\frac {1}{2} \, x^{2}\right )}}{x^{2} + 4 \, x - 96} \]

[In]

integrate(((-x^3-4*x^2+98*x+4)*exp(1/2*x^2)+8*x+16)/(x^4+8*x^3-176*x^2-768*x+9216),x, algorithm="maxima")

[Out]

-2/25*(x + 2)/(x^2 + 4*x - 96) + 2/25*(x - 48)/(x^2 + 4*x - 96) - e^(1/2*x^2)/(x^2 + 4*x - 96)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=-\frac {e^{\left (\frac {1}{2} \, x^{2}\right )} + 4}{x^{2} + 4 \, x - 96} \]

[In]

integrate(((-x^3-4*x^2+98*x+4)*exp(1/2*x^2)+8*x+16)/(x^4+8*x^3-176*x^2-768*x+9216),x, algorithm="giac")

[Out]

-(e^(1/2*x^2) + 4)/(x^2 + 4*x - 96)

Mupad [B] (verification not implemented)

Time = 11.85 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.83 \[ \int \frac {16+8 x+e^{\frac {x^2}{2}} \left (4+98 x-4 x^2-x^3\right )}{9216-768 x-176 x^2+8 x^3+x^4} \, dx=-\frac {{\mathrm {e}}^{\frac {x^2}{2}}+4}{x^2+4\,x-96} \]

[In]

int((8*x + exp(x^2/2)*(98*x - 4*x^2 - x^3 + 4) + 16)/(8*x^3 - 176*x^2 - 768*x + x^4 + 9216),x)

[Out]

-(exp(x^2/2) + 4)/(4*x + x^2 - 96)