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

Optimal result
Mathematica [A] (verified)
Rubi [C] (warning: unable to verify)
Maple [C] (warning: unable to verify)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 27, antiderivative size = 139 \[ \int \frac {-2 x+x^2}{\left (1-x+x^2\right ) \sqrt [4]{1+x^4}} \, dx=\frac {1}{2} \arctan \left (\frac {x}{\sqrt [4]{1+x^4}}\right )-\frac {\arctan \left (\frac {\left (-\sqrt {2}+\sqrt {2} x\right ) \sqrt [4]{1+x^4}}{-1+2 x-x^2+\sqrt {1+x^4}}\right )}{\sqrt {2}}+\frac {1}{2} \text {arctanh}\left (\frac {x}{\sqrt [4]{1+x^4}}\right )-\frac {\text {arctanh}\left (\frac {\left (-\sqrt {2}+\sqrt {2} x\right ) \sqrt [4]{1+x^4}}{1-2 x+x^2+\sqrt {1+x^4}}\right )}{\sqrt {2}} \] Output:

1/2*arctan(x/(x^4+1)^(1/4))-1/2*arctan((-2^(1/2)+x*2^(1/2))*(x^4+1)^(1/4)/ 
(-1+2*x-x^2+(x^4+1)^(1/2)))*2^(1/2)+1/2*arctanh(x/(x^4+1)^(1/4))-1/2*arcta 
nh((-2^(1/2)+x*2^(1/2))*(x^4+1)^(1/4)/(1-2*x+x^2+(x^4+1)^(1/2)))*2^(1/2)
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 8.09 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.87 \[ \int \frac {-2 x+x^2}{\left (1-x+x^2\right ) \sqrt [4]{1+x^4}} \, dx=\frac {1}{2} \left (\arctan \left (\frac {x}{\sqrt [4]{1+x^4}}\right )-\sqrt {2} \arctan \left (\frac {\sqrt {2} (-1+x) \sqrt [4]{1+x^4}}{-1+2 x-x^2+\sqrt {1+x^4}}\right )+\text {arctanh}\left (\frac {x}{\sqrt [4]{1+x^4}}\right )-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {2} (-1+x) \sqrt [4]{1+x^4}}{1-2 x+x^2+\sqrt {1+x^4}}\right )\right ) \] Input:

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

Output:

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

