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

Optimal. Leaf size=51 \[ \frac {1}{10} \left (5-4 \sqrt {5}\right ) \log \left (-x-\sqrt {5}+2\right )+\frac {1}{10} \left (5+4 \sqrt {5}\right ) \log \left (-x+\sqrt {5}+2\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {632, 31} \[ \frac {1}{10} \left (5-4 \sqrt {5}\right ) \log \left (-x-\sqrt {5}+2\right )+\frac {1}{10} \left (5+4 \sqrt {5}\right ) \log \left (-x+\sqrt {5}+2\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

((5 - 4*Sqrt[5])*Log[2 - Sqrt[5] - x])/10 + ((5 + 4*Sqrt[5])*Log[2 + Sqrt[5] - x])/10

Rule 31

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

Rule 632

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 {2+x}{-1-4 x+x^2} \, dx &=-\left (\frac {1}{10} \left (-5+4 \sqrt {5}\right ) \int \frac {1}{-2+\sqrt {5}+x} \, dx\right )+\frac {1}{10} \left (5+4 \sqrt {5}\right ) \int \frac {1}{-2-\sqrt {5}+x} \, dx\\ &=\frac {1}{10} \left (5-4 \sqrt {5}\right ) \log \left (2-\sqrt {5}-x\right )+\frac {1}{10} \left (5+4 \sqrt {5}\right ) \log \left (2+\sqrt {5}-x\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 47, normalized size = 0.92 \[ \frac {1}{10} \left (5+4 \sqrt {5}\right ) \log \left (-x+\sqrt {5}+2\right )+\frac {1}{10} \left (5-4 \sqrt {5}\right ) \log \left (x+\sqrt {5}-2\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

((5 + 4*Sqrt[5])*Log[2 + Sqrt[5] - x])/10 + ((5 - 4*Sqrt[5])*Log[-2 + Sqrt[5] + x])/10

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.04, size = 47, normalized size = 0.92 \[ \frac {1}{10} \left (5+4 \sqrt {5}\right ) \log \left (-x+\sqrt {5}+2\right )+\frac {1}{10} \left (5-4 \sqrt {5}\right ) \log \left (x+\sqrt {5}-2\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

((5 + 4*Sqrt[5])*Log[2 + Sqrt[5] - x])/10 + ((5 - 4*Sqrt[5])*Log[-2 + Sqrt[5] + x])/10

________________________________________________________________________________________

fricas [A]  time = 0.84, size = 45, normalized size = 0.88 \[ \frac {2}{5} \, \sqrt {5} \log \left (\frac {x^{2} - 2 \, \sqrt {5} {\left (x - 2\right )} - 4 \, x + 9}{x^{2} - 4 \, x - 1}\right ) + \frac {1}{2} \, \log \left (x^{2} - 4 \, x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/5*sqrt(5)*log((x^2 - 2*sqrt(5)*(x - 2) - 4*x + 9)/(x^2 - 4*x - 1)) + 1/2*log(x^2 - 4*x - 1)

________________________________________________________________________________________

giac [A]  time = 0.94, size = 44, normalized size = 0.86 \[ \frac {2}{5} \, \sqrt {5} \log \left (\frac {{\left | 2 \, x - 2 \, \sqrt {5} - 4 \right |}}{{\left | 2 \, x + 2 \, \sqrt {5} - 4 \right |}}\right ) + \frac {1}{2} \, \log \left ({\left | x^{2} - 4 \, x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/5*sqrt(5)*log(abs(2*x - 2*sqrt(5) - 4)/abs(2*x + 2*sqrt(5) - 4)) + 1/2*log(abs(x^2 - 4*x - 1))

________________________________________________________________________________________

maple [A]  time = 0.40, size = 29, normalized size = 0.57




method result size



default \(\frac {\ln \left (x^{2}-4 x -1\right )}{2}-\frac {4 \sqrt {5}\, \arctanh \left (\frac {\left (2 x -4\right ) \sqrt {5}}{10}\right )}{5}\) \(29\)
risch \(\frac {\ln \left (x -\sqrt {5}-2\right )}{2}+\frac {2 \ln \left (x -\sqrt {5}-2\right ) \sqrt {5}}{5}+\frac {\ln \left (x -2+\sqrt {5}\right )}{2}-\frac {2 \ln \left (x -2+\sqrt {5}\right ) \sqrt {5}}{5}\) \(48\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*ln(x^2-4*x-1)-4/5*5^(1/2)*arctanh(1/10*(2*x-4)*5^(1/2))

________________________________________________________________________________________

maxima [A]  time = 0.95, size = 35, normalized size = 0.69 \[ \frac {2}{5} \, \sqrt {5} \log \left (\frac {x - \sqrt {5} - 2}{x + \sqrt {5} - 2}\right ) + \frac {1}{2} \, \log \left (x^{2} - 4 \, x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/5*sqrt(5)*log((x - sqrt(5) - 2)/(x + sqrt(5) - 2)) + 1/2*log(x^2 - 4*x - 1)

________________________________________________________________________________________

mupad [B]  time = 0.12, size = 34, normalized size = 0.67 \[ \ln \left (x-\sqrt {5}-2\right )\,\left (\frac {2\,\sqrt {5}}{5}+\frac {1}{2}\right )-\ln \left (x+\sqrt {5}-2\right )\,\left (\frac {2\,\sqrt {5}}{5}-\frac {1}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 42, normalized size = 0.82 \[ \left (\frac {1}{2} - \frac {2 \sqrt {5}}{5}\right ) \log {\left (x - 2 + \sqrt {5} \right )} + \left (\frac {1}{2} + \frac {2 \sqrt {5}}{5}\right ) \log {\left (x - \sqrt {5} - 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________