3.744 \(\int \sqrt {\frac {-a+x}{a+x}} \, dx\)

Optimal. Leaf size=41 \[ \sqrt {-\frac {a-x}{a+x}} (a+x)-2 a \tanh ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \]

[Out]

-2*a*arctanh(((-a+x)/(a+x))^(1/2))+(a+x)*((-a+x)/(a+x))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1959, 288, 206} \[ \sqrt {-\frac {a-x}{a+x}} (a+x)-2 a \tanh ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Sqrt[-((a - x)/(a + x))]*(a + x) - 2*a*ArcTanh[Sqrt[-((a - x)/(a + x))]]

Rule 206

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

Rule 288

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 1959

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*} \int \sqrt {\frac {-a+x}{a+x}} \, dx &=(4 a) \operatorname {Subst}\left (\int \frac {x^2}{\left (1-x^2\right )^2} \, dx,x,\sqrt {\frac {-a+x}{a+x}}\right )\\ &=\sqrt {-\frac {a-x}{a+x}} (a+x)-(2 a) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sqrt {\frac {-a+x}{a+x}}\right )\\ &=\sqrt {-\frac {a-x}{a+x}} (a+x)-2 a \tanh ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 78, normalized size = 1.90 \[ \frac {\sqrt {\frac {x-a}{a+x}} \left (\sqrt {x-a} (a+x)-2 a^{3/2} \sqrt {\frac {a+x}{a}} \sinh ^{-1}\left (\frac {\sqrt {x-a}}{\sqrt {2} \sqrt {a}}\right )\right )}{\sqrt {x-a}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(Sqrt[(-a + x)/(a + x)]*(Sqrt[-a + x]*(a + x) - 2*a^(3/2)*Sqrt[(a + x)/a]*ArcSinh[Sqrt[-a + x]/(Sqrt[2]*Sqrt[a
])]))/Sqrt[-a + x]

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 58, normalized size = 1.41 \[ -a \log \left (\sqrt {-\frac {a - x}{a + x}} + 1\right ) + a \log \left (\sqrt {-\frac {a - x}{a + x}} - 1\right ) + {\left (a + x\right )} \sqrt {-\frac {a - x}{a + x}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-a*log(sqrt(-(a - x)/(a + x)) + 1) + a*log(sqrt(-(a - x)/(a + x)) - 1) + (a + x)*sqrt(-(a - x)/(a + x))

________________________________________________________________________________________

giac [A]  time = 0.31, size = 40, normalized size = 0.98 \[ a \log \left ({\left | -x + \sqrt {-a^{2} + x^{2}} \right |}\right ) \mathrm {sgn}\left (a + x\right ) + \sqrt {-a^{2} + x^{2}} \mathrm {sgn}\left (a + x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*log(abs(-x + sqrt(-a^2 + x^2)))*sgn(a + x) + sqrt(-a^2 + x^2)*sgn(a + x)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 60, normalized size = 1.46 \[ -\frac {\sqrt {\frac {-a +x}{a +x}}\, \left (a +x \right ) \left (a \ln \left (x +\sqrt {-a^{2}+x^{2}}\right )-\sqrt {-a^{2}+x^{2}}\right )}{\sqrt {\left (a +x \right ) \left (-a +x \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((-a+x)/(a+x))^(1/2)*(a+x)*(a*ln(x+(-a^2+x^2)^(1/2))-(-a^2+x^2)^(1/2))/((a+x)*(-a+x))^(1/2)

________________________________________________________________________________________

maxima [A]  time = 0.91, size = 70, normalized size = 1.71 \[ a {\left (\frac {2 \, \sqrt {-\frac {a - x}{a + x}}}{\frac {a - x}{a + x} + 1} - \log \left (\sqrt {-\frac {a - x}{a + x}} + 1\right ) + \log \left (\sqrt {-\frac {a - x}{a + x}} - 1\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*(2*sqrt(-(a - x)/(a + x))/((a - x)/(a + x) + 1) - log(sqrt(-(a - x)/(a + x)) + 1) + log(sqrt(-(a - x)/(a + x
)) - 1))

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 51, normalized size = 1.24 \[ \frac {2\,a\,\sqrt {-\frac {a-x}{a+x}}}{\frac {a-x}{a+x}+1}-2\,a\,\mathrm {atanh}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*a*(-(a - x)/(a + x))^(1/2))/((a - x)/(a + x) + 1) - 2*a*atanh((-(a - x)/(a + x))^(1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {\frac {- a + x}{a + x}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________