Rubi [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 6 vs. order 3 in optimal.

Time = 1.92 (sec) , antiderivative size = 851, normalized size of antiderivative = 6.12, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2027, 7279, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 2027

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

\(\Big \downarrow \) 7279

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {1}{6} \left (1+i \sqrt {3}\right ) \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{4},1,\frac {7}{4},-x^4,-\frac {2 x^4}{1-i \sqrt {3}}\right ) x^3-\frac {1}{6} \left (1-i \sqrt {3}\right ) \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{4},1,\frac {7}{4},-x^4,-\frac {2 x^4}{1+i \sqrt {3}}\right ) x^3+\frac {1}{2} \arctan \left (\frac {x}{\sqrt [4]{x^4+1}}\right )-\frac {1}{4} \left (1+i \sqrt {3}\right ) \sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \arctan \left (\frac {x}{\sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \sqrt [4]{x^4+1}}\right )-\frac {1}{2} \left (-\frac {i-\sqrt {3}}{i+\sqrt {3}}\right )^{3/4} \arctan \left (\frac {\sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} x}{\sqrt [4]{x^4+1}}\right )-\frac {1}{2} \left (\frac {1}{2} \left (1-i \sqrt {3}\right )\right )^{3/4} \arctan \left (\frac {\sqrt [4]{2} \sqrt [4]{x^4+1}}{\sqrt [4]{1-i \sqrt {3}}}\right )-\frac {1}{2} \left (\frac {1}{2} \left (1+i \sqrt {3}\right )\right )^{3/4} \arctan \left (\frac {\sqrt [4]{2} \sqrt [4]{x^4+1}}{\sqrt [4]{1+i \sqrt {3}}}\right )+\frac {1}{2} \text {arctanh}\left (\frac {x}{\sqrt [4]{x^4+1}}\right )-\frac {1}{4} \left (1+i \sqrt {3}\right ) \sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \text {arctanh}\left (\frac {x}{\sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} \sqrt [4]{x^4+1}}\right )-\frac {1}{2} \left (-\frac {i-\sqrt {3}}{i+\sqrt {3}}\right )^{3/4} \text {arctanh}\left (\frac {\sqrt [4]{-\frac {i-\sqrt {3}}{i+\sqrt {3}}} x}{\sqrt [4]{x^4+1}}\right )+\frac {1}{2} \left (\frac {1}{2} \left (1-i \sqrt {3}\right )\right )^{3/4} \text {arctanh}\left (\frac {\sqrt [4]{2} \sqrt [4]{x^4+1}}{\sqrt [4]{1-i \sqrt {3}}}\right )+\frac {1}{2} \left (\frac {1}{2} \left (1+i \sqrt {3}\right )\right )^{3/4} \text {arctanh}\left (\frac {\sqrt [4]{2} \sqrt [4]{x^4+1}}{\sqrt [4]{1+i \sqrt {3}}}\right )-\frac {i \sqrt {-x^4} \operatorname {EllipticPi}\left (\frac {1}{2} \left (-i-\sqrt {3}\right ),\arcsin \left (\sqrt [4]{x^4+1}\right ),-1\right )}{2 x^2}+\frac {i \sqrt {-x^4} \operatorname {EllipticPi}\left (\frac {1}{2} \left (i-\sqrt {3}\right ),\arcsin \left (\sqrt [4]{x^4+1}\right ),-1\right )}{2 x^2}+\frac {i \sqrt {-x^4} \operatorname {EllipticPi}\left (\frac {1}{\sqrt {\frac {1}{2} \left (1-i \sqrt {3}\right )}},\arcsin \left (\sqrt [4]{x^4+1}\right ),-1\right )}{2 x^2}-\frac {i \sqrt {-x^4} \operatorname {EllipticPi}\left (\frac {1}{\sqrt {\frac {1}{2} \left (1+i \sqrt {3}\right )}},\arcsin \left (\sqrt [4]{x^4+1}\right ),-1\right )}{2 x^2}\)

Input:

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

Output:

-1/6*((1 + I*Sqrt[3])*x^3*AppellF1[3/4, 1/4, 1, 7/4, -x^4, (-2*x^4)/(1 - I 
*Sqrt[3])]) - ((1 - I*Sqrt[3])*x^3*AppellF1[3/4, 1/4, 1, 7/4, -x^4, (-2*x^ 
4)/(1 + I*Sqrt[3])])/6 + ArcTan[x/(1 + x^4)^(1/4)]/2 - ((1 + I*Sqrt[3])*(- 
((I - Sqrt[3])/(I + Sqrt[3])))^(1/4)*ArcTan[x/((-((I - Sqrt[3])/(I + Sqrt[ 
3])))^(1/4)*(1 + x^4)^(1/4))])/4 - ((-((I - Sqrt[3])/(I + Sqrt[3])))^(3/4) 
*ArcTan[((-((I - Sqrt[3])/(I + Sqrt[3])))^(1/4)*x)/(1 + x^4)^(1/4)])/2 - ( 
((1 - I*Sqrt[3])/2)^(3/4)*ArcTan[(2^(1/4)*(1 + x^4)^(1/4))/(1 - I*Sqrt[3]) 
^(1/4)])/2 - (((1 + I*Sqrt[3])/2)^(3/4)*ArcTan[(2^(1/4)*(1 + x^4)^(1/4))/( 
1 + I*Sqrt[3])^(1/4)])/2 + ArcTanh[x/(1 + x^4)^(1/4)]/2 - ((1 + I*Sqrt[3]) 
*(-((I - Sqrt[3])/(I + Sqrt[3])))^(1/4)*ArcTanh[x/((-((I - Sqrt[3])/(I + S 
qrt[3])))^(1/4)*(1 + x^4)^(1/4))])/4 - ((-((I - Sqrt[3])/(I + Sqrt[3])))^( 
3/4)*ArcTanh[((-((I - Sqrt[3])/(I + Sqrt[3])))^(1/4)*x)/(1 + x^4)^(1/4)])/ 
2 + (((1 - I*Sqrt[3])/2)^(3/4)*ArcTanh[(2^(1/4)*(1 + x^4)^(1/4))/(1 - I*Sq 
rt[3])^(1/4)])/2 + (((1 + I*Sqrt[3])/2)^(3/4)*ArcTanh[(2^(1/4)*(1 + x^4)^( 
1/4))/(1 + I*Sqrt[3])^(1/4)])/2 - ((I/2)*Sqrt[-x^4]*EllipticPi[(-I - Sqrt[ 
3])/2, ArcSin[(1 + x^4)^(1/4)], -1])/x^2 + ((I/2)*Sqrt[-x^4]*EllipticPi[(I 
 - Sqrt[3])/2, ArcSin[(1 + x^4)^(1/4)], -1])/x^2 + ((I/2)*Sqrt[-x^4]*Ellip 
ticPi[1/Sqrt[(1 - I*Sqrt[3])/2], ArcSin[(1 + x^4)^(1/4)], -1])/x^2 - ((I/2 
)*Sqrt[-x^4]*EllipticPi[1/Sqrt[(1 + I*Sqrt[3])/2], ArcSin[(1 + x^4)^(1/4)] 
, -1])/x^2
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2027
Int[(Fx_.)*((a_.)*(x_)^(r_.) + (b_.)*(x_)^(s_.))^(p_.), x_Symbol] :> Int[x^ 
(p*r)*(a + b*x^(s - r))^p*Fx, x] /; FreeQ[{a, b, r, s}, x] && IntegerQ[p] & 
& PosQ[s - r] &&  !(EqQ[p, 1] && EqQ[u, 1])
 

