3.7.96 \(\int \tan ^{-1}(\sqrt {\frac {-a+x}{a+x}}) \, dx\) [696]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {5311, 12, 1983, 214} \begin {gather*} x \text {ArcTan}\left (\sqrt {-\frac {a-x}{a+x}}\right )-a \tanh ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 214

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

Rule 1983

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

Rule 5311

Int[ArcTan[u_], x_Symbol] :> Simp[x*ArcTan[u], x] - Int[SimplifyIntegrand[x*(D[u, x]/(1 + u^2)), x], x] /; Inv
erseFunctionFreeQ[u, x]

Rubi steps

\begin {align*} \int \tan ^{-1}\left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx &=x \tan ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )-\int \frac {a}{2 \sqrt {\frac {-a+x}{a+x}} (a+x)} \, dx\\ &=x \tan ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )-\frac {1}{2} a \int \frac {1}{\sqrt {\frac {-a+x}{a+x}} (a+x)} \, dx\\ &=x \tan ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )-\left (2 a^2\right ) \text {Subst}\left (\int \frac {1}{2 a-2 a x^2} \, dx,x,\sqrt {\frac {-a+x}{a+x}}\right )\\ &=x \tan ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )-a \tanh ^{-1}\left (\sqrt {-\frac {a-x}{a+x}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 71, normalized size = 1.78 \begin {gather*} x \tan ^{-1}\left (\sqrt {\frac {-a+x}{a+x}}\right )-\frac {a \sqrt {-a+x} \tanh ^{-1}\left (\frac {\sqrt {-a+x}}{\sqrt {a+x}}\right )}{\sqrt {\frac {-a+x}{a+x}} \sqrt {a+x}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 66, normalized size = 1.65

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (36) = 72\).
time = 1.82, size = 89, normalized size = 2.22 \begin {gather*} \frac {1}{2} \, a {\left (\frac {4 \, \arctan \left (\sqrt {-\frac {a - x}{a + x}}\right )}{\frac {a - x}{a + x} + 1} - 2 \, \arctan \left (\sqrt {-\frac {a - x}{a + x}}\right ) - \log \left (\sqrt {-\frac {a - x}{a + x}} + 1\right ) + \log \left (\sqrt {-\frac {a - x}{a + x}} - 1\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.75, size = 58, normalized size = 1.45 \begin {gather*} x \arctan \left (\sqrt {-\frac {a - x}{a + x}}\right ) - \frac {1}{2} \, a \log \left (\sqrt {-\frac {a - x}{a + x}} + 1\right ) + \frac {1}{2} \, a \log \left (\sqrt {-\frac {a - x}{a + x}} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 1.17, size = 49, normalized size = 1.22 \begin {gather*} \frac {1}{2} \, a \log \left ({\left | -x + \sqrt {-a^{2} + x^{2}} \right |}\right ) \mathrm {sgn}\left (a + x\right ) + x \arctan \left (\frac {\sqrt {-a^{2} + x^{2}} \mathrm {sgn}\left (a + x\right )}{a + x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.36, size = 36, normalized size = 0.90 \begin {gather*} x\,\mathrm {atan}\left (\sqrt {-\frac {a-x}{a+x}}\right )-a\,\mathrm {atanh}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________