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

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 21, normalized size of antiderivative = 0.72, number of steps used = 6, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {12, 14, 2194} \begin {gather*} -\frac {x^2}{2}+x+\frac {e^x}{2}-\frac {4}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x/2 - 4/x + x - x^2/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 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 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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 21, normalized size = 0.72 \begin {gather*} \frac {e^x}{2}-\frac {4}{x}+x-\frac {x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x/2 - 4/x + x - x^2/2

________________________________________________________________________________________

fricas [A]  time = 0.55, size = 20, normalized size = 0.69 \begin {gather*} -\frac {x^{3} - 2 \, x^{2} - x e^{x} + 8}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.25, size = 20, normalized size = 0.69 \begin {gather*} -\frac {x^{3} - 2 \, x^{2} - x e^{x} + 8}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 17, normalized size = 0.59




method result size



default \(-\frac {x^{2}}{2}+x -\frac {4}{x}+\frac {{\mathrm e}^{x}}{2}\) \(17\)
risch \(-\frac {x^{2}}{2}+x -\frac {4}{x}+\frac {{\mathrm e}^{x}}{2}\) \(17\)
norman \(\frac {-4+x^{2}-\frac {x^{3}}{2}+\frac {{\mathrm e}^{x} x}{2}}{x}\) \(20\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.40, size = 16, normalized size = 0.55 \begin {gather*} -\frac {1}{2} \, x^{2} + x - \frac {4}{x} + \frac {1}{2} \, e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*x^2 + x - 4/x + 1/2*e^x

________________________________________________________________________________________

mupad [B]  time = 1.94, size = 16, normalized size = 0.55 \begin {gather*} x+\frac {{\mathrm {e}}^x}{2}-\frac {4}{x}-\frac {x^2}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 14, normalized size = 0.48 \begin {gather*} - \frac {x^{2}}{2} + x + \frac {e^{x}}{2} - \frac {4}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________