Integrand size = 41, antiderivative size = 99 \[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\sqrt {\frac {1}{5}-\frac {3 i}{5}} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}}}{\sqrt {-1-3 i}}\right )+\sqrt {\frac {1}{5}+\frac {3 i}{5}} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}}}{\sqrt {-1+3 i}}\right ) \]
1/5*(5-15*I)^(1/2)*arctan(2^(1/2)*((2*x^2-x-2)/(x^2+x-1))^(1/2)/(-1-3*I)^( 1/2))+1/5*(5+15*I)^(1/2)*arctan(2^(1/2)*((2*x^2-x-2)/(x^2+x-1))^(1/2)/(-1+ 3*I)^(1/2))
Time = 3.08 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.38 \[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\frac {\left (2+x-2 x^2\right )^{3/2} \left (\sqrt {-1+3 i} \arctan \left (\frac {\sqrt {\frac {1}{5}-\frac {3 i}{5}} \sqrt {2+x-2 x^2}}{\sqrt {-1+x+x^2}}\right )+\sqrt {-1-3 i} \arctan \left (\frac {\sqrt {\frac {1}{5}+\frac {3 i}{5}} \sqrt {2+x-2 x^2}}{\sqrt {-1+x+x^2}}\right )\right )}{\sqrt {5} \left (-\frac {2+x-2 x^2}{-1+x+x^2}\right )^{3/2} \left (-1+x+x^2\right )^{3/2}} \]
((2 + x - 2*x^2)^(3/2)*(Sqrt[-1 + 3*I]*ArcTan[(Sqrt[1/5 - (3*I)/5]*Sqrt[2 + x - 2*x^2])/Sqrt[-1 + x + x^2]] + Sqrt[-1 - 3*I]*ArcTan[(Sqrt[1/5 + (3*I )/5]*Sqrt[2 + x - 2*x^2])/Sqrt[-1 + x + x^2]]))/(Sqrt[5]*(-((2 + x - 2*x^2 )/(-1 + x + x^2)))^(3/2)*(-1 + x + x^2)^(3/2))
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+1}{\sqrt {\frac {2 x^2-x-2}{x^2+x-1}} \left (x^4-x^2+1\right )} \, dx\) |
\(\Big \downarrow \) 7270 |
\(\displaystyle \frac {\sqrt {2 x^2-x-2} \int \frac {\left (x^2+1\right ) \sqrt {x^2+x-1}}{\sqrt {2 x^2-x-2} \left (x^4-x^2+1\right )}dx}{\sqrt {\frac {-2 x^2+x+2}{-x^2-x+1}} \sqrt {x^2+x-1}}\) |
\(\Big \downarrow \) 7279 |
\(\displaystyle \frac {\sqrt {2 x^2-x-2} \int \left (\frac {\left (1-i \sqrt {3}\right ) \sqrt {x^2+x-1}}{\left (2 x^2-i \sqrt {3}-1\right ) \sqrt {2 x^2-x-2}}+\frac {\left (1+i \sqrt {3}\right ) \sqrt {x^2+x-1}}{\left (2 x^2+i \sqrt {3}-1\right ) \sqrt {2 x^2-x-2}}\right )dx}{\sqrt {\frac {-2 x^2+x+2}{-x^2-x+1}} \sqrt {x^2+x-1}}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\sqrt {2 x^2-x-2} \left (-\frac {\left (1+i \sqrt {3}\right ) \int \frac {\sqrt {x^2+x-1}}{\left (\sqrt {1-i \sqrt {3}}-\sqrt {2} x\right ) \sqrt {2 x^2-x-2}}dx}{2 \sqrt {1-i \sqrt {3}}}-\frac {\left (1-i \sqrt {3}\right ) \int \frac {\sqrt {x^2+x-1}}{\left (\sqrt {1+i \sqrt {3}}-\sqrt {2} x\right ) \sqrt {2 x^2-x-2}}dx}{2 \sqrt {1+i \sqrt {3}}}-\frac {\left (1+i \sqrt {3}\right ) \int \frac {\sqrt {x^2+x-1}}{\left (\sqrt {2} x+\sqrt {1-i \sqrt {3}}\right ) \sqrt {2 x^2-x-2}}dx}{2 \sqrt {1-i \sqrt {3}}}-\frac {\left (1-i \sqrt {3}\right ) \int \frac {\sqrt {x^2+x-1}}{\left (\sqrt {2} x+\sqrt {1+i \sqrt {3}}\right ) \sqrt {2 x^2-x-2}}dx}{2 \sqrt {1+i \sqrt {3}}}\right )}{\sqrt {\frac {-2 x^2+x+2}{-x^2-x+1}} \sqrt {x^2+x-1}}\) |
3.14.76.3.1 Defintions of rubi rules used
Int[(u_.)*((a_.)*(v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> Simp[a^IntPart[p ]*((a*v^m*w^n)^FracPart[p]/(v^(m*FracPart[p])*w^(n*FracPart[p]))) Int[u*v ^(m*p)*w^(n*p), x], x] /; FreeQ[{a, m, n, p}, x] && !IntegerQ[p] && !Free Q[v, x] && !FreeQ[w, x]
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]
Leaf count of result is larger than twice the leaf count of optimal. \(675\) vs. \(2(77)=154\).
Time = 30.75 (sec) , antiderivative size = 676, normalized size of antiderivative = 6.83
method | result | size |
default | \(-\frac {\left (2 x^{2}-x -2\right ) \left (\sqrt {10 \sqrt {5}\, \sqrt {2}+26}\, \sqrt {5}\, \sqrt {2}\, \arctan \left (\frac {\sqrt {5}\, \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{\left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )^{2}}}\, \sqrt {10 \sqrt {5}\, \sqrt {2}+26}\, \left (2 \sqrt {5}\, \sqrt {2}+11\right ) \left (-\sqrt {2}\, x^{2}+2 x \sqrt {5}+3 x \sqrt {2}+\sqrt {2}\right ) \left (13 \sqrt {5}\, \sqrt {2}-40\right ) \left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )}{1620 \left (x^{2}+x -1\right ) \left (2 x^{2}-x -2\right )}\right )-10 \,\operatorname {arctanh}\left (\frac {2 \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{\left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )^{2}}}}{\sqrt {\sqrt {5}\, \sqrt {2}+3}}\right ) \sqrt {5}\, \sqrt {\sqrt {5}\, \sqrt {2}+3}+14 \,\operatorname {arctanh}\left (\frac {2 \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{\left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )^{2}}}}{\sqrt {\sqrt {5}\, \sqrt {2}+3}}\right ) \sqrt {2}\, \sqrt {\sqrt {5}\, \sqrt {2}+3}-2 \arctan \left (\frac {\sqrt {5}\, \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{\left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )^{2}}}\, \sqrt {10 \sqrt {5}\, \sqrt {2}+26}\, \left (2 \sqrt {5}\, \sqrt {2}+11\right ) \left (-\sqrt {2}\, x^{2}+2 x \sqrt {5}+3 x \sqrt {2}+\sqrt {2}\right ) \left (13 \sqrt {5}\, \sqrt {2}-40\right ) \left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )}{1620 \left (x^{2}+x -1\right ) \left (2 x^{2}-x -2\right )}\right ) \sqrt {10 \sqrt {5}\, \sqrt {2}+26}\right ) \left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right ) \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{\left (\sqrt {2}\, x^{2}+2 x \sqrt {5}-3 x \sqrt {2}-\sqrt {2}\right )^{2}}}}{2 \sqrt {\frac {2 x^{2}-x -2}{x^{2}+x -1}}\, \sqrt {\left (x^{2}+x -1\right ) \left (2 x^{2}-x -2\right )}\, \sqrt {\frac {2 x^{4}+x^{3}-5 x^{2}-x +2}{x^{2}}}\, \left (13 \sqrt {5}\, \sqrt {2}-40\right ) \left (\sqrt {5}\, \sqrt {2}+3\right ) x}\) | \(676\) |
trager | \(\text {Expression too large to display}\) | \(840\) |
-1/2*(2*x^2-x-2)*((10*5^(1/2)*2^(1/2)+26)^(1/2)*5^(1/2)*2^(1/2)*arctan(1/1 620*5^(1/2)*((2*x^4+x^3-5*x^2-x+2)/(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^ (1/2))^2)^(1/2)*(10*5^(1/2)*2^(1/2)+26)^(1/2)*(2*5^(1/2)*2^(1/2)+11)*(-2^( 1/2)*x^2+2*x*5^(1/2)+3*x*2^(1/2)+2^(1/2))*(13*5^(1/2)*2^(1/2)-40)*(2^(1/2) *x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))/(x^2+x-1)/(2*x^2-x-2))-10*arctanh(2* ((2*x^4+x^3-5*x^2-x+2)/(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))^2)^(1 /2)/(5^(1/2)*2^(1/2)+3)^(1/2))*5^(1/2)*(5^(1/2)*2^(1/2)+3)^(1/2)+14*arctan h(2*((2*x^4+x^3-5*x^2-x+2)/(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))^2 )^(1/2)/(5^(1/2)*2^(1/2)+3)^(1/2))*2^(1/2)*(5^(1/2)*2^(1/2)+3)^(1/2)-2*arc tan(1/1620*5^(1/2)*((2*x^4+x^3-5*x^2-x+2)/(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^( 1/2)-2^(1/2))^2)^(1/2)*(10*5^(1/2)*2^(1/2)+26)^(1/2)*(2*5^(1/2)*2^(1/2)+11 )*(-2^(1/2)*x^2+2*x*5^(1/2)+3*x*2^(1/2)+2^(1/2))*(13*5^(1/2)*2^(1/2)-40)*( 2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))/(x^2+x-1)/(2*x^2-x-2))*(10*5^ (1/2)*2^(1/2)+26)^(1/2))*(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))*((2 *x^4+x^3-5*x^2-x+2)/(2^(1/2)*x^2+2*x*5^(1/2)-3*x*2^(1/2)-2^(1/2))^2)^(1/2) /((2*x^2-x-2)/(x^2+x-1))^(1/2)/((x^2+x-1)*(2*x^2-x-2))^(1/2)/((2*x^4+x^3-5 *x^2-x+2)/x^2)^(1/2)/(13*5^(1/2)*2^(1/2)-40)/(5^(1/2)*2^(1/2)+3)/x
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 373 vs. \(2 (69) = 138\).
Time = 0.37 (sec) , antiderivative size = 373, normalized size of antiderivative = 3.77 \[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=-\frac {1}{20} \, \sqrt {5} \sqrt {-3 i - 1} \log \left (\frac {\sqrt {5} \sqrt {-3 i - 1} {\left (\left (459 i + 187\right ) \, x^{4} - \left (232 i - 724\right ) \, x^{3} - \left (1183 i + 419\right ) \, x^{2} + \left (232 i - 724\right ) \, x + 459 i + 187\right )} - 20 \, {\left (\left (13 i + 84\right ) \, x^{4} - \left (71 i - 97\right ) \, x^{3} - \left (110 i + 155\right ) \, x^{2} + \left (71 i - 97\right ) \, x + 13 i + 84\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}}{x^{4} - x^{2} + 1}\right ) - \frac {1}{20} \, \sqrt {5} \sqrt {3 i - 1} \log \left (\frac {\sqrt {5} \sqrt {3 i - 1} {\left (-\left (459 i - 187\right ) \, x^{4} + \left (232 i + 724\right ) \, x^{3} + \left (1183 i - 419\right ) \, x^{2} - \left (232 i + 724\right ) \, x - 459 i + 187\right )} - 20 \, {\left (-\left (13 i - 84\right ) \, x^{4} + \left (71 i + 97\right ) \, x^{3} + \left (110 i - 155\right ) \, x^{2} - \left (71 i + 97\right ) \, x - 13 i + 84\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}}{x^{4} - x^{2} + 1}\right ) + \frac {1}{20} \, \sqrt {5} \sqrt {3 i - 1} \log \left (\frac {\sqrt {5} \sqrt {3 i - 1} {\left (\left (459 i - 187\right ) \, x^{4} - \left (232 i + 724\right ) \, x^{3} - \left (1183 i - 419\right ) \, x^{2} + \left (232 i + 724\right ) \, x + 459 i - 187\right )} - 20 \, {\left (-\left (13 i - 84\right ) \, x^{4} + \left (71 i + 97\right ) \, x^{3} + \left (110 i - 155\right ) \, x^{2} - \left (71 i + 97\right ) \, x - 13 i + 84\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}}{x^{4} - x^{2} + 1}\right ) + \frac {1}{20} \, \sqrt {5} \sqrt {-3 i - 1} \log \left (\frac {\sqrt {5} \sqrt {-3 i - 1} {\left (-\left (459 i + 187\right ) \, x^{4} + \left (232 i - 724\right ) \, x^{3} + \left (1183 i + 419\right ) \, x^{2} - \left (232 i - 724\right ) \, x - 459 i - 187\right )} - 20 \, {\left (\left (13 i + 84\right ) \, x^{4} - \left (71 i - 97\right ) \, x^{3} - \left (110 i + 155\right ) \, x^{2} + \left (71 i - 97\right ) \, x + 13 i + 84\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}}{x^{4} - x^{2} + 1}\right ) \]
-1/20*sqrt(5)*sqrt(-3*I - 1)*log((sqrt(5)*sqrt(-3*I - 1)*((459*I + 187)*x^ 4 - (232*I - 724)*x^3 - (1183*I + 419)*x^2 + (232*I - 724)*x + 459*I + 187 ) - 20*((13*I + 84)*x^4 - (71*I - 97)*x^3 - (110*I + 155)*x^2 + (71*I - 97 )*x + 13*I + 84)*sqrt((2*x^2 - x - 2)/(x^2 + x - 1)))/(x^4 - x^2 + 1)) - 1 /20*sqrt(5)*sqrt(3*I - 1)*log((sqrt(5)*sqrt(3*I - 1)*(-(459*I - 187)*x^4 + (232*I + 724)*x^3 + (1183*I - 419)*x^2 - (232*I + 724)*x - 459*I + 187) - 20*(-(13*I - 84)*x^4 + (71*I + 97)*x^3 + (110*I - 155)*x^2 - (71*I + 97)* x - 13*I + 84)*sqrt((2*x^2 - x - 2)/(x^2 + x - 1)))/(x^4 - x^2 + 1)) + 1/2 0*sqrt(5)*sqrt(3*I - 1)*log((sqrt(5)*sqrt(3*I - 1)*((459*I - 187)*x^4 - (2 32*I + 724)*x^3 - (1183*I - 419)*x^2 + (232*I + 724)*x + 459*I - 187) - 20 *(-(13*I - 84)*x^4 + (71*I + 97)*x^3 + (110*I - 155)*x^2 - (71*I + 97)*x - 13*I + 84)*sqrt((2*x^2 - x - 2)/(x^2 + x - 1)))/(x^4 - x^2 + 1)) + 1/20*s qrt(5)*sqrt(-3*I - 1)*log((sqrt(5)*sqrt(-3*I - 1)*(-(459*I + 187)*x^4 + (2 32*I - 724)*x^3 + (1183*I + 419)*x^2 - (232*I - 724)*x - 459*I - 187) - 20 *((13*I + 84)*x^4 - (71*I - 97)*x^3 - (110*I + 155)*x^2 + (71*I - 97)*x + 13*I + 84)*sqrt((2*x^2 - x - 2)/(x^2 + x - 1)))/(x^4 - x^2 + 1))
Timed out. \[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\text {Timed out} \]
\[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\int { \frac {x^{2} + 1}{{\left (x^{4} - x^{2} + 1\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}} \,d x } \]
\[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\int { \frac {x^{2} + 1}{{\left (x^{4} - x^{2} + 1\right )} \sqrt {\frac {2 \, x^{2} - x - 2}{x^{2} + x - 1}}} \,d x } \]
Timed out. \[ \int \frac {1+x^2}{\sqrt {\frac {-2-x+2 x^2}{-1+x+x^2}} \left (1-x^2+x^4\right )} \, dx=\int \frac {x^2+1}{\sqrt {-\frac {-2\,x^2+x+2}{x^2+x-1}}\,\left (x^4-x^2+1\right )} \,d x \]