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

Optimal. Leaf size=108 \[ -\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 ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {12, 1037, 648, 632, 210, 642, 649, 209, 266} \begin {gather*} -\text {ArcTan}\left (\frac {\sqrt {-x-1}}{\sqrt {x+3}}\right )-\sqrt {2} \text {ArcTan}\left (\frac {1-\frac {3 \sqrt {-x-1}}{\sqrt {x+3}}}{\sqrt {2}}\right )+\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 ) \end {gather*}

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 209

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

Rule 210

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

Rule 266

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]

Rule 632

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 642

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 648

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 649

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 1037

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]

Rubi steps

\begin {align*} \int \frac {1}{x+\sqrt {-3-4 x-x^2}} \, dx &=2 \text {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 \text {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} \text {Subst}\left (\int \frac {-2-2 x}{1+x^2} \, dx,x,\frac {\sqrt {-1-x}}{\sqrt {3+x}}\right )+\frac {1}{2} \text {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} \text {Subst}\left (\int \frac {-2+6 x}{1-2 x+3 x^2} \, dx,x,\frac {\sqrt {-1-x}}{\sqrt {3+x}}\right )+2 \text {Subst}\left (\int \frac {1}{1-2 x+3 x^2} \, dx,x,\frac {\sqrt {-1-x}}{\sqrt {3+x}}\right )-\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {-1-x}}{\sqrt {3+x}}\right )-\text {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 \text {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 [A]
time = 0.23, size = 81, normalized size = 0.75 \begin {gather*} \frac {1}{2} \left (-2 \tan ^{-1}\left (\frac {\sqrt {-3-4 x-x^2}}{3+x}\right )-2 \sqrt {2} \tan ^{-1}\left (\frac {\sqrt {2} (1+x)}{1+x+\sqrt {-3-4 x-x^2}}\right )+\log \left (x+\sqrt {-3-4 x-x^2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(369\) vs. \(2(85)=170\).
time = 0.54, size = 370, normalized size = 3.43

method result size
default \(\frac {\arcsin \left (x +2\right )}{2}-\frac {\sqrt {3}\, \sqrt {4}\, \sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \left (\sqrt {2}\, \arctan \left (\frac {\sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \sqrt {2}}{6}\right )-\arctanh \left (\frac {3 x}{\left (-\frac {3}{2}-x \right ) \sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}}\right )\right )}{12 \sqrt {\frac {\frac {x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-4}{\left (1+\frac {x}{-\frac {3}{2}-x}\right )^{2}}}\, \left (1+\frac {x}{-\frac {3}{2}-x}\right )}+\frac {\sqrt {3}\, \sqrt {4}\, \sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \sqrt {2}\, \arctan \left (\frac {\sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \sqrt {2}}{6}\right )}{3 \sqrt {\frac {\frac {x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-4}{\left (1+\frac {x}{-\frac {3}{2}-x}\right )^{2}}}\, \left (1+\frac {x}{-\frac {3}{2}-x}\right )}-\frac {\sqrt {3}\, \sqrt {4}\, \sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \left (\sqrt {2}\, \arctan \left (\frac {\sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}\, \sqrt {2}}{6}\right )+\arctanh \left (\frac {3 x}{\left (-\frac {3}{2}-x \right ) \sqrt {\frac {3 x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-12}}\right )\right )}{6 \sqrt {\frac {\frac {x^{2}}{\left (-\frac {3}{2}-x \right )^{2}}-4}{\left (1+\frac {x}{-\frac {3}{2}-x}\right )^{2}}}\, \left (1+\frac {x}{-\frac {3}{2}-x}\right )}+\frac {\ln \left (2 x^{2}+4 x +3\right )}{4}-\frac {\sqrt {2}\, \arctan \left (\frac {\left (4+4 x \right ) \sqrt {2}}{4}\right )}{2}\) \(370\)
trager \(\text {Expression too large to display}\) \(908\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*arcsin(x+2)-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-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)/(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.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

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] Leaf count of result is larger than twice the leaf count of optimal. 187 vs. \(2 (85) = 170\).
time = 0.40, size = 187, normalized size = 1.73 \begin {gather*} -\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 {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{x + \sqrt {- x^{2} - 4 x - 3}}\, dx \end {gather*}

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] Leaf count of result is larger than twice the leaf count of optimal. 197 vs. \(2 (85) = 170\).
time = 2.17, size = 197, normalized size = 1.82 \begin {gather*} -\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 {gather*}

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)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{x+\sqrt {-x^2-4\,x-3}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________