3.2.53 \(\int \frac {5+x}{-2+x+x^2} \, dx\) [153]

Optimal. Leaf size=15 \[ 2 \log (1-x)-\log (2+x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {646, 31} \begin {gather*} 2 \log (1-x)-\log (x+2) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 31

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

Rule 646

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 1.74, size = 13, normalized size = 0.87 \begin {gather*} -\text {Log}\left [2+x\right ]+2 \text {Log}\left [-1+x\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 14, normalized size = 0.93

method result size
default \(2 \ln \left (-1+x \right )-\ln \left (2+x \right )\) \(14\)
norman \(2 \ln \left (-1+x \right )-\ln \left (2+x \right )\) \(14\)
risch \(2 \ln \left (-1+x \right )-\ln \left (2+x \right )\) \(14\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 13, normalized size = 0.87 \begin {gather*} -\log \left (x + 2\right ) + 2 \, \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 13, normalized size = 0.87 \begin {gather*} -\log \left (x + 2\right ) + 2 \, \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((5+x)/(x^2+x-2),x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.18, size = 13, normalized size = 0.87 \begin {gather*} 2\,\ln \left (x-1\right )-\ln \left (x+2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x + 5)/(x + x^2 - 2),x)

[Out]

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

________________________________________________________________________________________