\(\int (-\sqrt {3}-\sqrt {4-x^2}+\sqrt {4-(1+x)^2}) \, dx\) [262]

   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 [F(-1)]

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.088, Rules used = {201, 222, 253} \[ \int \left (-\sqrt {3}-\sqrt {4-x^2}+\sqrt {4-(1+x)^2}\right ) \, dx=-2 \arcsin \left (\frac {x}{2}\right )+2 \arcsin \left (\frac {x+1}{2}\right )-\frac {1}{2} \sqrt {4-x^2} x-\sqrt {3} x+\frac {1}{2} (x+1) \sqrt {4-(x+1)^2} \]

[In]

Int[-Sqrt[3] - Sqrt[4 - x^2] + Sqrt[4 - (1 + x)^2],x]

[Out]

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

Rule 201

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 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 253

Int[((a_.) + (b_.)*(v_)^(n_))^(p_), x_Symbol] :> Dist[1/Coefficient[v, x, 1], Subst[Int[(a + b*x^n)^p, x], x,
v], x] /; FreeQ[{a, b, n, p}, x] && LinearQ[v, x] && NeQ[v, x]

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

Mathematica [A] (verified)

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

[In]

Integrate[-Sqrt[3] - Sqrt[4 - x^2] + Sqrt[4 - (1 + x)^2],x]

[Out]

-(Sqrt[3]*x) - (x*Sqrt[4 - x^2])/2 + ((1 + x)*Sqrt[3 - 2*x - x^2])/2 + 4*ArcTan[Sqrt[4 - x^2]/(2 + x)] - 4*Arc
Tan[Sqrt[3 - 2*x - x^2]/(3 + x)]

Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.84

method result size
default \(-\frac {\left (-2-2 x \right ) \sqrt {-x^{2}-2 x +3}}{4}+2 \arcsin \left (\frac {x}{2}+\frac {1}{2}\right )-x \sqrt {3}-\frac {x \sqrt {-x^{2}+4}}{2}-2 \arcsin \left (\frac {x}{2}\right )\) \(53\)
parts \(-\frac {\left (-2-2 x \right ) \sqrt {-x^{2}-2 x +3}}{4}+2 \arcsin \left (\frac {x}{2}+\frac {1}{2}\right )-x \sqrt {3}-\frac {x \sqrt {-x^{2}+4}}{2}-2 \arcsin \left (\frac {x}{2}\right )\) \(53\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 1.06 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.89 \[ \int \left (-\sqrt {3}-\sqrt {4-x^2}+\sqrt {4-(1+x)^2}\right ) \, dx=- \frac {x \sqrt {4 - x^{2}}}{2} - \sqrt {3} x + \begin {cases} \frac {i \left (x + 1\right )^{3}}{2 \sqrt {\left (x + 1\right )^{2} - 4}} - \frac {2 i \left (x + 1\right )}{\sqrt {\left (x + 1\right )^{2} - 4}} - 2 i \operatorname {acosh}{\left (\frac {x}{2} + \frac {1}{2} \right )} & \text {for}\: \left |{\left (x + 1\right )^{2}}\right | > 4 \\2 \operatorname {asin}{\left (\frac {x}{2} + \frac {1}{2} \right )} - \frac {\left (x + 1\right )^{3}}{2 \sqrt {4 - \left (x + 1\right )^{2}}} + \frac {2 \left (x + 1\right )}{\sqrt {4 - \left (x + 1\right )^{2}}} & \text {otherwise} \end {cases} - 2 \operatorname {asin}{\left (\frac {x}{2} \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \left (-\sqrt {3}-\sqrt {4-x^2}+\sqrt {4-(1+x)^2}\right ) \, dx=\int \sqrt {4-{\left (x+1\right )}^2}-\sqrt {3}-\sqrt {4-x^2} \,d x \]

[In]

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

[Out]

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