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

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

Optimal result

Integrand size = 15, antiderivative size = 41 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=-\left ((1-x) \sqrt {\frac {1+x}{1-x}}\right )+2 \arctan \left (\sqrt {\frac {1+x}{1-x}}\right ) \]

[Out]

2*arctan(((1+x)/(1-x))^(1/2))-(1-x)*((1+x)/(1-x))^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1979, 294, 209} \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=2 \arctan \left (\sqrt {\frac {x+1}{1-x}}\right )-(1-x) \sqrt {\frac {x+1}{1-x}} \]

[In]

Int[Sqrt[(1 + x)/(1 - x)],x]

[Out]

-((1 - x)*Sqrt[(1 + x)/(1 - x)]) + 2*ArcTan[Sqrt[(1 + x)/(1 - x)]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 294

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^
n)^(p + 1)/(b*n*(p + 1))), x] - Dist[c^n*((m - n + 1)/(b*n*(p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rule 1979

Int[(((e_.)*((a_.) + (b_.)*(x_)^(n_.)))/((c_) + (d_.)*(x_)^(n_.)))^(p_), x_Symbol] :> With[{q = Denominator[p]
}, Dist[q*e*((b*c - a*d)/n), Subst[Int[x^(q*(p + 1) - 1)*(((-a)*e + c*x^q)^(1/n - 1)/(b*e - d*x^q)^(1/n + 1)),
 x], x, (e*((a + b*x^n)/(c + d*x^n)))^(1/q)], x]] /; FreeQ[{a, b, c, d, e}, x] && FractionQ[p] && IntegerQ[1/n
]

Rubi steps \begin{align*} \text {integral}& = 4 \text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right )^2} \, dx,x,\sqrt {\frac {1+x}{1-x}}\right ) \\ & = -\left ((1-x) \sqrt {\frac {1+x}{1-x}}\right )+2 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {\frac {1+x}{1-x}}\right ) \\ & = -\left ((1-x) \sqrt {\frac {1+x}{1-x}}\right )+2 \arctan \left (\sqrt {\frac {1+x}{1-x}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.59 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=-\frac {\sqrt {1-x} \sqrt {\frac {1+x}{1-x}} \left (\sqrt {1-x^2}+2 \arctan \left (\frac {\sqrt {1-x^2}}{-1+x}\right )\right )}{\sqrt {1+x}} \]

[In]

Integrate[Sqrt[(1 + x)/(1 - x)],x]

[Out]

-((Sqrt[1 - x]*Sqrt[(1 + x)/(1 - x)]*(Sqrt[1 - x^2] + 2*ArcTan[Sqrt[1 - x^2]/(-1 + x)]))/Sqrt[1 + x])

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00

method result size
default \(\frac {\sqrt {-\frac {1+x}{-1+x}}\, \left (-1+x \right ) \left (\sqrt {-x^{2}+1}-\arcsin \left (x \right )\right )}{\sqrt {-\left (-1+x \right ) \left (1+x \right )}}\) \(41\)
risch \(\left (-1+x \right ) \sqrt {-\frac {1+x}{-1+x}}+\frac {\arcsin \left (x \right ) \sqrt {-\frac {1+x}{-1+x}}\, \sqrt {-\left (-1+x \right ) \left (1+x \right )}}{1+x}\) \(48\)
trager \(\left (-1+x \right ) \sqrt {-\frac {1+x}{-1+x}}+\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \sqrt {-\frac {1+x}{-1+x}}\, x +\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \sqrt {-\frac {1+x}{-1+x}}+x \right )\) \(68\)

[In]

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

[Out]

(-(1+x)/(-1+x))^(1/2)*(-1+x)/(-(-1+x)*(1+x))^(1/2)*((-x^2+1)^(1/2)-arcsin(x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.78 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx={\left (x - 1\right )} \sqrt {-\frac {x + 1}{x - 1}} + 2 \, \arctan \left (\sqrt {-\frac {x + 1}{x - 1}}\right ) \]

[In]

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

[Out]

(x - 1)*sqrt(-(x + 1)/(x - 1)) + 2*arctan(sqrt(-(x + 1)/(x - 1)))

Sympy [F]

\[ \int \sqrt {\frac {1+x}{1-x}} \, dx=\int \sqrt {\frac {x + 1}{1 - x}}\, dx \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.05 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=\frac {2 \, \sqrt {-\frac {x + 1}{x - 1}}}{\frac {x + 1}{x - 1} - 1} + 2 \, \arctan \left (\sqrt {-\frac {x + 1}{x - 1}}\right ) \]

[In]

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

[Out]

2*sqrt(-(x + 1)/(x - 1))/((x + 1)/(x - 1) - 1) + 2*arctan(sqrt(-(x + 1)/(x - 1)))

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.73 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=\frac {1}{2} \, \pi \mathrm {sgn}\left (x - 1\right ) - \arcsin \left (x\right ) \mathrm {sgn}\left (x - 1\right ) + \sqrt {-x^{2} + 1} \mathrm {sgn}\left (x - 1\right ) \]

[In]

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

[Out]

1/2*pi*sgn(x - 1) - arcsin(x)*sgn(x - 1) + sqrt(-x^2 + 1)*sgn(x - 1)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.05 \[ \int \sqrt {\frac {1+x}{1-x}} \, dx=2\,\mathrm {atan}\left (\sqrt {-\frac {x+1}{x-1}}\right )+\frac {2\,\sqrt {-\frac {x+1}{x-1}}}{\frac {x+1}{x-1}-1} \]

[In]

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

[Out]

2*atan((-(x + 1)/(x - 1))^(1/2)) + (2*(-(x + 1)/(x - 1))^(1/2))/((x + 1)/(x - 1) - 1)