\(\int \frac {\sqrt {4+x}}{x} \, dx\) [219]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 24 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \sqrt {4+x}-4 \text {arctanh}\left (\frac {\sqrt {4+x}}{2}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {52, 65, 213} \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \sqrt {x+4}-4 \text {arctanh}\left (\frac {\sqrt {x+4}}{2}\right ) \]

[In]

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

[Out]

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

Rule 52

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 65

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 213

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

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \sqrt {4+x}-4 \text {arctanh}\left (\frac {\sqrt {4+x}}{2}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17

method result size
trager \(2 \sqrt {4+x}+2 \ln \left (\frac {-8-x +4 \sqrt {4+x}}{x}\right )\) \(28\)
derivativedivides \(2 \sqrt {4+x}-2 \ln \left (\sqrt {4+x}+2\right )+2 \ln \left (\sqrt {4+x}-2\right )\) \(29\)
default \(2 \sqrt {4+x}-2 \ln \left (\sqrt {4+x}+2\right )+2 \ln \left (\sqrt {4+x}-2\right )\) \(29\)
meijerg \(-\frac {-2 \left (2-4 \ln \left (2\right )+\ln \left (x \right )\right ) \sqrt {\pi }+4 \sqrt {\pi }-4 \sqrt {\pi }\, \sqrt {1+\frac {x}{4}}+4 \sqrt {\pi }\, \ln \left (\frac {1}{2}+\frac {\sqrt {1+\frac {x}{4}}}{2}\right )}{\sqrt {\pi }}\) \(54\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \]

[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)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (19) = 38\).

Time = 0.51 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.75 \[ \int \frac {\sqrt {4+x}}{x} \, dx=\begin {cases} 2 \sqrt {x + 4} - 4 \operatorname {acoth}{\left (\frac {\sqrt {x + 4}}{2} \right )} & \text {for}\: \left |{x + 4}\right | > 4 \\2 \sqrt {x + 4} - 4 \operatorname {atanh}{\left (\frac {\sqrt {x + 4}}{2} \right )} & \text {otherwise} \end {cases} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left ({\left | \sqrt {x + 4} - 2 \right |}\right ) \]

[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))

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.75 \[ \int \frac {\sqrt {4+x}}{x} \, dx=2\,\sqrt {x+4}-4\,\mathrm {atanh}\left (\frac {\sqrt {x+4}}{2}\right ) \]

[In]

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

[Out]

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