\(\int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx\) [8660]

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

[Out]

ln(16*(4+x)/x^4)+3*x+5

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {1607, 907} \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 x-4 \log (x)+\log (x+4) \]

[In]

Int[(-16 + 9*x + 3*x^2)/(4*x + x^2),x]

[Out]

3*x - 4*Log[x] + Log[4 + x]

Rule 907

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 x-4 \log (x)+\log (4+x) \]

[In]

Integrate[(-16 + 9*x + 3*x^2)/(4*x + x^2),x]

[Out]

3*x - 4*Log[x] + Log[4 + x]

Maple [A] (verified)

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

method result size
default \(3 x -4 \ln \left (x \right )+\ln \left (4+x \right )\) \(13\)
norman \(3 x -4 \ln \left (x \right )+\ln \left (4+x \right )\) \(13\)
risch \(3 x -4 \ln \left (x \right )+\ln \left (4+x \right )\) \(13\)
parallelrisch \(3 x -4 \ln \left (x \right )+\ln \left (4+x \right )\) \(13\)
meijerg \(-4 \ln \left (x \right )+8 \ln \left (2\right )+\ln \left (1+\frac {x}{4}\right )+3 x\) \(19\)

[In]

int((3*x^2+9*x-16)/(x^2+4*x),x,method=_RETURNVERBOSE)

[Out]

3*x-4*ln(x)+ln(4+x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 \, x + \log \left (x + 4\right ) - 4 \, \log \left (x\right ) \]

[In]

integrate((3*x^2+9*x-16)/(x^2+4*x),x, algorithm="fricas")

[Out]

3*x + log(x + 4) - 4*log(x)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 x - 4 \log {\left (x \right )} + \log {\left (x + 4 \right )} \]

[In]

integrate((3*x**2+9*x-16)/(x**2+4*x),x)

[Out]

3*x - 4*log(x) + log(x + 4)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 \, x + \log \left (x + 4\right ) - 4 \, \log \left (x\right ) \]

[In]

integrate((3*x^2+9*x-16)/(x^2+4*x),x, algorithm="maxima")

[Out]

3*x + log(x + 4) - 4*log(x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3 \, x + \log \left ({\left | x + 4 \right |}\right ) - 4 \, \log \left ({\left | x \right |}\right ) \]

[In]

integrate((3*x^2+9*x-16)/(x^2+4*x),x, algorithm="giac")

[Out]

3*x + log(abs(x + 4)) - 4*log(abs(x))

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \frac {-16+9 x+3 x^2}{4 x+x^2} \, dx=3\,x+\ln \left (x+4\right )-4\,\ln \left (x\right ) \]

[In]

int((9*x + 3*x^2 - 16)/(4*x + x^2),x)

[Out]

3*x + log(x + 4) - 4*log(x)