\(\int \frac {x}{4-x^2+\sqrt {4-x^2}} \, dx\) [114]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (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 = 22, antiderivative size = 16 \[ \int \frac {x}{4-x^2+\sqrt {4-x^2}} \, dx=-\log \left (1+\sqrt {4-x^2}\right ) \]

[Out]

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

Rubi [A] (verified)

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

[In]

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

[Out]

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

Rule 31

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

Rule 2186

Int[(x_)^(m_.)/((c_) + (d_.)*(x_)^(n_) + (e_.)*Sqrt[(a_) + (b_.)*(x_)^(n_)]), x_Symbol] :> Dist[1/n, Subst[Int
[x^((m + 1)/n - 1)/(c + d*x + e*Sqrt[a + b*x]), x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && EqQ[b*c
- a*d, 0] && IntegerQ[(m + 1)/n]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06

method result size
trager \(-\ln \left (-1-\sqrt {-x^{2}+4}\right )\) \(17\)
default \(-\frac {\ln \left (x^{2}-3\right )}{2}+\frac {\sqrt {-\left (-2+x \right )^{2}-4 x +8}-2 \arcsin \left (\frac {x}{2}\right )}{2 \left (2+\sqrt {3}\right ) \left (-2+\sqrt {3}\right )}+\frac {\sqrt {-\left (2+x \right )^{2}+4 x +8}+2 \arcsin \left (\frac {x}{2}\right )}{2 \left (2+\sqrt {3}\right ) \left (-2+\sqrt {3}\right )}-\frac {\sqrt {-\left (x -\sqrt {3}\right )^{2}-2 \sqrt {3}\, \left (x -\sqrt {3}\right )+1}-\sqrt {3}\, \arcsin \left (\frac {x}{2}\right )-\operatorname {arctanh}\left (\frac {2-2 \sqrt {3}\, \left (x -\sqrt {3}\right )}{2 \sqrt {-\left (x -\sqrt {3}\right )^{2}-2 \sqrt {3}\, \left (x -\sqrt {3}\right )+1}}\right )}{2 \left (2+\sqrt {3}\right ) \left (-2+\sqrt {3}\right )}-\frac {\sqrt {-\left (x +\sqrt {3}\right )^{2}+2 \sqrt {3}\, \left (x +\sqrt {3}\right )+1}+\sqrt {3}\, \arcsin \left (\frac {x}{2}\right )-\operatorname {arctanh}\left (\frac {2+2 \sqrt {3}\, \left (x +\sqrt {3}\right )}{2 \sqrt {-\left (x +\sqrt {3}\right )^{2}+2 \sqrt {3}\, \left (x +\sqrt {3}\right )+1}}\right )}{2 \left (2+\sqrt {3}\right ) \left (-2+\sqrt {3}\right )}\) \(271\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (14) = 28\).

Time = 0.23 (sec) , antiderivative size = 55, normalized size of antiderivative = 3.44 \[ \int \frac {x}{4-x^2+\sqrt {4-x^2}} \, dx=-\frac {1}{2} \, \log \left (x^{2} - 3\right ) + \frac {1}{2} \, \log \left (-\frac {x^{2} + 3 \, \sqrt {-x^{2} + 4} - 6}{x^{2}}\right ) - \frac {1}{2} \, \log \left (-\frac {x^{2} + \sqrt {-x^{2} + 4} - 2}{x^{2}}\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 1.34 (sec) , antiderivative size = 48, normalized size of antiderivative = 3.00 \[ \int \frac {x}{4-x^2+\sqrt {4-x^2}} \, dx=\frac {\log {\left (2 \sqrt {4 - x^{2}} \right )}}{2} - \frac {\log {\left (2 \sqrt {4 - x^{2}} + 2 \right )}}{2} - \frac {\log {\left (2 x^{2} - 2 \sqrt {4 - x^{2}} - 8 \right )}}{2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 5.44 \[ \int \frac {x}{4-x^2+\sqrt {4-x^2}} \, dx=-\frac {\ln \left (x-\sqrt {3}\right )}{2}-\frac {\ln \left (\frac {\sqrt {3}\,x\,1{}\mathrm {i}+\sqrt {4-x^2}\,1{}\mathrm {i}+4{}\mathrm {i}}{x+\sqrt {3}}\right )}{2}-\frac {\ln \left (x+\sqrt {3}\right )}{2}-\frac {\ln \left (\frac {-\sqrt {3}\,x\,1{}\mathrm {i}+\sqrt {4-x^2}\,1{}\mathrm {i}+4{}\mathrm {i}}{x-\sqrt {3}}\right )}{2} \]

[In]

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

[Out]

- log(x - 3^(1/2))/2 - log((3^(1/2)*x*1i + (4 - x^2)^(1/2)*1i + 4i)/(x + 3^(1/2)))/2 - log(x + 3^(1/2))/2 - lo
g(((4 - x^2)^(1/2)*1i - 3^(1/2)*x*1i + 4i)/(x - 3^(1/2)))/2