Integrand size = 30, antiderivative size = 101 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=-\frac {1}{2} \sqrt {\frac {11}{5}+\frac {2 i}{5}} \arctan \left (\frac {\sqrt {1-2 i} \sqrt {-x-x^2+x^3}}{-1-x+x^2}\right )-\frac {1}{2} \sqrt {\frac {11}{5}-\frac {2 i}{5}} \arctan \left (\frac {\sqrt {1+2 i} \sqrt {-x-x^2+x^3}}{-1-x+x^2}\right ) \]
-1/10*(55+10*I)^(1/2)*arctan((1-2*I)^(1/2)*(x^3-x^2-x)^(1/2)/(x^2-x-1))-1/ 10*(55-10*I)^(1/2)*arctan((1+2*I)^(1/2)*(x^3-x^2-x)^(1/2)/(x^2-x-1))
Time = 0.45 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.08 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=-\frac {\sqrt {x} \sqrt {-1-x+x^2} \left (\sqrt {11+2 i} \arctan \left (\frac {\sqrt {1-2 i} \sqrt {x}}{\sqrt {-1-x+x^2}}\right )+\sqrt {11-2 i} \arctan \left (\frac {\sqrt {1+2 i} \sqrt {x}}{\sqrt {-1-x+x^2}}\right )\right )}{2 \sqrt {5} \sqrt {x \left (-1-x+x^2\right )}} \]
-1/2*(Sqrt[x]*Sqrt[-1 - x + x^2]*(Sqrt[11 + 2*I]*ArcTan[(Sqrt[1 - 2*I]*Sqr t[x])/Sqrt[-1 - x + x^2]] + Sqrt[11 - 2*I]*ArcTan[(Sqrt[1 + 2*I]*Sqrt[x])/ Sqrt[-1 - x + x^2]]))/(Sqrt[5]*Sqrt[x*(-1 - x + x^2)])
Time = 0.83 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.17, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2467, 25, 2035, 7276, 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+x-1}{\left (x^2+1\right ) \sqrt {x^3-x^2-x}} \, dx\) |
\(\Big \downarrow \) 2467 |
\(\displaystyle \frac {\sqrt {x} \sqrt {x^2-x-1} \int -\frac {-x^2-x+1}{\sqrt {x} \left (x^2+1\right ) \sqrt {x^2-x-1}}dx}{\sqrt {x^3-x^2-x}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\sqrt {x} \sqrt {x^2-x-1} \int \frac {-x^2-x+1}{\sqrt {x} \left (x^2+1\right ) \sqrt {x^2-x-1}}dx}{\sqrt {x^3-x^2-x}}\) |
\(\Big \downarrow \) 2035 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {x^2-x-1} \int \frac {-x^2-x+1}{\left (x^2+1\right ) \sqrt {x^2-x-1}}d\sqrt {x}}{\sqrt {x^3-x^2-x}}\) |
\(\Big \downarrow \) 7276 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {x^2-x-1} \int \left (\frac {2-x}{\left (x^2+1\right ) \sqrt {x^2-x-1}}-\frac {1}{\sqrt {x^2-x-1}}\right )d\sqrt {x}}{\sqrt {x^3-x^2-x}}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 \sqrt {x} \sqrt {x^2-x-1} \left (\left (\frac {1}{5}+\frac {3 i}{20}\right ) \sqrt {1-2 i} \arctan \left (\frac {\sqrt {1-2 i} \sqrt {x}}{\sqrt {x^2-x-1}}\right )+\frac {\left (\frac {1}{2}+\frac {i}{4}\right ) \arctan \left (\frac {\sqrt {1+2 i} \sqrt {x}}{\sqrt {x^2-x-1}}\right )}{\sqrt {1+2 i}}\right )}{\sqrt {x^3-x^2-x}}\) |
(-2*Sqrt[x]*Sqrt[-1 - x + x^2]*((1/5 + (3*I)/20)*Sqrt[1 - 2*I]*ArcTan[(Sqr t[1 - 2*I]*Sqrt[x])/Sqrt[-1 - x + x^2]] + ((1/2 + I/4)*ArcTan[(Sqrt[1 + 2* I]*Sqrt[x])/Sqrt[-1 - x + x^2]])/Sqrt[1 + 2*I]))/Sqrt[-x - x^2 + x^3]
3.15.11.3.1 Defintions of rubi rules used
Int[(Fx_)*(x_)^(m_), x_Symbol] :> With[{k = Denominator[m]}, Simp[k Subst [Int[x^(k*(m + 1) - 1)*SubstPower[Fx, x, k], x], x, x^(1/k)], x]] /; Fracti onQ[m] && AlgebraicFunctionQ[Fx, x]
Int[(Fx_.)*(Px_)^(p_), x_Symbol] :> With[{r = Expon[Px, x, Min]}, Simp[Px^F racPart[p]/(x^(r*FracPart[p])*ExpandToSum[Px/x^r, x]^FracPart[p]) Int[x^( p*r)*ExpandToSum[Px/x^r, x]^p*Fx, x], x] /; IGtQ[r, 0]] /; FreeQ[p, x] && P olyQ[Px, x] && !IntegerQ[p] && !MonomialQ[Px, x] && !PolyQ[Fx, x]
Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionE xpand[u/(a + b*x^n), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ [n, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(197\) vs. \(2(77)=154\).
Time = 1.49 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.96
method | result | size |
default | \(-\frac {3 \left (\left (-\sqrt {5}+\frac {5}{3}\right ) \ln \left (\frac {-\sqrt {x \left (x^{2}-x -1\right )}\, \sqrt {-2+2 \sqrt {5}}+x \sqrt {5}+x^{2}-x -1}{x}\right )+\left (\sqrt {5}-\frac {5}{3}\right ) \ln \left (\frac {\sqrt {x \left (x^{2}-x -1\right )}\, \sqrt {-2+2 \sqrt {5}}+x \sqrt {5}+x^{2}-x -1}{x}\right )+\frac {8 \left (\arctan \left (\frac {\sqrt {-2+2 \sqrt {5}}\, x -2 \sqrt {x \left (x^{2}-x -1\right )}}{x \sqrt {2+2 \sqrt {5}}}\right )-\arctan \left (\frac {\sqrt {-2+2 \sqrt {5}}\, x +2 \sqrt {x \left (x^{2}-x -1\right )}}{x \sqrt {2+2 \sqrt {5}}}\right )\right ) \left (\sqrt {5}+\frac {5}{2}\right )}{3}\right )}{20 \sqrt {2+2 \sqrt {5}}}\) | \(198\) |
pseudoelliptic | \(-\frac {3 \left (\left (-\sqrt {5}+\frac {5}{3}\right ) \ln \left (\frac {-\sqrt {x \left (x^{2}-x -1\right )}\, \sqrt {-2+2 \sqrt {5}}+x \sqrt {5}+x^{2}-x -1}{x}\right )+\left (\sqrt {5}-\frac {5}{3}\right ) \ln \left (\frac {\sqrt {x \left (x^{2}-x -1\right )}\, \sqrt {-2+2 \sqrt {5}}+x \sqrt {5}+x^{2}-x -1}{x}\right )+\frac {8 \left (\arctan \left (\frac {\sqrt {-2+2 \sqrt {5}}\, x -2 \sqrt {x \left (x^{2}-x -1\right )}}{x \sqrt {2+2 \sqrt {5}}}\right )-\arctan \left (\frac {\sqrt {-2+2 \sqrt {5}}\, x +2 \sqrt {x \left (x^{2}-x -1\right )}}{x \sqrt {2+2 \sqrt {5}}}\right )\right ) \left (\sqrt {5}+\frac {5}{2}\right )}{3}\right )}{20 \sqrt {2+2 \sqrt {5}}}\) | \(198\) |
elliptic | \(\text {Expression too large to display}\) | \(1491\) |
-3/20/(2+2*5^(1/2))^(1/2)*((-5^(1/2)+5/3)*ln((-(x*(x^2-x-1))^(1/2)*(-2+2*5 ^(1/2))^(1/2)+x*5^(1/2)+x^2-x-1)/x)+(5^(1/2)-5/3)*ln(((x*(x^2-x-1))^(1/2)* (-2+2*5^(1/2))^(1/2)+x*5^(1/2)+x^2-x-1)/x)+8/3*(arctan(((-2+2*5^(1/2))^(1/ 2)*x-2*(x*(x^2-x-1))^(1/2))/x/(2+2*5^(1/2))^(1/2))-arctan(((-2+2*5^(1/2))^ (1/2)*x+2*(x*(x^2-x-1))^(1/2))/x/(2+2*5^(1/2))^(1/2)))*(5^(1/2)+5/2))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 297 vs. \(2 (69) = 138\).
Time = 0.30 (sec) , antiderivative size = 297, normalized size of antiderivative = 2.94 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=-\frac {1}{40} \, \sqrt {5} \sqrt {-2 i - 11} \log \left (\frac {25 \, x^{4} + \left (100 i - 50\right ) \, x^{3} - 2 \, \sqrt {5} \sqrt {-2 i - 11} \sqrt {x^{3} - x^{2} - x} {\left (-\left (3 i - 4\right ) \, x^{2} + \left (8 i + 6\right ) \, x + 3 i - 4\right )} - \left (100 i + 150\right ) \, x^{2} - \left (100 i - 50\right ) \, x + 25}{x^{4} + 2 \, x^{2} + 1}\right ) + \frac {1}{40} \, \sqrt {5} \sqrt {-2 i - 11} \log \left (\frac {25 \, x^{4} + \left (100 i - 50\right ) \, x^{3} - 2 \, \sqrt {5} \sqrt {-2 i - 11} \sqrt {x^{3} - x^{2} - x} {\left (\left (3 i - 4\right ) \, x^{2} - \left (8 i + 6\right ) \, x - 3 i + 4\right )} - \left (100 i + 150\right ) \, x^{2} - \left (100 i - 50\right ) \, x + 25}{x^{4} + 2 \, x^{2} + 1}\right ) - \frac {1}{40} \, \sqrt {5} \sqrt {2 i - 11} \log \left (\frac {25 \, x^{4} - \left (100 i + 50\right ) \, x^{3} - 2 \, \sqrt {5} \sqrt {2 i - 11} \sqrt {x^{3} - x^{2} - x} {\left (\left (3 i + 4\right ) \, x^{2} - \left (8 i - 6\right ) \, x - 3 i - 4\right )} + \left (100 i - 150\right ) \, x^{2} + \left (100 i + 50\right ) \, x + 25}{x^{4} + 2 \, x^{2} + 1}\right ) + \frac {1}{40} \, \sqrt {5} \sqrt {2 i - 11} \log \left (\frac {25 \, x^{4} - \left (100 i + 50\right ) \, x^{3} - 2 \, \sqrt {5} \sqrt {2 i - 11} \sqrt {x^{3} - x^{2} - x} {\left (-\left (3 i + 4\right ) \, x^{2} + \left (8 i - 6\right ) \, x + 3 i + 4\right )} + \left (100 i - 150\right ) \, x^{2} + \left (100 i + 50\right ) \, x + 25}{x^{4} + 2 \, x^{2} + 1}\right ) \]
-1/40*sqrt(5)*sqrt(-2*I - 11)*log((25*x^4 + (100*I - 50)*x^3 - 2*sqrt(5)*s qrt(-2*I - 11)*sqrt(x^3 - x^2 - x)*(-(3*I - 4)*x^2 + (8*I + 6)*x + 3*I - 4 ) - (100*I + 150)*x^2 - (100*I - 50)*x + 25)/(x^4 + 2*x^2 + 1)) + 1/40*sqr t(5)*sqrt(-2*I - 11)*log((25*x^4 + (100*I - 50)*x^3 - 2*sqrt(5)*sqrt(-2*I - 11)*sqrt(x^3 - x^2 - x)*((3*I - 4)*x^2 - (8*I + 6)*x - 3*I + 4) - (100*I + 150)*x^2 - (100*I - 50)*x + 25)/(x^4 + 2*x^2 + 1)) - 1/40*sqrt(5)*sqrt( 2*I - 11)*log((25*x^4 - (100*I + 50)*x^3 - 2*sqrt(5)*sqrt(2*I - 11)*sqrt(x ^3 - x^2 - x)*((3*I + 4)*x^2 - (8*I - 6)*x - 3*I - 4) + (100*I - 150)*x^2 + (100*I + 50)*x + 25)/(x^4 + 2*x^2 + 1)) + 1/40*sqrt(5)*sqrt(2*I - 11)*lo g((25*x^4 - (100*I + 50)*x^3 - 2*sqrt(5)*sqrt(2*I - 11)*sqrt(x^3 - x^2 - x )*(-(3*I + 4)*x^2 + (8*I - 6)*x + 3*I + 4) + (100*I - 150)*x^2 + (100*I + 50)*x + 25)/(x^4 + 2*x^2 + 1))
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=\int \frac {x^{2} + x - 1}{\sqrt {x \left (x^{2} - x - 1\right )} \left (x^{2} + 1\right )}\, dx \]
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=\int { \frac {x^{2} + x - 1}{\sqrt {x^{3} - x^{2} - x} {\left (x^{2} + 1\right )}} \,d x } \]
\[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=\int { \frac {x^{2} + x - 1}{\sqrt {x^{3} - x^{2} - x} {\left (x^{2} + 1\right )}} \,d x } \]
Time = 0.08 (sec) , antiderivative size = 226, normalized size of antiderivative = 2.24 \[ \int \frac {-1+x+x^2}{\left (1+x^2\right ) \sqrt {-x-x^2+x^3}} \, dx=\frac {\left (\sqrt {5}\,\left (2+1{}\mathrm {i}\right )+2+1{}\mathrm {i}\right )\,\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\,\sqrt {\frac {x+\frac {\sqrt {5}}{2}-\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}}\,\sqrt {\frac {\frac {\sqrt {5}}{2}-x+\frac {1}{2}}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\,\left (-2\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )+\Pi \left (-\frac {\sqrt {5}\,1{}\mathrm {i}}{2}-\frac {1}{2}{}\mathrm {i};\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )\,\left (2-\mathrm {i}\right )+\Pi \left (\frac {\sqrt {5}\,1{}\mathrm {i}}{2}+\frac {1}{2}{}\mathrm {i};\mathrm {asin}\left (\sqrt {\frac {x}{\frac {\sqrt {5}}{2}+\frac {1}{2}}}\right )\middle |-\frac {\frac {\sqrt {5}}{2}+\frac {1}{2}}{\frac {\sqrt {5}}{2}-\frac {1}{2}}\right )\,\left (2+1{}\mathrm {i}\right )\right )\,\left (-\frac {1}{5}+\frac {1}{10}{}\mathrm {i}\right )}{\sqrt {x^3-x^2-\left (\frac {\sqrt {5}}{2}-\frac {1}{2}\right )\,\left (\frac {\sqrt {5}}{2}+\frac {1}{2}\right )\,x}} \]
((5^(1/2)*(2 + 1i) + (2 + 1i))*(x/(5^(1/2)/2 + 1/2))^(1/2)*((x + 5^(1/2)/2 - 1/2)/(5^(1/2)/2 - 1/2))^(1/2)*((5^(1/2)/2 - x + 1/2)/(5^(1/2)/2 + 1/2)) ^(1/2)*(ellipticPi(- (5^(1/2)*1i)/2 - 1i/2, asin((x/(5^(1/2)/2 + 1/2))^(1/ 2)), -(5^(1/2)/2 + 1/2)/(5^(1/2)/2 - 1/2))*(2 - 1i) - 2*ellipticF(asin((x/ (5^(1/2)/2 + 1/2))^(1/2)), -(5^(1/2)/2 + 1/2)/(5^(1/2)/2 - 1/2)) + ellipti cPi((5^(1/2)*1i)/2 + 1i/2, asin((x/(5^(1/2)/2 + 1/2))^(1/2)), -(5^(1/2)/2 + 1/2)/(5^(1/2)/2 - 1/2))*(2 + 1i))*(- 1/5 + 1i/10))/(x^3 - x^2 - x*(5^(1/ 2)/2 - 1/2)*(5^(1/2)/2 + 1/2))^(1/2)