3.759 \(\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.101555, antiderivative size = 108, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 9, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {12, 1023, 634, 618, 204, 628, 635, 203, 260} \[ \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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 1023

Int[((g_.) + (h_.)*(x_))/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_) + (f_.)*(x_)^2)), x_Symbol] :> With[{q = Si
mplify[c^2*d^2 + b^2*d*f - 2*a*c*d*f + a^2*f^2]}, Dist[1/q, Int[Simp[g*c^2*d + g*b^2*f - a*b*h*f - a*g*c*f + c
*(h*c*d + g*b*f - a*h*f)*x, x]/(a + b*x + c*x^2), x], x] + Dist[1/q, Int[Simp[b*h*d*f - g*c*d*f + a*g*f^2 - f*
(h*c*d + g*b*f - a*h*f)*x, x]/(d + f*x^2), x], x] /; NeQ[q, 0]] /; FreeQ[{a, b, c, d, f, g, h}, x] && NeQ[b^2
- 4*a*c, 0]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

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

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

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

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

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

Mathematica [C]  time = 0.414437, size = 187, normalized size = 1.73 \[ \frac{1}{4} \left (\log \left (2 x^2+4 x+3\right )+i \sqrt{1-2 i \sqrt{2}} \tanh ^{-1}\left (\frac{i \sqrt{2} x+2 x+2 i \sqrt{2}+2}{\sqrt{2-4 i \sqrt{2}} \sqrt{-x^2-4 x-3}}\right )-i \sqrt{1+2 i \sqrt{2}} \tanh ^{-1}\left (\frac{\left (2-i \sqrt{2}\right ) x-2 i \sqrt{2}+2}{\sqrt{2+4 i \sqrt{2}} \sqrt{-x^2-4 x-3}}\right )+2 \sin ^{-1}(x+2)-2 \sqrt{2} \tan ^{-1}\left (\sqrt{2} (x+1)\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.026, size = 370, normalized size = 3.4 \begin{align*}{\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{{ \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+1 \right ) ^{-2}}}}} \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+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{{ \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+1 \right ) ^{-2}}}}} \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+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{{ \left ({{x}^{2} \left ( -{\frac{3}{2}}-x \right ) ^{-2}}-4 \right ) \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+1 \right ) ^{-2}}}}} \left ({x \left ( -{\frac{3}{2}}-x \right ) ^{-1}}+1 \right ) ^{-1}}+{\frac{\ln \left ( 2\,{x}^{2}+4\,x+3 \right ) }{4}}-{\frac{\sqrt{2}}{2}\arctan \left ({\frac{ \left ( 4\,x+4 \right ) \sqrt{2}}{4}} \right ) } \end{align*}

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)/(x/(-3/2-x)+1)^2)^(1/2)/(x/
(-3/2-x)+1)+1/3*3^(1/2)*4^(1/2)/((x^2/(-3/2-x)^2-4)/(x/(-3/2-x)+1)^2)^(1/2)/(x/(-3/2-x)+1)*(3*x^2/(-3/2-x)^2-1
2)^(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)/(x/(-3/2-x)+1)^2)^(1/2)/(x/(-3/2-x)+1)+1/4*ln(2*x^2+4*x+3)-1/2*2^(1/2)*arctan(1/4*(4*x+4)
*2^(1/2))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.82082, size = 529, normalized size = 4.9 \begin{align*} -\frac{1}{2} \, \sqrt{2} \arctan \left (\sqrt{2}{\left (x + 1\right )}\right ) + \frac{1}{4} \, \sqrt{2} \arctan \left (\frac{\sqrt{2} x + 3 \, \sqrt{2} \sqrt{-x^{2} - 4 \, x - 3}}{2 \,{\left (2 \, x + 3\right )}}\right ) + \frac{1}{4} \, \sqrt{2} \arctan \left (-\frac{\sqrt{2} x - 3 \, \sqrt{2} \sqrt{-x^{2} - 4 \, x - 3}}{2 \,{\left (2 \, x + 3\right )}}\right ) - \frac{1}{2} \, \arctan \left (\frac{\sqrt{-x^{2} - 4 \, x - 3}{\left (x + 2\right )}}{x^{2} + 4 \, x + 3}\right ) + \frac{1}{4} \, \log \left (2 \, x^{2} + 4 \, x + 3\right ) - \frac{1}{8} \, \log \left (-\frac{2 \, \sqrt{-x^{2} - 4 \, x - 3} x + 4 \, x + 3}{x^{2}}\right ) + \frac{1}{8} \, \log \left (\frac{2 \, \sqrt{-x^{2} - 4 \, x - 3} x - 4 \, x - 3}{x^{2}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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 [B]  time = 1.14987, size = 266, normalized size = 2.46 \begin{align*} -\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} \, \log \left (2 \, x^{2} + 4 \, x + 3\right ) + \frac{1}{4} \, \log \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} \, \log \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 ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(x+(-x^2-4*x-3)^(1/2)),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*log(2
*x^2 + 4*x + 3) + 1/4*log(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*log(2*(sqrt(-x^2 - 4*x - 3) - 1)/(x + 2) + (sqrt(-x^2 - 4*x - 3) - 1)^2/(x + 2)^2 + 3)