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

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

Optimal result

Integrand size = 19, antiderivative size = 10 \[ \int \frac {\sqrt {1+x}}{\sqrt {x-x^2}} \, dx=2 E\left (\left .\arcsin \left (\sqrt {x}\right )\right |-1\right ) \] Output:

2*EllipticE(x^(1/2),I)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 0.53 (sec) , antiderivative size = 64, normalized size of antiderivative = 6.40 \[ \int \frac {\sqrt {1+x}}{\sqrt {x-x^2}} \, dx=\frac {2 x \sqrt {1-x^2} \left (3 \operatorname {Hypergeometric2F1}\left (\frac {1}{4},\frac {1}{2},\frac {5}{4},x^2\right )+x \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3}{4},\frac {7}{4},x^2\right )\right )}{3 \sqrt {-((-1+x) x)} \sqrt {1+x}} \] Input:

Integrate[Sqrt[1 + x]/Sqrt[x - x^2],x]
 

Output:

(2*x*Sqrt[1 - x^2]*(3*Hypergeometric2F1[1/4, 1/2, 5/4, x^2] + x*Hypergeome 
tric2F1[1/2, 3/4, 7/4, x^2]))/(3*Sqrt[-((-1 + x)*x)]*Sqrt[1 + x])
 

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {1168, 120}

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 {\sqrt {x+1}}{\sqrt {x-x^2}} \, dx\)

\(\Big \downarrow \) 1168

\(\displaystyle \int \frac {\sqrt {x+1}}{\sqrt {1-x} \sqrt {x}}dx\)

\(\Big \downarrow \) 120

\(\displaystyle 2 E\left (\left .\arcsin \left (\sqrt {x}\right )\right |-1\right )\)

Input:

Int[Sqrt[1 + x]/Sqrt[x - x^2],x]
 

Output:

2*EllipticE[ArcSin[Sqrt[x]], -1]
 

Defintions of rubi rules used

rule 120
Int[Sqrt[(e_) + (f_.)*(x_)]/(Sqrt[(b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_] 
 :> Simp[2*(Sqrt[e]/b)*Rt[-b/d, 2]*EllipticE[ArcSin[Sqrt[b*x]/(Sqrt[c]*Rt[- 
b/d, 2])], c*(f/(d*e))], x] /; FreeQ[{b, c, d, e, f}, x] && GtQ[c, 0] && Gt 
Q[e, 0] &&  !LtQ[-b/d, 0]
 

rule 1168
Int[((d_.) + (e_.)*(x_))^(m_)/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> 
 Int[(d + e*x)^m/(Sqrt[b*x]*Sqrt[1 + (c/b)*x]), x] /; FreeQ[{b, c, d, e}, x 
] && NeQ[c*d - b*e, 0] && EqQ[m^2, 1/4] && LtQ[c, 0] && RationalQ[b]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(55\) vs. \(2(8)=16\).

Time = 0.68 (sec) , antiderivative size = 56, normalized size of antiderivative = 5.60

method result size
default \(-\frac {2 \left (\operatorname {EllipticF}\left (\sqrt {x +1}, \frac {\sqrt {2}}{2}\right )-\operatorname {EllipticE}\left (\sqrt {x +1}, \frac {\sqrt {2}}{2}\right )\right ) \sqrt {-x}\, \sqrt {-2 x +2}\, \sqrt {-x \left (x -1\right )}}{x \left (x -1\right )}\) \(56\)
elliptic \(\frac {\sqrt {-x \left (x^{2}-1\right )}\, \left (\frac {\sqrt {x +1}\, \sqrt {-2 x +2}\, \sqrt {-x}\, \operatorname {EllipticF}\left (\sqrt {x +1}, \frac {\sqrt {2}}{2}\right )}{\sqrt {-x^{3}+x}}+\frac {\sqrt {x +1}\, \sqrt {-2 x +2}\, \sqrt {-x}\, \left (-2 \operatorname {EllipticE}\left (\sqrt {x +1}, \frac {\sqrt {2}}{2}\right )+\operatorname {EllipticF}\left (\sqrt {x +1}, \frac {\sqrt {2}}{2}\right )\right )}{\sqrt {-x^{3}+x}}\right )}{\sqrt {x +1}\, \sqrt {-x \left (x -1\right )}}\) \(116\)

Input:

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

Output:

-2*(EllipticF((x+1)^(1/2),1/2*2^(1/2))-EllipticE((x+1)^(1/2),1/2*2^(1/2))) 
*(-x)^(1/2)*(-2*x+2)^(1/2)*(-x*(x-1))^(1/2)/x/(x-1)
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 16 vs. \(2 (7) = 14\).

Time = 0.09 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.60 \[ \int \frac {\sqrt {1+x}}{\sqrt {x-x^2}} \, dx=-2 i \, {\rm weierstrassPInverse}\left (4, 0, x\right ) + 2 i \, {\rm weierstrassZeta}\left (4, 0, {\rm weierstrassPInverse}\left (4, 0, x\right )\right ) \] Input:

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

Output:

-2*I*weierstrassPInverse(4, 0, x) + 2*I*weierstrassZeta(4, 0, weierstrassP 
Inverse(4, 0, x))
 

Sympy [F]

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

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

Output:

Integral(sqrt(x + 1)/sqrt(-x*(x - 1)), x)
 

Maxima [F]

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

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

Output:

integrate(sqrt(x + 1)/sqrt(-x^2 + x), x)
 

Giac [F]

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

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

Output:

integrate(sqrt(x + 1)/sqrt(-x^2 + x), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {1+x}}{\sqrt {x-x^2}} \, dx=\int \frac {\sqrt {x+1}}{\sqrt {x-x^2}} \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

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