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} \]
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} \]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 1.17 (sec) , antiderivative size = 546, normalized size of antiderivative = 7.69, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2467, 2035, 2226, 1416, 2222}
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 {a+x-2}{(x-a) \sqrt {\left (a^2-2 a-1\right ) x^2+(2-a) a x+x^3}} \, dx\) |
\(\Big \downarrow \) 2467 |
\(\displaystyle \frac {\sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \int \frac {-a-x+2}{(a-x) \sqrt {x} \sqrt {x^2-\left (-a^2+2 a+1\right ) x+(2-a) a}}dx}{\sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}\) |
\(\Big \downarrow \) 2035 |
\(\displaystyle \frac {2 \sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \int \frac {-a-x+2}{(a-x) \sqrt {x^2-\left (-a^2+2 a+1\right ) x+(2-a) a}}d\sqrt {x}}{\sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}\) |
\(\Big \downarrow \) 2226 |
\(\displaystyle \frac {2 \sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \left (\frac {\sqrt {(2-a) a} \int \frac {1}{\sqrt {x^2-\left (-a^2+2 a+1\right ) x+(2-a) a}}d\sqrt {x}}{a}+\left (\sqrt {2-a}-\sqrt {a}\right ) \sqrt {2-a} \int \frac {\frac {x}{\sqrt {(2-a) a}}+1}{(a-x) \sqrt {x^2-\left (-a^2+2 a+1\right ) x+(2-a) a}}d\sqrt {x}\right )}{\sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}\) |
\(\Big \downarrow \) 1416 |
\(\displaystyle \frac {2 \sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \left (\left (\sqrt {2-a}-\sqrt {a}\right ) \sqrt {2-a} \int \frac {\frac {x}{\sqrt {(2-a) a}}+1}{(a-x) \sqrt {x^2-\left (-a^2+2 a+1\right ) x+(2-a) a}}d\sqrt {x}+\frac {((2-a) a)^{3/4} \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 )}{2 a \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}}\right )}{\sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}\) |
\(\Big \downarrow \) 2222 |
\(\displaystyle \frac {2 \sqrt {x} \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2} \left (\left (\sqrt {2-a}-\sqrt {a}\right ) \sqrt {2-a} \left (\frac {\sqrt [4]{(2-a) a} \left (1-\frac {a}{\sqrt {(2-a) a}}\right ) \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 {-a^2+2 a+\sqrt {(2-a) a}}{2 (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 )}{4 a \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}}+\frac {\left (\frac {a}{\sqrt {(2-a) a}}+1\right ) \text {arctanh}\left (\frac {(1-a) \sqrt {x}}{\sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}}\right )}{2 (1-a) a}\right )+\frac {((2-a) a)^{3/4} \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 )}{2 a \sqrt {-\left (-a^2+2 a+1\right ) x+(2-a) a+x^2}}\right )}{\sqrt {-\left (-a^2+2 a+1\right ) x^2+(2-a) a x+x^3}}\) |
(2*Sqrt[x]*Sqrt[(2 - a)*a - (1 + 2*a - a^2)*x + x^2]*((((2 - a)*a)^(3/4)*( 1 + x/Sqrt[(2 - a)*a])*Sqrt[((2 - a)*a - (1 + 2*a - a^2)*x + x^2)/((2 - a) *a*(1 + x/Sqrt[(2 - a)*a])^2)]*EllipticF[2*ArcTan[Sqrt[x]/((2 - a)*a)^(1/4 )], (2 + (1 + 2*a - a^2)/Sqrt[(2 - a)*a])/4])/(2*a*Sqrt[(2 - a)*a - (1 + 2 *a - a^2)*x + x^2]) + (Sqrt[2 - a] - Sqrt[a])*Sqrt[2 - a]*(((1 + a/Sqrt[(2 - a)*a])*ArcTanh[((1 - a)*Sqrt[x])/Sqrt[(2 - a)*a - (1 + 2*a - a^2)*x + x ^2]])/(2*(1 - a)*a) + (((2 - a)*a)^(1/4)*(1 - a/Sqrt[(2 - a)*a])*(1 + x/Sq rt[(2 - a)*a])*Sqrt[((2 - a)*a - (1 + 2*a - a^2)*x + x^2)/((2 - a)*a*(1 + x/Sqrt[(2 - a)*a])^2)]*EllipticPi[(2*a - a^2 + Sqrt[(2 - a)*a])/(2*(2 - a) *a), 2*ArcTan[Sqrt[x]/((2 - a)*a)^(1/4)], (2 + (1 + 2*a - a^2)/Sqrt[(2 - a )*a])/4])/(4*a*Sqrt[(2 - a)*a - (1 + 2*a - a^2)*x + x^2]))))/Sqrt[(2 - a)* a*x - (1 + 2*a - a^2)*x^2 + x^3]
3.1.82.3.1 Defintions of rubi rules used
Int[1/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[c /a, 4]}, Simp[(1 + q^2*x^2)*(Sqrt[(a + b*x^2 + c*x^4)/(a*(1 + q^2*x^2)^2)]/ (2*q*Sqrt[a + b*x^2 + c*x^4]))*EllipticF[2*ArcTan[q*x], 1/2 - b*(q^2/(4*c)) ], x]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && PosQ[c/a]
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[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[B/A, 2]}, Simp[(-(B*d - A*e))*(A rcTanh[Rt[b - c*(d/e) - a*(e/d), 2]*(x/Sqrt[a + b*x^2 + c*x^4])]/(2*d*e*Rt[ b - c*(d/e) - a*(e/d), 2])), x] + Simp[(B*d + A*e)*(1 + q^2*x^2)*(Sqrt[(a + b*x^2 + c*x^4)/(a*(1 + q^2*x^2)^2)]/(4*d*e*q*Sqrt[a + b*x^2 + c*x^4]))*Ell ipticPi[-(e - d*q^2)^2/(4*d*e*q^2), 2*ArcTan[q*x], 1/2 - b/(4*a*q^2)], x]] /; FreeQ[{a, b, c, d, e, A, B}, x] && NeQ[c*d^2 - a*e^2, 0] && PosQ[c/a] && EqQ[c*A^2 - a*B^2, 0] && PosQ[B/A] && NegQ[-b + c*(d/e) + a*(e/d)]
Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[c/a, 2]}, Simp[(A*(c*d + a*e*q) - a*B*(e + d*q))/(c*d^2 - a*e^2) Int[1/Sqrt[a + b*x^2 + c*x^4], x], x] + Simp[a*(B*d - A*e)*((e + d*q)/(c*d^2 - a*e^2)) Int[(1 + q*x^2)/((d + e*x^ 2)*Sqrt[a + b*x^2 + c*x^4]), x], x]] /; FreeQ[{a, b, c, d, e, A, B}, x] && NeQ[c*d^2 - a*e^2, 0] && PosQ[c/a] && NeQ[c*A^2 - a*B^2, 0]
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]
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\) |
2*(a^2-2*a)*((a^2-2*a+x)/(a^2-2*a))^(1/2)*((-1+x)/(-a^2+2*a-1))^(1/2)*(x/( -a^2+2*a))^(1/2)/(a^2*x^2-a^2*x-2*a*x^2+x^3+2*a*x-x^2)^(1/2)*EllipticF(((a ^2-2*a+x)/(a^2-2*a))^(1/2),((-a^2+2*a)/(-a^2+2*a-1))^(1/2))-2*(-2*a+2)*(a^ 2-2*a)*((a^2-2*a+x)/(a^2-2*a))^(1/2)*((-1+x)/(-a^2+2*a-1))^(1/2)*(x/(-a^2+ 2*a))^(1/2)/(a^2*x^2-a^2*x-2*a*x^2+x^3+2*a*x-x^2)^(1/2)/(-a^2+a)*EllipticP i(((a^2-2*a+x)/(a^2-2*a))^(1/2),(-a^2+2*a)/(-a^2+a),((-a^2+2*a)/(-a^2+2*a- 1))^(1/2))
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} \]
log(-(a^2 - 2*(a^2 - a)*x - x^2 + 2*sqrt((a^2 - 2*a - 1)*x^2 + x^3 - (a^2 - 2*a)*x)*a)/(a^2 - 2*a*x + x^2))/a
\[ \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 \]
\[ \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 } \]
\[ \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 } \]
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}} \]
(2*(x/(2*a - a^2))^(1/2)*(-(x - 1)/(a^2 - 2*a + 1))^(1/2)*(a - 1)^2*((x - 2*a + a^2)/(a^2 - 2*a + 1))^(1/2)*(a*ellipticF(asin(((x - 2*a + a^2)/(a^2 - 2*a + 1))^(1/2)), -(a^2 - 2*a + 1)/(2*a - a^2)) - 2*ellipticPi(-(a^2 - 2 *a + 1)/(a - a^2), asin(((x - 2*a + a^2)/(a^2 - 2*a + 1))^(1/2)), -(a^2 - 2*a + 1)/(2*a - a^2))))/(a*(x*(2*a - a^2) - x^2*(2*a - a^2 + 1) + x^3)^(1/ 2))
\[ \int \frac {-2+a+x}{(-a+x) \sqrt {(2-a) a x+\left (-1-2 a+a^2\right ) x^2+x^3}} \, dx=-\left (\int \frac {\sqrt {x}\, \sqrt {x -1}\, \sqrt {a^{2}-2 a +x}}{a^{3} x^{2}-a^{2} x^{3}-a^{3} x -a^{2} x^{2}+3 a \,x^{3}-x^{4}+2 a^{2} x -3 a \,x^{2}+x^{3}}d x \right ) a +2 \left (\int \frac {\sqrt {x}\, \sqrt {x -1}\, \sqrt {a^{2}-2 a +x}}{a^{3} x^{2}-a^{2} x^{3}-a^{3} x -a^{2} x^{2}+3 a \,x^{3}-x^{4}+2 a^{2} x -3 a \,x^{2}+x^{3}}d x \right )-\left (\int \frac {\sqrt {x}\, \sqrt {x -1}\, \sqrt {a^{2}-2 a +x}}{a^{3} x -a^{2} x^{2}-a^{3}-a^{2} x +3 a \,x^{2}-x^{3}+2 a^{2}-3 a x +x^{2}}d x \right ) \]
- int((sqrt(x)*sqrt(x - 1)*sqrt(a**2 - 2*a + x))/(a**3*x**2 - a**3*x - a* *2*x**3 - a**2*x**2 + 2*a**2*x + 3*a*x**3 - 3*a*x**2 - x**4 + x**3),x)*a + 2*int((sqrt(x)*sqrt(x - 1)*sqrt(a**2 - 2*a + x))/(a**3*x**2 - a**3*x - a* *2*x**3 - a**2*x**2 + 2*a**2*x + 3*a*x**3 - 3*a*x**2 - x**4 + x**3),x) - i nt((sqrt(x)*sqrt(x - 1)*sqrt(a**2 - 2*a + x))/(a**3*x - a**3 - a**2*x**2 - a**2*x + 2*a**2 + 3*a*x**2 - 3*a*x - x**3 + x**2),x)