Optimal. Leaf size=24 \[ 2 \sqrt {4+x}-4 \tanh ^{-1}\left (\frac {\sqrt {4+x}}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.00, 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 = {52, 65, 213}
\begin {gather*} 2 \sqrt {x+4}-4 \tanh ^{-1}\left (\frac {\sqrt {x+4}}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 213
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 \text {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 \begin {gather*} 2 \sqrt {4+x}-4 \tanh ^{-1}\left (\frac {\sqrt {4+x}}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 2.28, size = 45, normalized size = 1.88 \begin {gather*} \text {Piecewise}\left [\left \{\left \{-4 \text {ArcCoth}\left [\frac {\sqrt {4+x}}{2}\right ]+2 \sqrt {4+x},\text {Abs}\left [4+x\right ]>4\right \}\right \},-4 \text {ArcTanh}\left [\frac {\sqrt {4+x}}{2}\right ]+2 \sqrt {4+x}\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 29, normalized size = 1.21
method | result | size |
trager | \(2 \sqrt {4+x}-2 \ln \left (\frac {4 \sqrt {4+x}+8+x}{x}\right )\) | \(26\) |
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\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 28, normalized size = 1.17 \begin {gather*} 2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.33, size = 28, normalized size = 1.17 \begin {gather*} 2 \, \sqrt {x + 4} - 2 \, \log \left (\sqrt {x + 4} + 2\right ) + 2 \, \log \left (\sqrt {x + 4} - 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.43, size = 42, normalized size = 1.75 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 36, normalized size = 1.50 \begin {gather*} 2 \ln \left |\sqrt {x+4}-2\right |-2 \ln \left (\sqrt {x+4}+2\right )+2 \sqrt {x+4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.04, size = 18, normalized size = 0.75 \begin {gather*} 2\,\sqrt {x+4}-4\,\mathrm {atanh}\left (\frac {\sqrt {x+4}}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________