rule 7279
Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[ 
{v = RationalFunctionExpand[u/(a + b*x^n + c*x^(2*n)), x]}, Int[v, x] /; Su 
mQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 6.86 (sec) , antiderivative size = 588, normalized size of antiderivative = 4.23

method result size
trager \(\text {Expression too large to display}\) \(588\)

Input:

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

Output:

1/4*ln(2*(x^4+1)^(3/4)*x+2*(x^4+1)^(1/2)*x^2+2*x^3*(x^4+1)^(1/4)+2*x^4+1)+ 
1/4*RootOf(_Z^2+1)*ln(-2*RootOf(_Z^2+1)*(x^4+1)^(3/4)*x+2*RootOf(_Z^2+1)*( 
x^4+1)^(1/4)*x^3-2*(x^4+1)^(1/2)*x^2+2*x^4+1)+1/2*RootOf(_Z^2+RootOf(_Z^2+ 
1))*ln((-(x^4+1)^(1/2)*RootOf(_Z^2+RootOf(_Z^2+1))*RootOf(_Z^2+1)*x^2+2*(x 
^4+1)^(1/2)*RootOf(_Z^2+RootOf(_Z^2+1))*RootOf(_Z^2+1)*x+RootOf(_Z^2+1)*(x 
^4+1)^(1/4)*x^3+(x^4+1)^(3/4)*x-(x^4+1)^(1/2)*RootOf(_Z^2+RootOf(_Z^2+1))* 
RootOf(_Z^2+1)-3*RootOf(_Z^2+1)*(x^4+1)^(1/4)*x^2-2*RootOf(_Z^2+RootOf(_Z^ 
2+1))*x^3-(x^4+1)^(3/4)+3*RootOf(_Z^2+1)*(x^4+1)^(1/4)*x+3*RootOf(_Z^2+Roo 
tOf(_Z^2+1))*x^2-RootOf(_Z^2+1)*(x^4+1)^(1/4)-2*RootOf(_Z^2+RootOf(_Z^2+1) 
)*x)/(x^2-x+1)^2)-1/2*RootOf(_Z^2+1)*RootOf(_Z^2+RootOf(_Z^2+1))*ln(((x^4+ 
1)^(1/2)*RootOf(_Z^2+RootOf(_Z^2+1))*x^2-RootOf(_Z^2+1)*(x^4+1)^(1/4)*x^3+ 
2*RootOf(_Z^2+RootOf(_Z^2+1))*RootOf(_Z^2+1)*x^3+(x^4+1)^(3/4)*x-2*(x^4+1) 
^(1/2)*RootOf(_Z^2+RootOf(_Z^2+1))*x+3*RootOf(_Z^2+1)*(x^4+1)^(1/4)*x^2-3* 
RootOf(_Z^2+RootOf(_Z^2+1))*RootOf(_Z^2+1)*x^2-(x^4+1)^(3/4)+(x^4+1)^(1/2) 
*RootOf(_Z^2+RootOf(_Z^2+1))-3*RootOf(_Z^2+1)*(x^4+1)^(1/4)*x+2*RootOf(_Z^ 
2+RootOf(_Z^2+1))*RootOf(_Z^2+1)*x+RootOf(_Z^2+1)*(x^4+1)^(1/4))/(x^2-x+1) 
^2)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (112) = 224\).

