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

Optimal. Leaf size=14 \[ 5+3 x+\log \left (\frac {16 (4+x)}{x^4}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 12, normalized size of antiderivative = 0.86, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {1593, 893} \begin {gather*} 3 x-4 \log (x)+\log (x+4) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 893

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 1593

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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 12, normalized size = 0.86 \begin {gather*} 3 x-4 \log (x)+\log (4+x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 12, normalized size = 0.86 \begin {gather*} 3 \, x + \log \left (x + 4\right ) - 4 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.17, size = 14, normalized size = 1.00 \begin {gather*} 3 \, x + \log \left ({\left | x + 4 \right |}\right ) - 4 \, \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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))

________________________________________________________________________________________

maple [A]  time = 0.41, size = 13, normalized size = 0.93




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 12, normalized size = 0.86 \begin {gather*} 3 \, x + \log \left (x + 4\right ) - 4 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 12, normalized size = 0.86 \begin {gather*} 3\,x+\ln \left (x+4\right )-4\,\ln \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 12, normalized size = 0.86 \begin {gather*} 3 x - 4 \log {\relax (x )} + \log {\left (x + 4 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________