3.603 \(\int \frac{1}{x+\sqrt{-3-4 x-x^2}} \, dx\)

Optimal. Leaf size=108 \[ \frac{1}{2} \log (x+3)+\frac{1}{2} \log \left (\frac{\sqrt{-x-1} x+\sqrt{x+3} x+3 \sqrt{-x-1}}{(x+3)^{3/2}}\right )-\tan ^{-1}\left (\frac{\sqrt{-x-1}}{\sqrt{x+3}}\right )-\sqrt{2} \tan ^{-1}\left (\frac{1-\frac{3 \sqrt{-x-1}}{\sqrt{x+3}}}{\sqrt{2}}\right ) \]

[Out]

-ArcTan[Sqrt[-1 - x]/Sqrt[3 + x]] - Sqrt[2]*ArcTan[(1 - (3*Sqrt[-1 - x])/Sqrt[3
+ x])/Sqrt[2]] + Log[3 + x]/2 + Log[(3*Sqrt[-1 - x] + Sqrt[-1 - x]*x + x*Sqrt[3
+ x])/(3 + x)^(3/2)]/2

_______________________________________________________________________________________

Rubi [A]  time = 0.183887, antiderivative size = 108, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 8, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.444 \[ \frac{1}{2} \log (x+3)+\frac{1}{2} \log \left (\frac{\sqrt{-x-1} x+\sqrt{x+3} x+3 \sqrt{-x-1}}{(x+3)^{3/2}}\right )-\tan ^{-1}\left (\frac{\sqrt{-x-1}}{\sqrt{x+3}}\right )-\sqrt{2} \tan ^{-1}\left (\frac{1-\frac{3 \sqrt{-x-1}}{\sqrt{x+3}}}{\sqrt{2}}\right ) \]

Antiderivative was successfully verified.

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

[Out]

