3.3.14 \(\int \frac {1}{-2 x+x^2} \, dx\) [214]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {629} \begin {gather*} \frac {1}{2} \log (2-x)-\frac {\log (x)}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

Log[2 - x]/2 - Log[x]/2

Rule 629

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

Rubi steps

\begin {align*} \int \frac {1}{-2 x+x^2} \, dx &=\frac {1}{2} \log (2-x)-\frac {\log (x)}{2}\\ \end {align*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

Log[2 - x]/2 - Log[x]/2

________________________________________________________________________________________

Mathics [A]
time = 1.67, size = 11, normalized size = 0.65 \begin {gather*} -\frac {\text {Log}\left [x\right ]}{2}+\frac {\text {Log}\left [-2+x\right ]}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 12, normalized size = 0.71

method result size
default \(-\frac {\ln \left (x \right )}{2}+\frac {\ln \left (-2+x \right )}{2}\) \(12\)
norman \(-\frac {\ln \left (x \right )}{2}+\frac {\ln \left (-2+x \right )}{2}\) \(12\)
risch \(-\frac {\ln \left (x \right )}{2}+\frac {\ln \left (-2+x \right )}{2}\) \(12\)
meijerg \(-\frac {\ln \left (x \right )}{2}+\frac {\ln \left (2\right )}{2}-\frac {i \pi }{2}+\frac {\ln \left (1-\frac {x}{2}\right )}{2}\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 11, normalized size = 0.65 \begin {gather*} \frac {1}{2} \, \log \left (x - 2\right ) - \frac {1}{2} \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 11, normalized size = 0.65 \begin {gather*} \frac {1}{2} \, \log \left (x - 2\right ) - \frac {1}{2} \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 10, normalized size = 0.59 \begin {gather*} - \frac {\log {\left (x \right )}}{2} + \frac {\log {\left (x - 2 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 16, normalized size = 0.94 \begin {gather*} -\frac {\ln \left |x\right |}{2}+\frac {\ln \left |x-2\right |}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 6, normalized size = 0.35 \begin {gather*} -\mathrm {atanh}\left (x-1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-atanh(x - 1)

________________________________________________________________________________________