3.68.28 \(\int \frac {12-17 x-e^2 x+e^x (x-x^2)}{x^3} \, dx\)

Optimal. Leaf size=25 \[ \frac {18+e^2-e^x+2 x-\frac {6+x}{x}}{x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 28, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {6, 14, 2197, 37} \begin {gather*} -\frac {\left (12-\left (17+e^2\right ) x\right )^2}{24 x^2}-\frac {e^x}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(E^x/x) - (12 - (17 + E^2)*x)^2/(24*x^2)

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, 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 37

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

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 \frac {12+\left (-17-e^2\right ) x+e^x \left (x-x^2\right )}{x^3} \, dx\\ &=\int \left (-\frac {e^x (-1+x)}{x^2}+\frac {12-\left (17+e^2\right ) x}{x^3}\right ) \, dx\\ &=-\int \frac {e^x (-1+x)}{x^2} \, dx+\int \frac {12-\left (17+e^2\right ) x}{x^3} \, dx\\ &=-\frac {e^x}{x}-\frac {\left (12-\left (17+e^2\right ) x\right )^2}{24 x^2}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 19, normalized size = 0.76 \begin {gather*} -\frac {6+\left (-17-e^2+e^x\right ) x}{x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-((6 + (-17 - E^2 + E^x)*x)/x^2)

________________________________________________________________________________________

fricas [A]  time = 0.63, size = 18, normalized size = 0.72 \begin {gather*} \frac {x e^{2} - x e^{x} + 17 \, x - 6}{x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*e^2 - x*e^x + 17*x - 6)/x^2

________________________________________________________________________________________

giac [A]  time = 0.23, size = 18, normalized size = 0.72 \begin {gather*} \frac {x e^{2} - x e^{x} + 17 \, x - 6}{x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*e^2 - x*e^x + 17*x - 6)/x^2

________________________________________________________________________________________

maple [A]  time = 0.03, size = 18, normalized size = 0.72




method result size



norman \(\frac {-6+\left ({\mathrm e}^{2}+17\right ) x -{\mathrm e}^{x} x}{x^{2}}\) \(18\)
risch \(\frac {\left ({\mathrm e}^{2}+17\right ) x -6}{x^{2}}-\frac {{\mathrm e}^{x}}{x}\) \(21\)
default \(-\frac {{\mathrm e}^{x}}{x}-\frac {6}{x^{2}}+\frac {17}{x}+\frac {{\mathrm e}^{2}}{x}\) \(25\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(-6+(exp(2)+17)*x-exp(x)*x)/x^2

________________________________________________________________________________________

maxima [C]  time = 0.38, size = 26, normalized size = 1.04 \begin {gather*} \frac {e^{2}}{x} + \frac {17}{x} - \frac {6}{x^{2}} - {\rm Ei}\relax (x) + \Gamma \left (-1, -x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

e^2/x + 17/x - 6/x^2 - Ei(x) + gamma(-1, -x)

________________________________________________________________________________________

mupad [B]  time = 4.08, size = 16, normalized size = 0.64 \begin {gather*} \frac {x\,\left ({\mathrm {e}}^2-{\mathrm {e}}^x+17\right )-6}{x^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*(exp(2) - exp(x) + 17) - 6)/x^2

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 19, normalized size = 0.76 \begin {gather*} - \frac {e^{x}}{x} - \frac {x \left (-17 - e^{2}\right ) + 6}{x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x**2+x)*exp(x)-exp(2)*x-17*x+12)/x**3,x)

[Out]

-exp(x)/x - (x*(-17 - exp(2)) + 6)/x**2

________________________________________________________________________________________