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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {6742, 43, 685, 688, 207} \[ -\frac {1}{2} \sqrt {2 x-x^2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {2 x-x^2}\right )-\frac {x}{2}-\frac {1}{2} \log (1-x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

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 685

Int[((d_) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[((d + e*x)^(m + 1)*(
a + b*x + c*x^2)^p)/(e*(m + 2*p + 1)), x] - Dist[(d*p*(b^2 - 4*a*c))/(b*e*(m + 2*p + 1)), Int[(d + e*x)^m*(a +
 b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e, 0] &&
 NeQ[m + 2*p + 3, 0] && GtQ[p, 0] &&  !LtQ[m, -1] &&  !(IGtQ[(m - 1)/2, 0] && ( !IntegerQ[p] || LtQ[m, 2*p]))
&& RationalQ[m] && IntegerQ[2*p]

Rule 688

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[4*c, Subst[Int[1/(b^2*e
 - 4*a*c*e + 4*c*e*x^2), x], x, Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0]
 && EqQ[2*c*d - b*e, 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-x^2}}{2-2 x} \, dx &=\int \left (-\frac {x}{2 (-1+x)}+\frac {\sqrt {2 x-x^2}}{2 (1-x)}\right ) \, dx\\ &=-\left (\frac {1}{2} \int \frac {x}{-1+x} \, dx\right )+\frac {1}{2} \int \frac {\sqrt {2 x-x^2}}{1-x} \, dx\\ &=-\frac {1}{2} \sqrt {2 x-x^2}-\frac {1}{2} \int \left (1+\frac {1}{-1+x}\right ) \, dx+\frac {1}{2} \int \frac {1}{(1-x) \sqrt {2 x-x^2}} \, dx\\ &=-\frac {x}{2}-\frac {1}{2} \sqrt {2 x-x^2}-\frac {1}{2} \log (1-x)-2 \operatorname {Subst}\left (\int \frac {1}{-4+4 x^2} \, dx,x,\sqrt {2 x-x^2}\right )\\ &=-\frac {x}{2}-\frac {1}{2} \sqrt {2 x-x^2}+\frac {1}{2} \tanh ^{-1}\left (\sqrt {2 x-x^2}\right )-\frac {1}{2} \log (1-x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 39, normalized size = 0.76 \[ \frac {1}{2} \left (-x-\sqrt {-((x-2) x)}-\log (1-x)+\tanh ^{-1}\left (\sqrt {-((x-2) x)}\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 66, normalized size = 1.29 \[ -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (\frac {x + \sqrt {-x^{2} + 2 \, x}}{x}\right ) - \frac {1}{2} \, \log \left (-\frac {x - \sqrt {-x^{2} + 2 \, x}}{x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.48, size = 50, normalized size = 0.98 \[ -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (-\frac {2 \, {\left (\sqrt {-x^{2} + 2 \, x} - 1\right )}}{{\left | -2 \, x + 2 \right |}}\right ) - \frac {1}{2} \, \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 38, normalized size = 0.75 \[ -\frac {x}{2}+\frac {\arctanh \left (\frac {1}{\sqrt {-\left (x -1\right )^{2}+1}}\right )}{2}-\frac {\ln \left (x -1\right )}{2}-\frac {\sqrt {-\left (x -1\right )^{2}+1}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.98, size = 54, normalized size = 1.06 \[ -\frac {1}{2} \, x - \frac {1}{2} \, \sqrt {-x^{2} + 2 \, x} - \frac {1}{2} \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (\frac {2 \, \sqrt {-x^{2} + 2 \, x}}{{\left | x - 1 \right |}} + \frac {2}{{\left | x - 1 \right |}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________