\(\int \sqrt {(4-x) x} \, dx\) [980]

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

Optimal result

Integrand size = 11, antiderivative size = 33 \[ \int \sqrt {(4-x) x} \, dx=-\frac {1}{2} (2-x) \sqrt {4 x-x^2}-2 \arcsin \left (1-\frac {x}{2}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 33, 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.364, Rules used = {1976, 626, 633, 222} \[ \int \sqrt {(4-x) x} \, dx=-2 \arcsin \left (1-\frac {x}{2}\right )-\frac {1}{2} \sqrt {4 x-x^2} (2-x) \]

[In]

Int[Sqrt[(4 - x)*x],x]

[Out]

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

Rule 222

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 626

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

Rule 633

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

Rule 1976

Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))*((c_) + (d_.)*(x_)^(n_.)))^(p_), x_Symbol] :> Int[u*(a*c*e + (b*c
+ a*d)*e*x^n + b*d*e*x^(2*n))^p, x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {4 x-x^2} \, dx \\ & = -\frac {1}{2} (2-x) \sqrt {4 x-x^2}+2 \int \frac {1}{\sqrt {4 x-x^2}} \, dx \\ & = -\frac {1}{2} (2-x) \sqrt {4 x-x^2}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{16}}} \, dx,x,4-2 x\right ) \\ & = -\frac {1}{2} (2-x) \sqrt {4 x-x^2}-2 \sin ^{-1}\left (1-\frac {x}{2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.48 \[ \int \sqrt {(4-x) x} \, dx=\frac {1}{2} \sqrt {-((-4+x) x)} \left (-2+x-\frac {16 \text {arctanh}\left (\frac {\sqrt {-4+x}}{-2+\sqrt {x}}\right )}{\sqrt {-4+x} \sqrt {x}}\right ) \]

[In]

Integrate[Sqrt[(4 - x)*x],x]

[Out]

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

Maple [A] (verified)

Time = 1.16 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.82

method result size
risch \(-\frac {\left (x -2\right ) x \left (x -4\right )}{2 \sqrt {-x \left (x -4\right )}}+2 \arcsin \left (-1+\frac {x}{2}\right )\) \(27\)
default \(-\frac {\left (4-2 x \right ) \sqrt {-x^{2}+4 x}}{4}+2 \arcsin \left (-1+\frac {x}{2}\right )\) \(28\)
pseudoelliptic \(-4 \arctan \left (\frac {\sqrt {-x \left (x -4\right )}}{x}\right )+\frac {\left (x -2\right ) \sqrt {-x \left (x -4\right )}}{2}\) \(30\)
meijerg \(-\frac {8 i \left (-\frac {i \sqrt {\pi }\, \sqrt {x}\, \left (-\frac {3 x}{2}+3\right ) \sqrt {-\frac {x}{4}+1}}{12}+\frac {i \sqrt {\pi }\, \arcsin \left (\frac {\sqrt {x}}{2}\right )}{2}\right )}{\sqrt {\pi }}\) \(41\)
trager \(\left (-1+\frac {x}{2}\right ) \sqrt {-x^{2}+4 x}+2 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) x +\sqrt {-x^{2}+4 x}+2 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )\right )\) \(57\)

[In]

int(((4-x)*x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.06 \[ \int \sqrt {(4-x) x} \, dx=\frac {1}{2} \, \sqrt {-x^{2} + 4 \, x} {\left (x - 2\right )} - 4 \, \arctan \left (\frac {\sqrt {-x^{2} + 4 \, x}}{x}\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.51 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.67 \[ \int \sqrt {(4-x) x} \, dx=\left (\frac {x}{2} - 1\right ) \sqrt {- x^{2} + 4 x} + 2 \operatorname {asin}{\left (\frac {x}{2} - 1 \right )} \]

[In]

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

[Out]

(x/2 - 1)*sqrt(-x**2 + 4*x) + 2*asin(x/2 - 1)

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.09 \[ \int \sqrt {(4-x) x} \, dx=\frac {1}{2} \, \sqrt {-x^{2} + 4 \, x} x - \sqrt {-x^{2} + 4 \, x} - 2 \, \arcsin \left (-\frac {1}{2} \, x + 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.76 \[ \int \sqrt {(4-x) x} \, dx=\frac {1}{2} \, \sqrt {-x^{2} + 4 \, x} {\left (x - 2\right )} + 2 \, \arcsin \left (\frac {1}{2} \, x - 1\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 21.65 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.79 \[ \int \sqrt {(4-x) x} \, dx=2\,\mathrm {asin}\left (\frac {x}{2}-1\right )+\left (\frac {x}{2}-1\right )\,\sqrt {4\,x-x^2} \]

[In]

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

[Out]

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