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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.30, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {6742, 195, 216, 697, 402, 377, 207} \[ -\frac {x^2}{4}+\frac {1}{4} \sqrt {2-x^2} x-\frac {1}{2} \tanh ^{-1}\left (\frac {x}{\sqrt {2-x^2}}\right )+\frac {1}{4} \log (1-x)+\frac {1}{4} \log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 195

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(x*(a + b*x^n)^p)/(n*p + 1), x] + Dist[(a*n*p)/(n*p + 1),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

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

Rule 216

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

Rule 377

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

Rule 402

Int[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Dist[b/d, Int[(a + b*x^2)^(p - 1), x], x]
- Dist[(b*c - a*d)/d, Int[(a + b*x^2)^(p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d,
0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4])

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 77, normalized size = 1.28 \[ \frac {1}{4} \left (-x^2+\sqrt {2-x^2} x+\log \left (1-x^2\right )-\log \left (\sqrt {2-x^2}-x+2\right )+\log \left (\sqrt {2-x^2}+x+2\right )+\log (1-x)-\log (x+1)\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-x^2 + x*Sqrt[2 - x^2] + Log[1 - x] - Log[1 + x] + Log[1 - x^2] - Log[2 - x + Sqrt[2 - x^2]] + Log[2 + x + Sq
rt[2 - x^2]])/4

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 67, normalized size = 1.12 \[ -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left (x^{2} - 1\right ) - \frac {1}{8} \, \log \left (-\frac {\sqrt {-x^{2} + 2} x + 1}{x^{2}}\right ) + \frac {1}{8} \, \log \left (\frac {\sqrt {-x^{2} + 2} x - 1}{x^{2}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.51, size = 117, normalized size = 1.95 \[ -\frac {1}{4} \, x^{2} + \frac {1}{4} \, \sqrt {-x^{2} + 2} x + \frac {1}{4} \, \log \left ({\left | x^{2} - 1 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} + 2 \right |}\right ) + \frac {1}{4} \, \log \left ({\left | \frac {x}{\sqrt {2} - \sqrt {-x^{2} + 2}} - \frac {\sqrt {2} - \sqrt {-x^{2} + 2}}{x} - 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.02, size = 111, normalized size = 1.85 \[ -\frac {x^{2}}{4}+\frac {\sqrt {-x^{2}+2}\, x}{4}-\frac {\arctanh \left (\frac {-2 x +4}{2 \sqrt {-2 x -\left (x -1\right )^{2}+3}}\right )}{4}+\frac {\arctanh \left (\frac {2 x +4}{2 \sqrt {2 x -\left (x +1\right )^{2}+3}}\right )}{4}+\frac {\ln \left (x -1\right )}{4}+\frac {\ln \left (x +1\right )}{4}+\frac {\sqrt {-2 x -\left (x -1\right )^{2}+3}}{4}-\frac {\sqrt {2 x -\left (x +1\right )^{2}+3}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ -\frac {1}{2} \, x^{2} - \int -\frac {x^{2}}{x - \sqrt {-x^{2} + 2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 3.38, size = 86, normalized size = 1.43 \[ \frac {\ln \left (x-1\right )}{4}+\frac {\ln \left (x+1\right )}{4}-\frac {\ln \left (\frac {-x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x-1}\right )}{4}+\frac {\ln \left (\frac {x\,1{}\mathrm {i}+\sqrt {2-x^2}\,1{}\mathrm {i}+2{}\mathrm {i}}{x+1}\right )}{4}+\frac {x\,\sqrt {2-x^2}}{4}-\frac {x^2}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1)/4 + log(x + 1)/4 - log(((2 - x^2)^(1/2)*1i - x*1i + 2i)/(x - 1))/4 + log((x*1i + (2 - x^2)^(1/2)*1i
 + 2i)/(x + 1))/4 + (x*(2 - x^2)^(1/2))/4 - x^2/4

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sqrt {2 - x^{2}}}{x - \sqrt {2 - x^{2}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________