3.2.9 \(\int \frac {-1+5 x+2 x^2}{-2 x+x^2+x^3} \, dx\) [109]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {1608, 1642} \begin {gather*} 2 \log (1-x)+\frac {\log (x)}{2}-\frac {1}{2} \log (x+2) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 1608

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

Rule 1642

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 1.70, size = 17, normalized size = 0.74 \begin {gather*} -\frac {\text {Log}\left [2+x\right ]}{2}+\frac {\text {Log}\left [x\right ]}{2}+2 \text {Log}\left [-1+x\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 18, normalized size = 0.78

method result size
default \(\frac {\ln \left (x \right )}{2}+2 \ln \left (-1+x \right )-\frac {\ln \left (2+x \right )}{2}\) \(18\)
norman \(\frac {\ln \left (x \right )}{2}+2 \ln \left (-1+x \right )-\frac {\ln \left (2+x \right )}{2}\) \(18\)
risch \(\frac {\ln \left (x \right )}{2}+2 \ln \left (-1+x \right )-\frac {\ln \left (2+x \right )}{2}\) \(18\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 17, normalized size = 0.74 \begin {gather*} -\frac {1}{2} \, \log \left (x + 2\right ) + 2 \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 17, normalized size = 0.74 \begin {gather*} -\frac {1}{2} \, \log \left (x + 2\right ) + 2 \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 17, normalized size = 0.74 \begin {gather*} \frac {\log {\left (x \right )}}{2} + 2 \log {\left (x - 1 \right )} - \frac {\log {\left (x + 2 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.19, size = 19, normalized size = 0.83 \begin {gather*} 2\,\ln \left (x-1\right )+\mathrm {atanh}\left (\frac {135}{11\,\left (11\,x-5\right )}+\frac {16}{11}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(x - 1) + atanh(135/(11*(11*x - 5)) + 16/11)

________________________________________________________________________________________