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

Optimal. Leaf size=26 \[ 3-e^{4-\frac {-1+x}{x}-x}+2 x-\log (x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.13, antiderivative size = 20, normalized size of antiderivative = 0.77, number of steps used = 5, number of rules used = 3, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.086, Rules used = {14, 43, 6706} \begin {gather*} 2 x-e^{-x+\frac {1}{x}+3}-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-E^(3 + x^(-1) - x) + 2*x - Log[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 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 6706

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[(q*F^v)/Log[F], x] /;  !FalseQ[q]
] /; FreeQ[F, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.18, size = 20, normalized size = 0.77 \begin {gather*} -e^{3+\frac {1}{x}-x}+2 x-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-E^(3 + x^(-1) - x) + 2*x - Log[x]

________________________________________________________________________________________

fricas [A]  time = 1.15, size = 24, normalized size = 0.92 \begin {gather*} 2 \, x - e^{\left (-\frac {x^{2} - 3 \, x - 1}{x}\right )} - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - e^(-(x^2 - 3*x - 1)/x) - log(x)

________________________________________________________________________________________

giac [A]  time = 0.16, size = 24, normalized size = 0.92 \begin {gather*} 2 \, x - e^{\left (-\frac {x^{2} - 3 \, x - 1}{x}\right )} - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - e^(-(x^2 - 3*x - 1)/x) - log(x)

________________________________________________________________________________________

maple [A]  time = 0.11, size = 25, normalized size = 0.96




method result size



risch \(2 x -\ln \relax (x )-{\mathrm e}^{-\frac {x^{2}-3 x -1}{x}}\) \(25\)
norman \(\frac {2 x^{2}-x \,{\mathrm e}^{\frac {-x^{2}+3 x +1}{x}}}{x}-\ln \relax (x )\) \(34\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x-ln(x)-exp(-(x^2-3*x-1)/x)

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 19, normalized size = 0.73 \begin {gather*} 2 \, x - e^{\left (-x + \frac {1}{x} + 3\right )} - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 4.79, size = 20, normalized size = 0.77 \begin {gather*} 2\,x-\ln \relax (x)-{\mathrm {e}}^{-x}\,{\mathrm {e}}^{1/x}\,{\mathrm {e}}^3 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - log(x) - exp(-x)*exp(1/x)*exp(3)

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 17, normalized size = 0.65 \begin {gather*} 2 x - e^{\frac {- x^{2} + 3 x + 1}{x}} - \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - exp((-x**2 + 3*x + 1)/x) - log(x)

________________________________________________________________________________________