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

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

________________________________________________________________________________________

Rubi [A]  time = 0.91, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 62, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {6741, 6742, 6715, 2282, 36, 31, 29, 1620} \begin {gather*} -x-\log \left (1-e^{\frac {1}{x}}\right )+3 \log (x)+\log (x+2) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 1620

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6715

Int[(u_)*(x_)^(m_.), x_Symbol] :> Dist[1/(m + 1), Subst[Int[SubstFor[x^(m + 1), u, x], x], x, x^(m + 1)], x] /
; FreeQ[m, x] && NeQ[m, -1] && FunctionOfQ[x^(m + 1), u, x]

Rule 6741

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 24, normalized size = 1.00 \begin {gather*} -x-\log \left (1-e^{\frac {1}{x}}\right )+3 \log (x)+\log (2+x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.38, size = 35, normalized size = 1.46 \begin {gather*} x {\left (\frac {4 \, \log \relax (x)}{x} + \frac {\log \left (\frac {2}{x} + 1\right )}{x} - \frac {\log \left (e^{\frac {1}{x}} - 1\right )}{x} - 1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.09, size = 22, normalized size = 0.92




method result size



norman \(-x +3 \ln \relax (x )-\ln \left ({\mathrm e}^{\frac {1}{x}}-1\right )+\ln \left (2+x \right )\) \(22\)
risch \(-x +3 \ln \relax (x )-\ln \left ({\mathrm e}^{\frac {1}{x}}-1\right )+\ln \left (2+x \right )\) \(22\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.16, size = 21, normalized size = 0.88 \begin {gather*} \ln \left (x+2\right )-\ln \left ({\mathrm {e}}^{1/x}-1\right )-x+3\,\ln \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________