-ArcTan[Sqrt[-1 - x]/Sqrt[3 + x]] - Sqrt[2]*ArcTan[(1 - (3*Sqrt[-1 - x])/Sqrt[3
+ x])/Sqrt[2]] + Log[3 + x]/2 + Log[(3*Sqrt[-1 - x] + Sqrt[-1 - x]*x + x*Sqrt[3
+ x])/(3 + x)^(3/2)]/2

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 7.88414, size = 114, normalized size = 1.06 \[ - \frac{\log{\left (1 + \frac{- x^{2} - 4 x - 3}{\left (x + 3\right )^{2}} \right )}}{2} + \frac{\log{\left (1 - \frac{2 \sqrt{- x^{2} - 4 x - 3}}{x + 3} + \frac{3 \left (- x^{2} - 4 x - 3\right )}{\left (x + 3\right )^{2}} \right )}}{2} + \sqrt{2} \operatorname{atan}{\left (\sqrt{2} \left (- \frac{1}{2} + \frac{3 \sqrt{- x^{2} - 4 x - 3}}{2 \left (x + 3\right )}\right ) \right )} - \operatorname{atan}{\left (\frac{\sqrt{- x^{2} - 4 x - 3}}{x + 3} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(x+(-x**2-4*x-3)**(1/2)),x)

[Out]

-log(1 + (-x**2 - 4*x - 3)/(x + 3)**2)/2 + log(1 - 2*sqrt(-x**2 - 4*x - 3)/(x +
3) + 3*(-x**2 - 4*x - 3)/(x + 3)**2)/2 + sqrt(2)*atan(sqrt(2)*(-1/2 + 3*sqrt(-x*
*2 - 4*x - 3)/(2*(x + 3)))) - atan(sqrt(-x**2 - 4*x - 3)/(x + 3))

_______________________________________________________________________________________

Mathematica [C]  time = 6.25724, size = 1119, normalized size = 10.36 \[ \frac{1}{2} \sin ^{-1}(x+2)-\frac{\tan ^{-1}\left (\sqrt{2} (x+1)\right )}{\sqrt{2}}-\frac{i \left (i+2 \sqrt{2}\right ) \tan ^{-1}\left (\frac{6 i \sqrt{2} x^4-16 x^4+18 i \sqrt{1-2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x^3+68 i \sqrt{2} x^3-68 x^3+72 i \sqrt{1-2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x^2+185 i \sqrt{2} x^2-44 x^2+99 i \sqrt{1-2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x+176 i \sqrt{2} x+68 x+54 i \sqrt{1-2 i \sqrt{2}} \sqrt{-x^2-4 x-3}+51 i \sqrt{2}+60}{32 \sqrt{2} x^4+66 i x^4+208 \sqrt{2} x^3+304 i x^3+466 \sqrt{2} x^2+493 i x^2+440 \sqrt{2} x+340 i x+150 \sqrt{2}+93 i}\right )}{4 \sqrt{1-2 i \sqrt{2}}}-\frac{i \left (-i+2 \sqrt{2}\right ) \tan ^{-1}\left (\frac{6 i \sqrt{2} x^4+16 x^4+18 i \sqrt{1+2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x^3+68 i \sqrt{2} x^3+68 x^3+72 i \sqrt{1+2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x^2+185 i \sqrt{2} x^2+44 x^2+99 i \sqrt{1+2 i \sqrt{2}} \sqrt{-x^2-4 x-3} x+176 i \sqrt{2} x-68 x+54 i \sqrt{1+2 i \sqrt{2}} \sqrt{-x^2-4 x-3}+51 i \sqrt{2}-60}{32 \sqrt{2} x^4-66 i x^4+208 \sqrt{2} x^3-304 i x^3+466 \sqrt{2} x^2-493 i x^2+440 \sqrt{2} x-340 i x+150 \sqrt{2}-93 i}\right )}{4 \sqrt{1+2 i \sqrt{2}}}+\frac{\left (i+2 \sqrt{2}\right ) \log \left (\left (-2 i x+\sqrt{2}-2 i\right )^2 \left (2 i x+\sqrt{2}+2 i\right )^2\right )}{8 \sqrt{1-2 i \sqrt{2}}}+\frac{\left (-i+2 \sqrt{2}\right ) \log \left (\left (-2 i x+\sqrt{2}-2 i\right )^2 \left (2 i x+\sqrt{2}+2 i\right )^2\right )}{8 \sqrt{1+2 i \sqrt{2}}}+\frac{1}{4} \log \left (2 x^2+4 x+3\right )-\frac{\left (i+2 \sqrt{2}\right ) \log \left (\left (2 x^2+4 x+3\right ) \left (2 i \sqrt{2} x^2+2 x^2-2 \sqrt{2 \left (1-2 i \sqrt{2}\right )} \sqrt{-x^2-4 x-3} x+8 i \sqrt{2} x+4 x-2 \sqrt{2 \left (1-2 i \sqrt{2}\right )} \sqrt{-x^2-4 x-3}+6 i \sqrt{2}+3\right )\right )}{8 \sqrt{1-2 i \sqrt{2}}}-\frac{\left (-i+2 \sqrt{2}\right ) \log \left (\left (2 x^2+4 x+3\right ) \left (-2 i \sqrt{2} x^2+2 x^2-2 \sqrt{2 \left (1+2 i \sqrt{2}\right )} \sqrt{-x^2-4 x-3} x-8 i \sqrt{2} x+4 x-2 \sqrt{2 \left (1+2 i \sqrt{2}\right )} \sqrt{-x^2-4 x-3}-6 i \sqrt{2}+3\right )\right )}{8 \sqrt{1+2 i \sqrt{2}}} \]

Antiderivative was successfully verified.

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

[Out]

ArcSin[2 + x]/2 - ArcTan[Sqrt[2]*(1 + x)]/Sqrt[2] - ((I/4)*(I + 2*Sqrt[2])*ArcTa
n[(60 + (51*I)*Sqrt[2] + 68*x + (176*I)*Sqrt[2]*x - 44*x^2 + (185*I)*Sqrt[2]*x^2
 - 68*x^3 + (68*I)*Sqrt[2]*x^3 - 16*x^4 + (6*I)*Sqrt[2]*x^4 + (54*I)*Sqrt[1 - (2
*I)*Sqrt[2]]*Sqrt[-3 - 4*x - x^2] + (99*I)*Sqrt[1 - (2*I)*Sqrt[2]]*x*Sqrt[-3 - 4
*x - x^2] + (72*I)*Sqrt[1 - (2*I)*Sqrt[2]]*x^2*Sqrt[-3 - 4*x - x^2] + (18*I)*Sqr
t[1 - (2*I)*Sqrt[2]]*x^3*Sqrt[-3 - 4*x - x^2])/(93*I + 150*Sqrt[2] + (340*I)*x +
 440*Sqrt[2]*x + (493*I)*x^2 + 466*Sqrt[2]*x^2 + (304*I)*x^3 + 208*Sqrt[2]*x^3 +
 (66*I)*x^4 + 32*Sqrt[2]*x^4)])/Sqrt[1 - (2*I)*Sqrt[2]] - ((I/4)*(-I + 2*Sqrt[2]
)*ArcTan[(-60 + (51*I)*Sqrt[2] - 68*x + (176*I)*Sqrt[2]*x + 44*x^2 + (185*I)*Sqr
t[2]*x^2 + 68*x^3 + (68*I)*Sqrt[2]*x^3 + 16*x^4 + (6*I)*Sqrt[2]*x^4 + (54*I)*Sqr
t[1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[-3 - 4*x - x^2])])/(8*Sqrt[1 + (2
*I)*Sqrt[2]])

_______________________________________________________________________________________

Maple [B]  time = 0.013, size = 370, normalized size = 3.4 \[{\frac{\arcsin \left ( 2+x \right ) }{2}}-{\frac{\sqrt{3}\sqrt{4}}{12}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12} \left ( \sqrt{2}\arctan \left ({\frac{\sqrt{2}}{6}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}} \right ) -{\it Artanh} \left ( 3\,{\frac{x}{-3/2-x}{\frac{1}{\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}}}} \right ) \right ){\frac{1}{\sqrt{{1 \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-2}}}}} \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-1}}+{\frac{\sqrt{3}\sqrt{4}\sqrt{2}}{3}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}\arctan \left ({\frac{\sqrt{2}}{6}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}} \right ){\frac{1}{\sqrt{{1 \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-2}}}}} \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-1}}-{\frac{\sqrt{3}\sqrt{4}}{6}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12} \left ( \sqrt{2}\arctan \left ({\frac{\sqrt{2}}{6}\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}} \right ) +{\it Artanh} \left ( 3\,{\frac{x}{-3/2-x}{\frac{1}{\sqrt{3\,{\frac{{x}^{2}}{ \left ( -3/2-x \right ) ^{2}}}-12}}}} \right ) \right ){\frac{1}{\sqrt{{1 \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-2}}}}} \left ( 1+{x \left ( -{\frac{3}{2}}-x \right ) ^{-1}} \right ) ^{-1}}+{\frac{\ln \left ( 2\,{x}^{2}+4\,x+3 \right ) }{4}}-{\frac{\sqrt{2}}{2}\arctan \left ({\frac{ \left ( 4+4\,x \right ) \sqrt{2}}{4}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(x+(-x^2-4*x-3)^(1/2)),x)

[Out]

1/2*arcsin(2+x)-1/12*3^(1/2)*4^(1/2)*(3*x^2/(-3/2-x)^2-12)^(1/2)*(2^(1/2)*arctan
(1/6*(3*x^2/(-3/2-x)^2-12)^(1/2)*2^(1/2))-arctanh(3*x/(-3/2-x)/(3*x^2/(-3/2-x)^2
-12)^(1/2)))/((x^2/(-3/2-x)^2-4)/(1+x/(-3/2-x))^2)^(1/2)/(1+x/(-3/2-x))+1/3*3^(1
/2)*4^(1/2)/((x^2/(-3/2-x)^2-4)/(1+x/(-3/2-x))^2)^(1/2)/(1+x/(-3/2-x))*(3*x^2/(-
3/2-x)^2-12)^(1/2)*2^(1/2)*arctan(1/6*(3*x^2/(-3/2-x)^2-12)^(1/2)*2^(1/2))-1/6*3
^(1/2)*4^(1/2)*(3*x^2/(-3/2-x)^2-12)^(1/2)*(2^(1/2)*arctan(1/6*(3*x^2/(-3/2-x)^2
-12)^(1/2)*2^(1/2))+arctanh(3*x/(-3/2-x)/(3*x^2/(-3/2-x)^2-12)^(1/2)))/((x^2/(-3
/2-x)^2-4)/(1+x/(-3/2-x))^2)^(1/2)/(1+x/(-3/2-x))+1/4*ln(2*x^2+4*x+3)-1/2*2^(1/2
)*arctan(1/4*(4+4*x)*2^(1/2))

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(x + sqrt(-x^2 - 4*x - 3)),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.281618, size = 248, normalized size = 2.3 \[ \frac{1}{16} \, \sqrt{2}{\left (4 \, \sqrt{2} \arctan \left (\frac{x + 2}{\sqrt{-x^{2} - 4 \, x - 3}}\right ) + 2 \, \sqrt{2} \log \left (2 \, x^{2} + 4 \, x + 3\right ) - \sqrt{2} \log \left (-\frac{2 \, \sqrt{-x^{2} - 4 \, x - 3} x + 4 \, x + 3}{x^{2}}\right ) + \sqrt{2} \log \left (\frac{2 \, \sqrt{-x^{2} - 4 \, x - 3} x - 4 \, x - 3}{x^{2}}\right ) - 8 \, \arctan \left (\sqrt{2}{\left (x + 1\right )}\right ) + 4 \, \arctan \left (\frac{\sqrt{2} x + 3 \, \sqrt{2} \sqrt{-x^{2} - 4 \, x - 3}}{2 \,{\left (2 \, x + 3\right )}}\right ) + 4 \, \arctan \left (-\frac{\sqrt{2} x - 3 \, \sqrt{2} \sqrt{-x^{2} - 4 \, x - 3}}{2 \,{\left (2 \, x + 3\right )}}\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(x + sqrt(-x^2 - 4*x - 3)),x, algorithm="fricas")

[Out]

1/16*sqrt(2)*(4*sqrt(2)*arctan((x + 2)/sqrt(-x^2 - 4*x - 3)) + 2*sqrt(2)*log(2*x
^2 + 4*x + 3) - sqrt(2)*log(-(2*sqrt(-x^2 - 4*x - 3)*x + 4*x + 3)/x^2) + sqrt(2)
*log((2*sqrt(-x^2 - 4*x - 3)*x - 4*x - 3)/x^2) - 8*arctan(sqrt(2)*(x + 1)) + 4*a
rctan(1/2*(sqrt(2)*x + 3*sqrt(2)*sqrt(-x^2 - 4*x - 3))/(2*x + 3)) + 4*arctan(-1/
2*(sqrt(2)*x - 3*sqrt(2)*sqrt(-x^2 - 4*x - 3))/(2*x + 3)))

_______________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{1}{x + \sqrt{- x^{2} - 4 x - 3}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.274925, size = 266, normalized size = 2.46 \[ -\frac{1}{2} \, \sqrt{2} \arctan \left (\sqrt{2}{\left (x + 1\right )}\right ) + \frac{1}{2} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\frac{3 \,{\left (\sqrt{-x^{2} - 4 \, x - 3} - 1\right )}}{x + 2} + 1\right )}\right ) + \frac{1}{2} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\frac{\sqrt{-x^{2} - 4 \, x - 3} - 1}{x + 2} + 1\right )}\right ) + \frac{1}{2} \, \arcsin \left (x + 2\right ) + \frac{1}{4} \,{\rm ln}\left (2 \, x^{2} + 4 \, x + 3\right ) + \frac{1}{4} \,{\rm ln}\left (\frac{2 \,{\left (\sqrt{-x^{2} - 4 \, x - 3} - 1\right )}}{x + 2} + \frac{3 \,{\left (\sqrt{-x^{2} - 4 \, x - 3} - 1\right )}^{2}}{{\left (x + 2\right )}^{2}} + 1\right ) - \frac{1}{4} \,{\rm ln}\left (\frac{2 \,{\left (\sqrt{-x^{2} - 4 \, x - 3} - 1\right )}}{x + 2} + \frac{{\left (\sqrt{-x^{2} - 4 \, x - 3} - 1\right )}^{2}}{{\left (x + 2\right )}^{2}} + 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(x + sqrt(-x^2 - 4*x - 3)),x, algorithm="giac")

[Out]

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