Time = 7.33 (sec) , antiderivative size = 656, normalized size of antiderivative = 4.72 \[ \int \frac {-2 x+x^2}{\left (1-x+x^2\right ) \sqrt [4]{1+x^4}} \, dx =\text {Too large to display} \] Input:

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

Output:

-1/4*sqrt(2)*arctan((x^8 - 4*x^7 + 10*x^6 - 16*x^5 + 19*x^4 - 16*x^3 + sqr 
t(2)*(x^5 - 7*x^4 + 15*x^3 - 15*x^2 + 7*x - 1)*(x^4 + 1)^(3/4) + 10*x^2 - 
sqrt(2)*(x^7 - x^6 - 6*x^5 + 16*x^4 - 16*x^3 + 6*x^2 + x - 1)*(x^4 + 1)^(1 
/4) + 2*(x^6 - 4*x^5 + 8*x^4 - 10*x^3 + 8*x^2 - 4*x + 1)*sqrt(x^4 + 1) - 4 
*x + 1)/(3*x^8 - 12*x^7 + 14*x^6 - 11*x^4 + 14*x^2 - 12*x + 3)) - 1/4*sqrt 
(2)*arctan(-(x^8 - 4*x^7 + 10*x^6 - 16*x^5 + 19*x^4 - 16*x^3 - sqrt(2)*(x^ 
5 - 7*x^4 + 15*x^3 - 15*x^2 + 7*x - 1)*(x^4 + 1)^(3/4) + 10*x^2 + sqrt(2)* 
(x^7 - x^6 - 6*x^5 + 16*x^4 - 16*x^3 + 6*x^2 + x - 1)*(x^4 + 1)^(1/4) + 2* 
(x^6 - 4*x^5 + 8*x^4 - 10*x^3 + 8*x^2 - 4*x + 1)*sqrt(x^4 + 1) - 4*x + 1)/ 
(3*x^8 - 12*x^7 + 14*x^6 - 11*x^4 + 14*x^2 - 12*x + 3)) - 1/8*sqrt(2)*log( 
(x^4 - 2*x^3 + sqrt(2)*(x^4 + 1)^(3/4)*(x - 1) + 3*x^2 + sqrt(2)*(x^4 + 1) 
^(1/4)*(x^3 - 3*x^2 + 3*x - 1) + 2*sqrt(x^4 + 1)*(x^2 - 2*x + 1) - 2*x + 1 
)/(x^4 - 2*x^3 + 3*x^2 - 2*x + 1)) + 1/8*sqrt(2)*log((x^4 - 2*x^3 - sqrt(2 
)*(x^4 + 1)^(3/4)*(x - 1) + 3*x^2 - sqrt(2)*(x^4 + 1)^(1/4)*(x^3 - 3*x^2 + 
 3*x - 1) + 2*sqrt(x^4 + 1)*(x^2 - 2*x + 1) - 2*x + 1)/(x^4 - 2*x^3 + 3*x^ 
2 - 2*x + 1)) + 1/4*arctan(2*(x^4 + 1)^(1/4)*x^3 + 2*(x^4 + 1)^(3/4)*x) + 
1/4*log(2*x^4 + 2*(x^4 + 1)^(1/4)*x^3 + 2*sqrt(x^4 + 1)*x^2 + 2*(x^4 + 1)^ 
(3/4)*x + 1)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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