3.29.87 \(\int \frac {-9+e+e^x (-1+x)+4 x^2}{x^2} \, dx\)

Optimal. Leaf size=19 \[ 4 x+\frac {9-e+e^x+3 x}{x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 20, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {14, 2197} \begin {gather*} 4 x+\frac {e^x}{x}+\frac {9-e}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(9 - E)/x + E^x/x + 4*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 2197

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[(g*u^(m + 1)*F^(c*v))/(b*c
*e*Log[F]), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, x
]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 17, normalized size = 0.89 \begin {gather*} \frac {9-e+e^x+4 x^2}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 17, normalized size = 0.89 \begin {gather*} \frac {4 \, x^{2} - e + e^{x} + 9}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.16, size = 17, normalized size = 0.89 \begin {gather*} \frac {4 \, x^{2} - e + e^{x} + 9}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 18, normalized size = 0.95




method result size



norman \(\frac {4 x^{2}-{\mathrm e}+9+{\mathrm e}^{x}}{x}\) \(18\)
default \(4 x -\frac {{\mathrm e}}{x}+\frac {9}{x}+\frac {{\mathrm e}^{x}}{x}\) \(23\)
risch \(4 x -\frac {{\mathrm e}}{x}+\frac {9}{x}+\frac {{\mathrm e}^{x}}{x}\) \(23\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [C]  time = 0.63, size = 25, normalized size = 1.32 \begin {gather*} 4 \, x - \frac {e}{x} + \frac {9}{x} + {\rm Ei}\relax (x) - \Gamma \left (-1, -x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*x - e/x + 9/x + Ei(x) - gamma(-1, -x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4*x + (exp(x) - exp(1) + 9)/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x-1)*exp(x)+exp(1)+4*x**2-9)/x**2,x)

[Out]

4*x + exp(x)/x + (9 - E)/x

________________________________________________________________________________________