Optimal. Leaf size=42 \[ 2 a \tan ^{-1}\left (\sqrt {\frac {a+x}{a-x}}\right )-(a-x) \sqrt {\frac {a+x}{a-x}} \]
________________________________________________________________________________________
Rubi [A] time = 0.02, 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 = {1959, 288, 203} \begin {gather*} 2 a \tan ^{-1}\left (\sqrt {\frac {a+x}{a-x}}\right )-(a-x) \sqrt {\frac {a+x}{a-x}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 288
Rule 1959
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 )\\ &=-\left ((a-x) \sqrt {\frac {a+x}{a-x}}\right )+(2 a) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {\frac {a+x}{a-x}}\right )\\ &=-\left ((a-x) \sqrt {\frac {a+x}{a-x}}\right )+2 a \tan ^{-1}\left (\sqrt {\frac {a+x}{a-x}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 83, normalized size = 1.98 \begin {gather*} \frac {\sqrt {x-a} \sqrt {\frac {a+x}{a-x}} \left (2 a^{3/2} \sqrt {\frac {a+x}{a}} \sinh ^{-1}\left (\frac {\sqrt {x-a}}{\sqrt {2} \sqrt {a}}\right )+\sqrt {x-a} (a+x)\right )}{a+x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.04, size = 41, normalized size = 0.98 \begin {gather*} \sqrt {\frac {a+x}{a-x}} (x-a)+2 a \tan ^{-1}\left (\sqrt {\frac {a+x}{a-x}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.70, 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]
[Out]
________________________________________________________________________________________
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}\relax (a) - \sqrt {a^{2} - x^{2}} \mathrm {sgn}\left (a - x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 64, normalized size = 1.52 \begin {gather*} -\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 )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 2.01, 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]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.17, 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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________