\(\int \frac {24+8 x}{x (-4+x^2)} \, dx\) [432]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (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 = 17 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=5 \log (2-x)-6 \log (x)+\log (2+x) \]

[Out]

5*ln(2-x)-6*ln(x)+ln(2+x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, 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 = {815} \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=5 \log (2-x)-6 \log (x)+\log (x+2) \]

[In]

Int[(24 + 8*x)/(x*(-4 + x^2)),x]

[Out]

5*Log[2 - x] - 6*Log[x] + Log[2 + x]

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.59 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=8 \left (\frac {5}{8} \log (2-x)-\frac {3 \log (x)}{4}+\frac {1}{8} \log (2+x)\right ) \]

[In]

Integrate[(24 + 8*x)/(x*(-4 + x^2)),x]

[Out]

8*((5*Log[2 - x])/8 - (3*Log[x])/4 + Log[2 + x]/8)

Maple [A] (verified)

Time = 0.81 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.94

method result size
default \(-6 \ln \left (x \right )+\ln \left (x +2\right )+5 \ln \left (x -2\right )\) \(16\)
norman \(-6 \ln \left (x \right )+\ln \left (x +2\right )+5 \ln \left (x -2\right )\) \(16\)
risch \(-6 \ln \left (x \right )+\ln \left (x +2\right )+5 \ln \left (x -2\right )\) \(16\)
parallelrisch \(-6 \ln \left (x \right )+\ln \left (x +2\right )+5 \ln \left (x -2\right )\) \(16\)
meijerg \(3 \ln \left (1-\frac {x^{2}}{4}\right )-6 \ln \left (x \right )+6 \ln \left (2\right )-3 i \pi -4 \,\operatorname {arctanh}\left (\frac {x}{2}\right )\) \(30\)

[In]

int((24+8*x)/x/(x^2-4),x,method=_RETURNVERBOSE)

[Out]

-6*ln(x)+ln(x+2)+5*ln(x-2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=\log \left (x + 2\right ) + 5 \, \log \left (x - 2\right ) - 6 \, \log \left (x\right ) \]

[In]

integrate((24+8*x)/x/(x^2-4),x, algorithm="fricas")

[Out]

log(x + 2) + 5*log(x - 2) - 6*log(x)

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=- 6 \log {\left (x \right )} + 5 \log {\left (x - 2 \right )} + \log {\left (x + 2 \right )} \]

[In]

integrate((24+8*x)/x/(x**2-4),x)

[Out]

-6*log(x) + 5*log(x - 2) + log(x + 2)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=\log \left (x + 2\right ) + 5 \, \log \left (x - 2\right ) - 6 \, \log \left (x\right ) \]

[In]

integrate((24+8*x)/x/(x^2-4),x, algorithm="maxima")

[Out]

log(x + 2) + 5*log(x - 2) - 6*log(x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.06 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=\log \left ({\left | x + 2 \right |}\right ) + 5 \, \log \left ({\left | x - 2 \right |}\right ) - 6 \, \log \left ({\left | x \right |}\right ) \]

[In]

integrate((24+8*x)/x/(x^2-4),x, algorithm="giac")

[Out]

log(abs(x + 2)) + 5*log(abs(x - 2)) - 6*log(abs(x))

Mupad [B] (verification not implemented)

Time = 9.18 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {24+8 x}{x \left (-4+x^2\right )} \, dx=5\,\ln \left (x-2\right )+\ln \left (x+2\right )-6\,\ln \left (x\right ) \]

[In]

int((8*x + 24)/(x*(x^2 - 4)),x)

[Out]

5*log(x - 2) + log(x + 2) - 6*log(x)