3.67.45 \(\int \frac {-8+24 x^2+e^x (-4+4 x-x^2)}{3 x^2} \, dx\)

Optimal. Leaf size=28 \[ \frac {1}{3} \left (2+e^x\right ) \left (\frac {3}{x}+\frac {1-x}{x}\right )+8 x \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {12, 14, 2199, 2194, 2177, 2178} \begin {gather*} 8 x-\frac {e^x}{3}+\frac {4 e^x}{3 x}+\frac {8}{3 x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-8 + 24*x^2 + E^x*(-4 + 4*x - x^2))/(3*x^2),x]

[Out]

-1/3*E^x + 8/(3*x) + (4*E^x)/(3*x) + 8*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 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2177

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[((c + d*x)^(m
 + 1)*(b*F^(g*(e + f*x)))^n)/(d*(m + 1)), x] - Dist[(f*g*n*Log[F])/(d*(m + 1)), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !$UseGamma ===
True

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$UseGamma === True

Rule 2194

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2199

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !$UseGamma === True

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\frac {1}{3} \int \frac {-8+24 x^2+e^x \left (-4+4 x-x^2\right )}{x^2} \, dx\\ &=\frac {1}{3} \int \left (-\frac {e^x (-2+x)^2}{x^2}+\frac {8 \left (-1+3 x^2\right )}{x^2}\right ) \, dx\\ &=-\left (\frac {1}{3} \int \frac {e^x (-2+x)^2}{x^2} \, dx\right )+\frac {8}{3} \int \frac {-1+3 x^2}{x^2} \, dx\\ &=-\left (\frac {1}{3} \int \left (e^x+\frac {4 e^x}{x^2}-\frac {4 e^x}{x}\right ) \, dx\right )+\frac {8}{3} \int \left (3-\frac {1}{x^2}\right ) \, dx\\ &=\frac {8}{3 x}+8 x-\frac {\int e^x \, dx}{3}-\frac {4}{3} \int \frac {e^x}{x^2} \, dx+\frac {4}{3} \int \frac {e^x}{x} \, dx\\ &=-\frac {e^x}{3}+\frac {8}{3 x}+\frac {4 e^x}{3 x}+8 x+\frac {4 \text {Ei}(x)}{3}-\frac {4}{3} \int \frac {e^x}{x} \, dx\\ &=-\frac {e^x}{3}+\frac {8}{3 x}+\frac {4 e^x}{3 x}+8 x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 26, normalized size = 0.93 \begin {gather*} \frac {1}{3} \left (-e^x+\frac {8}{x}+\frac {4 e^x}{x}+24 x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-8 + 24*x^2 + E^x*(-4 + 4*x - x^2))/(3*x^2),x]

[Out]

(-E^x + 8/x + (4*E^x)/x + 24*x)/3

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 19, normalized size = 0.68 \begin {gather*} \frac {24 \, x^{2} - {\left (x - 4\right )} e^{x} + 8}{3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/3*((-x^2+4*x-4)*exp(x)+24*x^2-8)/x^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.17, size = 21, normalized size = 0.75 \begin {gather*} \frac {24 \, x^{2} - x e^{x} + 4 \, e^{x} + 8}{3 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/3*((-x^2+4*x-4)*exp(x)+24*x^2-8)/x^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 20, normalized size = 0.71




method result size



risch \(8 x +\frac {8}{3 x}-\frac {\left (x -4\right ) {\mathrm e}^{x}}{3 x}\) \(20\)
default \(8 x +\frac {8}{3 x}+\frac {4 \,{\mathrm e}^{x}}{3 x}-\frac {{\mathrm e}^{x}}{3}\) \(21\)
norman \(\frac {\frac {8}{3}+8 x^{2}-\frac {{\mathrm e}^{x} x}{3}+\frac {4 \,{\mathrm e}^{x}}{3}}{x}\) \(21\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/3*((-x^2+4*x-4)*exp(x)+24*x^2-8)/x^2,x,method=_RETURNVERBOSE)

[Out]

8*x+8/3/x-1/3*(x-4)/x*exp(x)

________________________________________________________________________________________

maxima [C]  time = 0.40, size = 24, normalized size = 0.86 \begin {gather*} 8 \, x + \frac {8}{3 \, x} + \frac {4}{3} \, {\rm Ei}\relax (x) - \frac {1}{3} \, e^{x} - \frac {4}{3} \, \Gamma \left (-1, -x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/3*((-x^2+4*x-4)*exp(x)+24*x^2-8)/x^2,x, algorithm="maxima")

[Out]

8*x + 8/3/x + 4/3*Ei(x) - 1/3*e^x - 4/3*gamma(-1, -x)

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 18, normalized size = 0.64 \begin {gather*} 8\,x-\frac {{\mathrm {e}}^x}{3}+\frac {\frac {4\,{\mathrm {e}}^x}{3}+\frac {8}{3}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-((exp(x)*(x^2 - 4*x + 4))/3 - 8*x^2 + 8/3)/x^2,x)

[Out]

8*x - exp(x)/3 + ((4*exp(x))/3 + 8/3)/x

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 17, normalized size = 0.61 \begin {gather*} 8 x + \frac {\left (4 - x\right ) e^{x}}{3 x} + \frac {8}{3 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/3*((-x**2+4*x-4)*exp(x)+24*x**2-8)/x**2,x)

[Out]

8*x + (4 - x)*exp(x)/(3*x) + 8/(3*x)

________________________________________________________________________________________