3.10.39 \(\int \frac {1-2 x+2 x^2}{-x+x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 14, normalized size of antiderivative = 0.54, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {1593, 893} \begin {gather*} 2 x+\log (1-x)-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + Log[1 - x] - Log[x]

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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 14, normalized size = 0.54 \begin {gather*} 2 x+\log (1-x)-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + Log[1 - x] - Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 12, normalized size = 0.46 \begin {gather*} 2 \, x + \log \left (x - 1\right ) - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.21, size = 14, normalized size = 0.54 \begin {gather*} 2 \, x + \log \left ({\left | x - 1 \right |}\right ) - \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x + log(abs(x - 1)) - log(abs(x))

________________________________________________________________________________________

maple [A]  time = 0.18, size = 13, normalized size = 0.50




method result size



default \(2 x +\ln \left (x -1\right )-\ln \relax (x )\) \(13\)
norman \(2 x +\ln \left (x -1\right )-\ln \relax (x )\) \(13\)
risch \(2 x +\ln \left (x -1\right )-\ln \relax (x )\) \(13\)
meijerg \(\ln \left (1-x \right )-\ln \relax (x )-i \pi +2 x\) \(19\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 12, normalized size = 0.46 \begin {gather*} 2 \, x + \log \left (x - 1\right ) - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 12, normalized size = 0.46 \begin {gather*} 2\,x-2\,\mathrm {atanh}\left (2\,x-1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x - 2*atanh(2*x - 1)

________________________________________________________________________________________

sympy [A]  time = 0.08, size = 10, normalized size = 0.38 \begin {gather*} 2 x - \log {\relax (x )} + \log {\left (x - 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________