3.2.3 \(\int \sqrt {\frac {a+x}{a-x}} \, dx\) [103]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 42, 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 = {1979, 294, 209} \begin {gather*} 2 a \text {ArcTan}\left (\sqrt {\frac {a+x}{a-x}}\right )-(a-x) \sqrt {\frac {a+x}{a-x}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-((a - x)*Sqrt[(a + x)/(a - x)]) + 2*a*ArcTan[Sqrt[(a + x)/(a - 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*} \int \sqrt {\frac {a+x}{a-x}} \, dx &=(4 a) \text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right )^2} \, dx,x,\sqrt {\frac {a+x}{a-x}}\right )\\ &=-(a-x) \sqrt {\frac {a+x}{a-x}}+(2 a) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {\frac {a+x}{a-x}}\right )\\ &=-(a-x) \sqrt {\frac {a+x}{a-x}}+2 a \tan ^{-1}\left (\sqrt {\frac {a+x}{a-x}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 67, normalized size = 1.60 \begin {gather*} \frac {\sqrt {\frac {a+x}{a-x}} \left ((-a+x) \sqrt {a+x}+2 a \sqrt {a-x} \tan ^{-1}\left (\frac {\sqrt {a+x}}{\sqrt {a-x}}\right )\right )}{\sqrt {a+x}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 61, normalized size = 1.45

method result size
default \(\frac {\sqrt {\frac {a +x}{a -x}}\, \left (a -x \right ) \left (a \arctan \left (\frac {x}{\sqrt {a^{2}-x^{2}}}\right )-\sqrt {a^{2}-x^{2}}\right )}{\sqrt {\left (a -x \right ) \left (a +x \right )}}\) \(61\)
risch \(-\frac {\left (a -x \right ) \sqrt {\frac {a +x}{a -x}}\, \sqrt {\left (a -x \right ) \left (a +x \right )}}{\sqrt {-\left (-a +x \right ) \left (a +x \right )}}+\frac {a \arctan \left (\frac {x}{\sqrt {a^{2}-x^{2}}}\right ) \sqrt {\frac {a +x}{a -x}}\, \sqrt {\left (a -x \right ) \left (a +x \right )}}{a +x}\) \(90\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.99, size = 49, normalized size = 1.17 \begin {gather*} -2 \, a {\left (\frac {\sqrt {\frac {a + x}{a - x}}}{\frac {a + x}{a - x} + 1} - \arctan \left (\sqrt {\frac {a + x}{a - x}}\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.84, size = 38, normalized size = 0.90 \begin {gather*} 2 \, a \arctan \left (\sqrt {\frac {a + x}{a - x}}\right ) - {\left (a - x\right )} \sqrt {\frac {a + x}{a - x}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {\frac {a + x}{a - x}}\, dx \end {gather*}

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)

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 36, normalized size = 0.86 \begin {gather*} a \arcsin \left (\frac {x}{a}\right ) \mathrm {sgn}\left (a - x\right ) \mathrm {sgn}\left (a\right ) - \sqrt {a^{2} - x^{2}} \mathrm {sgn}\left (a - x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*arcsin(x/a)*sgn(a - x)*sgn(a) - sqrt(a^2 - x^2)*sgn(a - x)

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 49, normalized size = 1.17 \begin {gather*} 2\,a\,\mathrm {atan}\left (\sqrt {\frac {a+x}{a-x}}\right )-\frac {2\,a\,\sqrt {\frac {a+x}{a-x}}}{\frac {a+x}{a-x}+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________