\(\int \frac {1}{4+\sqrt {4-x}-x} \, dx\) [695]

   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 = 16, antiderivative size = 14 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \log \left (1+\sqrt {4-x}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {31} \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \log \left (\sqrt {4-x}+1\right ) \]

[In]

Int[(4 + Sqrt[4 - x] - x)^(-1),x]

[Out]

-2*Log[1 + Sqrt[4 - x]]

Rule 31

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

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \log \left (1+\sqrt {4-x}\right ) \]

[In]

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

[Out]

-2*Log[1 + Sqrt[4 - x]]

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93

method result size
derivativedivides \(-2 \ln \left (1+\sqrt {4-x}\right )\) \(13\)
default \(-\ln \left (-3+x \right )-2 \,\operatorname {arctanh}\left (\sqrt {4-x}\right )\) \(18\)
trager \(-\ln \left (2 \sqrt {4-x}+5-x \right )\) \(18\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \, \log \left (\sqrt {-x + 4} + 1\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 32 vs. \(2 (12) = 24\).

Time = 0.65 (sec) , antiderivative size = 32, normalized size of antiderivative = 2.29 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=\log {\left (2 \sqrt {4 - x} \right )} - \log {\left (2 \sqrt {4 - x} + 2 \right )} - \log {\left (- x + \sqrt {4 - x} + 4 \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \, \log \left (\sqrt {-x + 4} + 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2 \, \log \left (\sqrt {-x + 4} + 1\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 17.96 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {1}{4+\sqrt {4-x}-x} \, dx=-2\,\ln \left (\sqrt {4-x}+1\right ) \]

[In]

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

[Out]

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