3.968 \(\int \frac{x}{x-\sqrt{1-x^2}} \, dx\)

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

[Out]

x/2 + Sqrt[1 - x^2]/2 - ArcTanh[Sqrt[2]*x]/(2*Sqrt[2]) - ArcTanh[Sqrt[2]*Sqrt[1 - x^2]]/(2*Sqrt[2])

________________________________________________________________________________________

Rubi [A]  time = 0.0535978, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.368, Rules used = {2107, 321, 206, 444, 50, 63, 207} \[ \frac{\sqrt{1-x^2}}{2}-\frac{\tanh ^{-1}\left (\sqrt{2} \sqrt{1-x^2}\right )}{2 \sqrt{2}}+\frac{x}{2}-\frac{\tanh ^{-1}\left (\sqrt{2} x\right )}{2 \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

Int[x/(x - Sqrt[1 - x^2]),x]

[Out]

x/2 + Sqrt[1 - x^2]/2 - ArcTanh[Sqrt[2]*x]/(2*Sqrt[2]) - ArcTanh[Sqrt[2]*Sqrt[1 - x^2]]/(2*Sqrt[2])

Rule 2107

Int[(x_)^(m_.)/((d_.)*(x_)^(n_.) + (c_.)*Sqrt[(a_.) + (b_.)*(x_)^(p_.)]), x_Symbol] :> -Dist[d, Int[x^(m + n)/
(a*c^2 + (b*c^2 - d^2)*x^(2*n)), x], x] + Dist[c, Int[(x^m*Sqrt[a + b*x^(2*n)])/(a*c^2 + (b*c^2 - d^2)*x^(2*n)
), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[p, 2*n] && NeQ[b*c^2 - d^2, 0]

Rule 321

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*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 206

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

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

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 207

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

Rubi steps

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

Mathematica [A]  time = 0.0525904, size = 54, normalized size = 0.83 \[ \frac{1}{4} \left (2 \left (\sqrt{1-x^2}+x\right )-\sqrt{2} \tanh ^{-1}\left (\sqrt{2-2 x^2}\right )-\sqrt{2} \tanh ^{-1}\left (\sqrt{2} x\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x/(x - Sqrt[1 - x^2]),x]

[Out]

(2*(x + Sqrt[1 - x^2]) - Sqrt[2]*ArcTanh[Sqrt[2]*x] - Sqrt[2]*ArcTanh[Sqrt[2 - 2*x^2]])/4

________________________________________________________________________________________

Maple [B]  time = 0.01, size = 175, normalized size = 2.7 \begin{align*}{\frac{x}{2}}-{\frac{{\it Artanh} \left ( x\sqrt{2} \right ) \sqrt{2}}{4}}+{\frac{1}{8}\sqrt{-4\, \left ( x+1/2\,\sqrt{2} \right ) ^{2}+4\, \left ( x+1/2\,\sqrt{2} \right ) \sqrt{2}+2}}-{\frac{\sqrt{2}}{8}{\it Artanh} \left ({\sqrt{2} \left ( 1+ \left ( x+{\frac{\sqrt{2}}{2}} \right ) \sqrt{2} \right ){\frac{1}{\sqrt{-4\, \left ( x+1/2\,\sqrt{2} \right ) ^{2}+4\, \left ( x+1/2\,\sqrt{2} \right ) \sqrt{2}+2}}}} \right ) }+{\frac{1}{8}\sqrt{-4\, \left ( x-1/2\,\sqrt{2} \right ) ^{2}-4\, \left ( x-1/2\,\sqrt{2} \right ) \sqrt{2}+2}}-{\frac{\sqrt{2}}{8}{\it Artanh} \left ({\sqrt{2} \left ( 1- \left ( x-{\frac{\sqrt{2}}{2}} \right ) \sqrt{2} \right ){\frac{1}{\sqrt{-4\, \left ( x-1/2\,\sqrt{2} \right ) ^{2}-4\, \left ( x-1/2\,\sqrt{2} \right ) \sqrt{2}+2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x-1/4*arctanh(x*2^(1/2))*2^(1/2)+1/8*(-4*(x+1/2*2^(1/2))^2+4*(x+1/2*2^(1/2))*2^(1/2)+2)^(1/2)-1/8*2^(1/2)*
arctanh((1+(x+1/2*2^(1/2))*2^(1/2))*2^(1/2)/(-4*(x+1/2*2^(1/2))^2+4*(x+1/2*2^(1/2))*2^(1/2)+2)^(1/2))+1/8*(-4*
(x-1/2*2^(1/2))^2-4*(x-1/2*2^(1/2))*2^(1/2)+2)^(1/2)-1/8*2^(1/2)*arctanh((1-(x-1/2*2^(1/2))*2^(1/2))*2^(1/2)/(
-4*(x-1/2*2^(1/2))^2-4*(x-1/2*2^(1/2))*2^(1/2)+2)^(1/2))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x}{x - \sqrt{-x^{2} + 1}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(x/(x - sqrt(-x^2 + 1)), x)

________________________________________________________________________________________

Fricas [B]  time = 1.4693, size = 252, normalized size = 3.88 \begin{align*} \frac{1}{8} \, \sqrt{2} \log \left (\frac{6 \, x^{2} - 2 \, \sqrt{2}{\left (2 \, x^{2} - 3\right )} + 2 \, \sqrt{-x^{2} + 1}{\left (3 \, \sqrt{2} - 4\right )} - 9}{2 \, x^{2} - 1}\right ) + \frac{1}{8} \, \sqrt{2} \log \left (\frac{2 \, x^{2} - 2 \, \sqrt{2} x + 1}{2 \, x^{2} - 1}\right ) + \frac{1}{2} \, x + \frac{1}{2} \, \sqrt{-x^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*sqrt(2)*log((6*x^2 - 2*sqrt(2)*(2*x^2 - 3) + 2*sqrt(-x^2 + 1)*(3*sqrt(2) - 4) - 9)/(2*x^2 - 1)) + 1/8*sqrt
(2)*log((2*x^2 - 2*sqrt(2)*x + 1)/(2*x^2 - 1)) + 1/2*x + 1/2*sqrt(-x^2 + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x}{x - \sqrt{1 - x^{2}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Integral(x/(x - sqrt(1 - x**2)), x)

________________________________________________________________________________________

Giac [B]  time = 1.2391, size = 142, normalized size = 2.18 \begin{align*} \frac{1}{8} \, \sqrt{2} \log \left (\frac{{\left | 4 \, x - 2 \, \sqrt{2} \right |}}{{\left | 4 \, x + 2 \, \sqrt{2} \right |}}\right ) - \frac{1}{8} \, \sqrt{2} \log \left (\frac{{\left | -4 \, \sqrt{2} + \frac{2 \,{\left (\sqrt{-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 6 \right |}}{{\left | 4 \, \sqrt{2} + \frac{2 \,{\left (\sqrt{-x^{2} + 1} - 1\right )}^{2}}{x^{2}} - 6 \right |}}\right ) + \frac{1}{2} \, x + \frac{1}{2} \, \sqrt{-x^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*sqrt(2)*log(abs(4*x - 2*sqrt(2))/abs(4*x + 2*sqrt(2))) - 1/8*sqrt(2)*log(abs(-4*sqrt(2) + 2*(sqrt(-x^2 + 1
) - 1)^2/x^2 - 6)/abs(4*sqrt(2) + 2*(sqrt(-x^2 + 1) - 1)^2/x^2 - 6)) + 1/2*x + 1/2*sqrt(-x^2 + 1)