\(\int \frac {1-x+x^2}{(-1+x^2) \sqrt {1-x+x^2-x^3+x^4}} \, dx\) [1221]

   Optimal result
   Rubi [F]
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 36, antiderivative size = 89 \[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\frac {1}{2} \text {arctanh}\left (\frac {x}{1-2 x+x^2-\sqrt {1-x+x^2-x^3+x^4}}\right )+\frac {3 \text {arctanh}\left (\frac {\sqrt {5} x}{1+2 x+x^2-\sqrt {1-x+x^2-x^3+x^4}}\right )}{2 \sqrt {5}} \]

[Out]

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

Rubi [F]

\[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00 \[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\frac {1}{2} \text {arctanh}\left (\frac {x}{1-2 x+x^2-\sqrt {1-x+x^2-x^3+x^4}}\right )+\frac {3 \text {arctanh}\left (\frac {\sqrt {5} x}{1+2 x+x^2-\sqrt {1-x+x^2-x^3+x^4}}\right )}{2 \sqrt {5}} \]

[In]

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

[Out]

ArcTanh[x/(1 - 2*x + x^2 - Sqrt[1 - x + x^2 - x^3 + x^4])]/2 + (3*ArcTanh[(Sqrt[5]*x)/(1 + 2*x + x^2 - Sqrt[1
- x + x^2 - x^3 + x^4])])/(2*Sqrt[5])

Maple [A] (verified)

Time = 5.55 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.78

method result size
default \(\frac {3 \sqrt {5}\, \operatorname {arctanh}\left (\frac {\left (x^{2}+1\right ) \sqrt {5}}{2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}}\right )}{20}-\frac {\operatorname {arctanh}\left (\frac {3 x^{2}-4 x +3}{2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}}\right )}{4}\) \(69\)
pseudoelliptic \(\frac {3 \sqrt {5}\, \operatorname {arctanh}\left (\frac {\left (x^{2}+1\right ) \sqrt {5}}{2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}}\right )}{20}-\frac {\operatorname {arctanh}\left (\frac {3 x^{2}-4 x +3}{2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}}\right )}{4}\) \(69\)
trager \(\frac {\ln \left (-\frac {-3 x^{2}+2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}+4 x -3}{\left (x -1\right )^{2}}\right )}{4}-\frac {3 \operatorname {RootOf}\left (\textit {\_Z}^{2}-5\right ) \ln \left (-\frac {-\operatorname {RootOf}\left (\textit {\_Z}^{2}-5\right ) x^{2}+2 \sqrt {x^{4}-x^{3}+x^{2}-x +1}-\operatorname {RootOf}\left (\textit {\_Z}^{2}-5\right )}{\left (1+x \right )^{2}}\right )}{20}\) \(98\)
elliptic \(\text {Expression too large to display}\) \(101423\)

[In]

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

[Out]

3/20*5^(1/2)*arctanh(1/2*(x^2+1)*5^(1/2)/(x^4-x^3+x^2-x+1)^(1/2))-1/4*arctanh(1/2*(3*x^2-4*x+3)/(x^4-x^3+x^2-x
+1)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.36 \[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\frac {3}{40} \, \sqrt {5} \log \left (-\frac {9 \, x^{4} - 4 \, x^{3} + 4 \, \sqrt {5} \sqrt {x^{4} - x^{3} + x^{2} - x + 1} {\left (x^{2} + 1\right )} + 14 \, x^{2} - 4 \, x + 9}{x^{4} + 4 \, x^{3} + 6 \, x^{2} + 4 \, x + 1}\right ) + \frac {1}{4} \, \log \left (\frac {3 \, x^{2} - 4 \, x - 2 \, \sqrt {x^{4} - x^{3} + x^{2} - x + 1} + 3}{x^{2} - 2 \, x + 1}\right ) \]

[In]

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

[Out]

3/40*sqrt(5)*log(-(9*x^4 - 4*x^3 + 4*sqrt(5)*sqrt(x^4 - x^3 + x^2 - x + 1)*(x^2 + 1) + 14*x^2 - 4*x + 9)/(x^4
+ 4*x^3 + 6*x^2 + 4*x + 1)) + 1/4*log((3*x^2 - 4*x - 2*sqrt(x^4 - x^3 + x^2 - x + 1) + 3)/(x^2 - 2*x + 1))

Sympy [F]

\[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\int \frac {x^{2} - x + 1}{\left (x - 1\right ) \left (x + 1\right ) \sqrt {x^{4} - x^{3} + x^{2} - x + 1}}\, dx \]

[In]

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

[Out]

Integral((x**2 - x + 1)/((x - 1)*(x + 1)*sqrt(x**4 - x**3 + x**2 - x + 1)), x)

Maxima [F]

\[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\int { \frac {x^{2} - x + 1}{\sqrt {x^{4} - x^{3} + x^{2} - x + 1} {\left (x^{2} - 1\right )}} \,d x } \]

[In]

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

[Out]

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

Giac [F]

\[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\int { \frac {x^{2} - x + 1}{\sqrt {x^{4} - x^{3} + x^{2} - x + 1} {\left (x^{2} - 1\right )}} \,d x } \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {1-x+x^2}{\left (-1+x^2\right ) \sqrt {1-x+x^2-x^3+x^4}} \, dx=\int \frac {x^2-x+1}{\left (x^2-1\right )\,\sqrt {x^4-x^3+x^2-x+1}} \,d x \]

[In]

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

[Out]

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