3.219 \(\int \frac {\sqrt {4+x}}{x} \, dx\)

Optimal. Leaf size=24 \[ 2 \sqrt {x+4}-4 \tanh ^{-1}\left (\frac {\sqrt {x+4}}{2}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {50, 63, 207} \[ 2 \sqrt {x+4}-4 \tanh ^{-1}\left (\frac {\sqrt {x+4}}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[4 + x]/x,x]

[Out]

2*Sqrt[4 + x] - 4*ArcTanh[Sqrt[4 + x]/2]

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 207

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 24, normalized size = 1.00 \[ 2 \sqrt {x+4}-4 \tanh ^{-1}\left (\frac {\sqrt {x+4}}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[4 + x]/x,x]

[Out]

2*Sqrt[4 + x] - 4*ArcTanh[Sqrt[4 + x]/2]

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 28, normalized size = 1.17 \[ 2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x + 4) - 2*log(sqrt(x + 4) + 2) + 2*log(sqrt(x + 4) - 2)

________________________________________________________________________________________

giac [A]  time = 0.85, size = 29, normalized size = 1.21 \[ 2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left ({\left | \sqrt {x + 4} - 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x + 4) - 2*log(sqrt(x + 4) + 2) + 2*log(abs(sqrt(x + 4) - 2))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 29, normalized size = 1.21 \[ 2 \ln \left (\sqrt {x +4}-2\right )-2 \ln \left (\sqrt {x +4}+2\right )+2 \sqrt {x +4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.51, size = 28, normalized size = 1.17 \[ 2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*sqrt(x + 4) - 2*log(sqrt(x + 4) + 2) + 2*log(sqrt(x + 4) - 2)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 18, normalized size = 0.75 \[ 2\,\sqrt {x+4}-4\,\mathrm {atanh}\left (\frac {\sqrt {x+4}}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.92, size = 44, normalized size = 1.83 \[ \begin {cases} 2 \sqrt {x + 4} - 4 \operatorname {acoth}{\left (\frac {\sqrt {x + 4}}{2} \right )} & \text {for}\: \frac {\left |{x + 4}\right |}{4} > 1 \\2 \sqrt {x + 4} - 4 \operatorname {atanh}{\left (\frac {\sqrt {x + 4}}{2} \right )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((2*sqrt(x + 4) - 4*acoth(sqrt(x + 4)/2), Abs(x + 4)/4 > 1), (2*sqrt(x + 4) - 4*atanh(sqrt(x + 4)/2),
 True))

________________________________________________________________________________________