Integrand size = 40, antiderivative size = 71 \[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\frac {\log \left (\frac {-a^2+2 \left (-a+a^2\right ) x+x^2-2 a \sqrt {-\left (\left (-2 a+a^2\right ) x\right )+\left (-1-2 a+a^2\right ) x^2+x^3}}{a^2-2 a x+x^2}\right )}{a} \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 1.06 (sec) , antiderivative size = 529, normalized size of antiderivative = 7.45, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2081, 6865, 1722, 1117, 1720} \[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\frac {2 (1-a) \sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \arctan \left (\frac {\sqrt {-a^2+2 a-1} \sqrt {x}}{\sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}}\right )}{a \sqrt {-a^2+2 a-1} \sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}+\frac {((2-a) a)^{3/4} \sqrt {x} \left (\frac {x}{\sqrt {(2-a) a}}+1\right ) \sqrt {\frac {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}{(2-a) a \left (\frac {x}{\sqrt {(2-a) a}}+1\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{(2-a) a}}\right ),\frac {1}{4} \left (\frac {-a^2+2 a+1}{\sqrt {(2-a) a}}+2\right )\right )}{a \sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}+\frac {(2-a) \left (1-\sqrt {(2-a) a}\right ) \sqrt {x} \left (\frac {x}{\sqrt {(2-a) a}}+1\right ) \sqrt {\frac {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}{(2-a) a \left (\frac {x}{\sqrt {(2-a) a}}+1\right )^2}} \operatorname {EllipticPi}\left (\frac {\left (\sqrt {2-a}+\sqrt {a}\right )^2}{4 \sqrt {(2-a) a}},2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{(2-a) a}}\right ),\frac {1}{4} \left (\frac {-a^2+2 a+1}{\sqrt {(2-a) a}}+2\right )\right )}{((2-a) a)^{3/4} \sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}} \]
[In]
[Out]
Rule 1117
Rule 1720
Rule 1722
Rule 2081
Rule 6865
Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x+x^2}\right ) \int \frac {-2+a+x}{\sqrt {x} (-a+x) \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x+x^2}} \, dx}{\sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x+x^2}\right ) \text {Subst}\left (\int \frac {-2+a+x^2}{\left (-a+x^2\right ) \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \\ & = \frac {\left (2 \sqrt {(2-a) a} \sqrt {x} \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x+x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x^2+x^4}} \, dx,x,\sqrt {x}\right )}{a \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}}+\frac {\left (2 \left (1-\frac {\sqrt {a}}{\sqrt {2-a}}\right ) (2-2 a) (2-a) a \sqrt {x} \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x+x^2}\right ) \text {Subst}\left (\int \frac {1+\frac {x^2}{\sqrt {2-a} \sqrt {a}}}{\left (-a+x^2\right ) \sqrt {(2-a) a+\left (-1-2 a+a^2\right ) x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\left (-((2-a) a)+a^2\right ) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \\ & = \frac {2 (1-a) \sqrt {x} \sqrt {(2-a) a-\left (1+2 a-a^2\right ) x+x^2} \arctan \left (\frac {\sqrt {-1+2 a-a^2} \sqrt {x}}{\sqrt {(2-a) a-\left (1+2 a-a^2\right ) x+x^2}}\right )}{a \sqrt {-1+2 a-a^2} \sqrt {(2-a) a x-\left (1+2 a-a^2\right ) x^2+x^3}}+\frac {((2-a) a)^{3/4} \sqrt {x} \left (1+\frac {x}{\sqrt {(2-a) a}}\right ) \sqrt {\frac {(2-a) a-\left (1+2 a-a^2\right ) x+x^2}{(2-a) a \left (1+\frac {x}{\sqrt {(2-a) a}}\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{(2-a) a}}\right ),\frac {1}{4} \left (2+\frac {1+2 a-a^2}{\sqrt {(2-a) a}}\right )\right )}{a \sqrt {(2-a) a x-\left (1+2 a-a^2\right ) x^2+x^3}}+\frac {\sqrt [4]{(2-a) a} \left (1-\sqrt {(2-a) a}\right ) \sqrt {x} \left (1+\frac {x}{\sqrt {(2-a) a}}\right ) \sqrt {\frac {(2-a) a-\left (1+2 a-a^2\right ) x+x^2}{(2-a) a \left (1+\frac {x}{\sqrt {(2-a) a}}\right )^2}} \operatorname {EllipticPi}\left (\frac {\left (\sqrt {2-a}+\sqrt {a}\right )^2}{4 \sqrt {(2-a) a}},2 \arctan \left (\frac {\sqrt {x}}{\sqrt [4]{(2-a) a}}\right ),\frac {1}{4} \left (2+\frac {1+2 a-a^2}{\sqrt {(2-a) a}}\right )\right )}{a \sqrt {(2-a) a x-\left (1+2 a-a^2\right ) x^2+x^3}} \\ \end{align*}
Time = 10.37 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.65 \[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=-\frac {2 \text {arctanh}\left (\frac {\sqrt {\left (2 a-a^2\right ) x+\left (-1-2 a+a^2\right ) x^2+x^3}}{a (-1+x)}\right )}{a} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 1.
Time = 0.51 (sec) , antiderivative size = 317, normalized size of antiderivative = 4.46
method | result | size |
default | \(\frac {2 \left (a^{2}-2 a \right ) \sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}\, \sqrt {\frac {-1+x}{-a^{2}+2 a -1}}\, \sqrt {\frac {x}{-a^{2}+2 a}}\, F\left (\sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}, \sqrt {\frac {-a^{2}+2 a}{-a^{2}+2 a -1}}\right )}{\sqrt {a^{2} x^{2}-a^{2} x -2 a \,x^{2}+x^{3}+2 a x -x^{2}}}-\frac {2 \left (-2 a +2\right ) \left (a^{2}-2 a \right ) \sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}\, \sqrt {\frac {-1+x}{-a^{2}+2 a -1}}\, \sqrt {\frac {x}{-a^{2}+2 a}}\, \Pi \left (\sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}, \frac {-a^{2}+2 a}{-a^{2}+a}, \sqrt {\frac {-a^{2}+2 a}{-a^{2}+2 a -1}}\right )}{\sqrt {a^{2} x^{2}-a^{2} x -2 a \,x^{2}+x^{3}+2 a x -x^{2}}\, \left (-a^{2}+a \right )}\) | \(317\) |
elliptic | \(\frac {2 \left (a^{2}-2 a \right ) \sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}\, \sqrt {\frac {-1+x}{-a^{2}+2 a -1}}\, \sqrt {\frac {x}{-a^{2}+2 a}}\, F\left (\sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}, \sqrt {\frac {-a^{2}+2 a}{-a^{2}+2 a -1}}\right )}{\sqrt {a^{2} x^{2}-a^{2} x -2 a \,x^{2}+x^{3}+2 a x -x^{2}}}+\frac {2 \left (2 a -2\right ) \left (a^{2}-2 a \right ) \sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}\, \sqrt {\frac {-1+x}{-a^{2}+2 a -1}}\, \sqrt {\frac {x}{-a^{2}+2 a}}\, \Pi \left (\sqrt {\frac {a^{2}-2 a +x}{a^{2}-2 a}}, \frac {-a^{2}+2 a}{-a^{2}+a}, \sqrt {\frac {-a^{2}+2 a}{-a^{2}+2 a -1}}\right )}{\sqrt {a^{2} x^{2}-a^{2} x -2 a \,x^{2}+x^{3}+2 a x -x^{2}}\, \left (-a^{2}+a \right )}\) | \(317\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 3 vs. order 1.
Time = 0.26 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.99 \[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\frac {\log \left (-\frac {a^{2} - 2 \, {\left (a^{2} - a\right )} x - x^{2} + 2 \, \sqrt {{\left (a^{2} - 2 \, a - 1\right )} x^{2} + x^{3} - {\left (a^{2} - 2 \, a\right )} x} a}{a^{2} - 2 \, a x + x^{2}}\right )}{a} \]
[In]
[Out]
\[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\int \frac {a + x - 2}{\sqrt {x \left (x - 1\right ) \left (a^{2} - 2 a + x\right )} \left (- a + x\right )}\, dx \]
[In]
[Out]
\[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\int { -\frac {a + x - 2}{\sqrt {-{\left (a - 2\right )} a x + {\left (a^{2} - 2 \, a - 1\right )} x^{2} + x^{3}} {\left (a - x\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\int { -\frac {a + x - 2}{\sqrt {-{\left (a - 2\right )} a x + {\left (a^{2} - 2 \, a - 1\right )} x^{2} + x^{3}} {\left (a - x\right )}} \,d x } \]
[In]
[Out]
Time = 0.49 (sec) , antiderivative size = 207, normalized size of antiderivative = 2.92 \[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=\frac {2\,\sqrt {\frac {x}{2\,a-a^2}}\,\sqrt {-\frac {x-1}{a^2-2\,a+1}}\,{\left (a-1\right )}^2\,\sqrt {\frac {a^2-2\,a+x}{a^2-2\,a+1}}\,\left (a\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {\frac {a^2-2\,a+x}{a^2-2\,a+1}}\right )\middle |-\frac {a^2-2\,a+1}{2\,a-a^2}\right )-2\,\Pi \left (-\frac {a^2-2\,a+1}{a-a^2};\mathrm {asin}\left (\sqrt {\frac {a^2-2\,a+x}{a^2-2\,a+1}}\right )\middle |-\frac {a^2-2\,a+1}{2\,a-a^2}\right )\right )}{a\,\sqrt {x^3+\left (a^2-2\,a-1\right )\,x^2+\left (2\,a-a^2\right )\,x}} \]
[In]
[Out]