3.420 \(\int \frac {-4+x^2}{2-5 x+x^3} \, dx\)

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]

Rule 2055

Int[(u_.)*(P_)*(Q_)^(q_), x_Symbol] :> Module[{gcd = PolyGCD[P, Q, x]}, Int[u*gcd^(q + 1)*PolynomialQuotient[P
, gcd, x]*PolynomialQuotient[Q, gcd, x]^q, x] /; NeQ[gcd, 1]] /; ILtQ[q, 0] && PolyQ[P, x] && PolyQ[Q, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 42, normalized size = 0.93 \[ \frac {1}{4} \left (\left (2+\sqrt {2}\right ) \log \left (-x+\sqrt {2}-1\right )-\left (\sqrt {2}-2\right ) \log \left (x+\sqrt {2}+1\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.76, size = 45, normalized size = 1.00 \[ \frac {1}{4} \, \sqrt {2} \log \left (\frac {x^{2} - 2 \, \sqrt {2} {\left (x + 1\right )} + 2 \, x + 3}{x^{2} + 2 \, x - 1}\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 29, normalized size = 0.64 \[ -\frac {\sqrt {2}\, \arctanh \left (\frac {\left (2 x +2\right ) \sqrt {2}}{4}\right )}{2}+\frac {\ln \left (x^{2}+2 x -1\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________