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

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.046602, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115 \[ \frac{x^2}{2}+\frac{1}{2} \log \left (1-x^2\right )+x-\log (x) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ x - \log{\left (x \right )} + \frac{\log{\left (- x^{2} + 1 \right )}}{2} + \int x\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**4+x**3-x**2-x+1)/(x**3-x),x)

[Out]

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

_______________________________________________________________________________________

Mathematica [A]  time = 0.00890225, size = 25, normalized size = 1. \[ \frac{x^2}{2}+\frac{1}{2} \log \left (1-x^2\right )+x-\log (x) \]

Antiderivative was successfully verified.

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

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.01, size = 24, normalized size = 1. \[ x+{\frac{{x}^{2}}{2}}+{\frac{\ln \left ( 1+x \right ) }{2}}-\ln \left ( x \right ) +{\frac{\ln \left ( -1+x \right ) }{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^4+x^3-x^2-x+1)/(x^3-x),x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.32485, size = 31, normalized size = 1.24 \[ \frac{1}{2} \, x^{2} + x + \frac{1}{2} \, \log \left (x + 1\right ) + \frac{1}{2} \, \log \left (x - 1\right ) - \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + x^3 - x^2 - x + 1)/(x^3 - x),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.199789, size = 26, normalized size = 1.04 \[ \frac{1}{2} \, x^{2} + x + \frac{1}{2} \, \log \left (x^{2} - 1\right ) - \log \left (x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + x^3 - x^2 - x + 1)/(x^3 - x),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.094391, size = 17, normalized size = 0.68 \[ \frac{x^{2}}{2} + x - \log{\left (x \right )} + \frac{\log{\left (x^{2} - 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**4+x**3-x**2-x+1)/(x**3-x),x)

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.217555, size = 35, normalized size = 1.4 \[ \frac{1}{2} \, x^{2} + x + \frac{1}{2} \,{\rm ln}\left ({\left | x + 1 \right |}\right ) + \frac{1}{2} \,{\rm ln}\left ({\left | x - 1 \right |}\right ) -{\rm ln}\left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^4 + x^3 - x^2 - x + 1)/(x^3 - x),x, algorithm="giac")

[Out]

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