### 3.266 $$\int \frac{\sqrt{-2+x}}{2+x} \, dx$$

Optimal. Leaf size=24 $2 \sqrt{x-2}-4 \tan ^{-1}\left (\frac{\sqrt{x-2}}{2}\right )$

[Out]

2*Sqrt[-2 + x] - 4*ArcTan[Sqrt[-2 + x]/2]

________________________________________________________________________________________

Rubi [A]  time = 0.0057144, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 13, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.231, Rules used = {50, 63, 203} $2 \sqrt{x-2}-4 \tan ^{-1}\left (\frac{\sqrt{x-2}}{2}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

2*Sqrt[-2 + x] - 4*ArcTan[Sqrt[-2 + x]/2]

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 203

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

Rubi steps

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

Mathematica [A]  time = 0.0055719, size = 24, normalized size = 1. $2 \sqrt{x-2}-4 \tan ^{-1}\left (\frac{\sqrt{x-2}}{2}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

2*Sqrt[-2 + x] - 4*ArcTan[Sqrt[-2 + x]/2]

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 19, normalized size = 0.8 \begin{align*} -4\,\arctan \left ( 1/2\,\sqrt{-2+x} \right ) +2\,\sqrt{-2+x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.42182, size = 24, normalized size = 1. \begin{align*} 2 \, \sqrt{x - 2} - 4 \, \arctan \left (\frac{1}{2} \, \sqrt{x - 2}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x - 2) - 4*arctan(1/2*sqrt(x - 2))

________________________________________________________________________________________

Fricas [A]  time = 1.90211, size = 58, normalized size = 2.42 \begin{align*} 2 \, \sqrt{x - 2} - 4 \, \arctan \left (\frac{1}{2} \, \sqrt{x - 2}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x - 2) - 4*arctan(1/2*sqrt(x - 2))

________________________________________________________________________________________

Sympy [B]  time = 1.2493, size = 107, normalized size = 4.46 \begin{align*} \begin{cases} - 4 i \operatorname{acosh}{\left (\frac{2}{\sqrt{x + 2}} \right )} - \frac{2 i \sqrt{x + 2}}{\sqrt{-1 + \frac{4}{x + 2}}} + \frac{8 i}{\sqrt{-1 + \frac{4}{x + 2}} \sqrt{x + 2}} & \text{for}\: \frac{4}{\left |{x + 2}\right |} > 1 \\4 \operatorname{asin}{\left (\frac{2}{\sqrt{x + 2}} \right )} + \frac{2 \sqrt{x + 2}}{\sqrt{1 - \frac{4}{x + 2}}} - \frac{8}{\sqrt{1 - \frac{4}{x + 2}} \sqrt{x + 2}} & \text{otherwise} \end{cases} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((-4*I*acosh(2/sqrt(x + 2)) - 2*I*sqrt(x + 2)/sqrt(-1 + 4/(x + 2)) + 8*I/(sqrt(-1 + 4/(x + 2))*sqrt(x
+ 2)), 4/Abs(x + 2) > 1), (4*asin(2/sqrt(x + 2)) + 2*sqrt(x + 2)/sqrt(1 - 4/(x + 2)) - 8/(sqrt(1 - 4/(x + 2))
*sqrt(x + 2)), True))

________________________________________________________________________________________

Giac [A]  time = 1.05946, size = 24, normalized size = 1. \begin{align*} 2 \, \sqrt{x - 2} - 4 \, \arctan \left (\frac{1}{2} \, \sqrt{x - 2}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x - 2) - 4*arctan(1/2*sqrt(x - 2))