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

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

Optimal result

Integrand size = 16, antiderivative size = 40 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=x \arctan \left (\sqrt {-\frac {a-x}{a+x}}\right )-a \text {arctanh}\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] (verified)

Time = 0.03 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {5311, 12, 1983, 214} \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=x \arctan \left (\sqrt {-\frac {a-x}{a+x}}\right )-a \text {arctanh}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \]

[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*} \text {integral}& = x \arctan \left (\sqrt {-\frac {a-x}{a+x}}\right )-\int \frac {a}{2 \sqrt {\frac {-a+x}{a+x}} (a+x)} \, dx \\ & = x \arctan \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 \arctan \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 \arctan \left (\sqrt {-\frac {a-x}{a+x}}\right )-a \text {arctanh}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.78 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=x \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right )-\frac {a \sqrt {-a+x} \text {arctanh}\left (\frac {\sqrt {a+x}}{\sqrt {-a+x}}\right )}{\sqrt {\frac {-a+x}{a+x}} \sqrt {a+x}} \]

[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] (verified)

Time = 0.08 (sec) , antiderivative size = 66, normalized size of antiderivative = 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\)
parts \(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\)

[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)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.45 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=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 ) \]

[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]

\[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=\int \operatorname {atan}{\left (\sqrt {\frac {- a + x}{a + x}} \right )}\, dx \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (36) = 72\).

Time = 0.28 (sec) , antiderivative size = 89, normalized size of antiderivative = 2.22 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=\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 )} \]

[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))

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.22 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=\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 ) \]

[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] (verification not implemented)

Time = 0.43 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.90 \[ \int \arctan \left (\sqrt {\frac {-a+x}{a+x}}\right ) \, dx=x\,\mathrm {atan}\left (\sqrt {-\frac {a-x}{a+x}}\right )-a\,\mathrm {atanh}\left (\sqrt {-\frac {a-x}{a+x}}\right ) \]

[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))