3.82.85 \(\int \frac {-x-4 x^2+2 e x^2-2 x^3+(2-e+x) \log (-2+e-x)}{-2 x^2+e x^2-x^3} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.27, antiderivative size = 15, normalized size of antiderivative = 0.94, number of steps used = 11, number of rules used = 8, integrand size = 53, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.151, Rules used = {6, 1593, 6742, 893, 2395, 36, 31, 29} \begin {gather*} 2 x+\frac {\log (-x+e-2)}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + Log[-2 + E - x]/x

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 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 893

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 2395

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[((f + g
*x)^(q + 1)*(a + b*Log[c*(d + e*x)^n]))/(g*(q + 1)), x] - Dist[(b*e*n)/(g*(q + 1)), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

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

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 15, normalized size = 0.94 \begin {gather*} 2 x+\frac {\log (-2+e-x)}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + Log[-2 + E - x]/x

________________________________________________________________________________________

fricas [A]  time = 0.74, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x-exp(1)+2)*log(exp(1)-x-2)+2*x^2*exp(1)-2*x^3-4*x^2-x)/(x^2*exp(1)-x^3-2*x^2),x, algorithm="frica
s")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 1.54, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.35, size = 17, normalized size = 1.06




method result size



risch \(\frac {\ln \left ({\mathrm e}-x -2\right )}{x}+2 x\) \(17\)
norman \(\frac {2 x^{2}+\ln \left ({\mathrm e}-x -2\right )}{x}\) \(19\)
derivativedivides \(-2 \,{\mathrm e}+2 x +4-\frac {\ln \left (-x \right )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right )}{{\mathrm e}-2}+\frac {\ln \relax (x )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right ) \left ({\mathrm e}-x -2\right )}{\left ({\mathrm e}-2\right ) x}\) \(71\)
default \(-2 \,{\mathrm e}+2 x +4-\frac {\ln \left (-x \right )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right )}{{\mathrm e}-2}+\frac {\ln \relax (x )}{{\mathrm e}-2}+\frac {\ln \left ({\mathrm e}-x -2\right ) \left ({\mathrm e}-x -2\right )}{\left ({\mathrm e}-2\right ) x}\) \(71\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 18, normalized size = 1.12 \begin {gather*} \frac {2 \, x^{2} + \log \left (-x + e - 2\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x-exp(1)+2)*log(exp(1)-x-2)+2*x^2*exp(1)-2*x^3-4*x^2-x)/(x^2*exp(1)-x^3-2*x^2),x, algorithm="maxim
a")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 5.49, size = 16, normalized size = 1.00 \begin {gather*} 2\,x+\frac {\ln \left (\mathrm {e}-x-2\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 12, normalized size = 0.75 \begin {gather*} 2 x + \frac {\log {\left (- x - 2 + e \right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x + log(-x - 2 + E)/x

________________________________________________________________________________________