\(\int \frac {-62-32 x-4 x^2+(32+16 x+2 x^2) \log (2 x)+(16+8 x+x^2) \log ^2(2 x)}{16+8 x+x^2} \, dx\) [4635]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 51, antiderivative size = 35 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=3-3 (x-\log (3))-x \left (\frac {x+\frac {2}{4+x}}{x}-\log ^2(2 x)\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.54, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {27, 6820, 697, 2332, 2333} \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=-4 x-\frac {2}{x+4}+x \log ^2(2 x) \]

[In]

Int[(-62 - 32*x - 4*x^2 + (32 + 16*x + 2*x^2)*Log[2*x] + (16 + 8*x + x^2)*Log[2*x]^2)/(16 + 8*x + x^2),x]

[Out]

-4*x - 2/(4 + x) + x*Log[2*x]^2

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 697

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.60 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=-\frac {2}{4+x}-4 (4+x)+x \log ^2(2 x) \]

[In]

Integrate[(-62 - 32*x - 4*x^2 + (32 + 16*x + 2*x^2)*Log[2*x] + (16 + 8*x + x^2)*Log[2*x]^2)/(16 + 8*x + x^2),x
]

[Out]

-2/(4 + x) - 4*(4 + x) + x*Log[2*x]^2

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.57

method result size
parts \(x \ln \left (2 x \right )^{2}-4 x -\frac {2}{4+x}\) \(20\)
derivativedivides \(x \ln \left (2 x \right )^{2}-4 x -\frac {4}{2 x +8}\) \(22\)
default \(x \ln \left (2 x \right )^{2}-4 x -\frac {4}{2 x +8}\) \(22\)
risch \(x \ln \left (2 x \right )^{2}-\frac {2 \left (2 x^{2}+8 x +1\right )}{4+x}\) \(27\)
norman \(\frac {x^{2} \ln \left (2 x \right )^{2}-4 x^{2}+4 x \ln \left (2 x \right )^{2}+62}{4+x}\) \(33\)
parallelrisch \(\frac {x^{2} \ln \left (2 x \right )^{2}-4 x^{2}+4 x \ln \left (2 x \right )^{2}+62}{4+x}\) \(33\)

[In]

int(((x^2+8*x+16)*ln(2*x)^2+(2*x^2+16*x+32)*ln(2*x)-4*x^2-32*x-62)/(x^2+8*x+16),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.86 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=\frac {{\left (x^{2} + 4 \, x\right )} \log \left (2 \, x\right )^{2} - 4 \, x^{2} - 16 \, x - 2}{x + 4} \]

[In]

integrate(((x^2+8*x+16)*log(2*x)^2+(2*x^2+16*x+32)*log(2*x)-4*x^2-32*x-62)/(x^2+8*x+16),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.43 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=x \log {\left (2 x \right )}^{2} - 4 x - \frac {2}{x + 4} \]

[In]

integrate(((x**2+8*x+16)*ln(2*x)**2+(2*x**2+16*x+32)*ln(2*x)-4*x**2-32*x-62)/(x**2+8*x+16),x)

[Out]

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

Maxima [B] (verification not implemented)

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

Time = 0.33 (sec) , antiderivative size = 82, normalized size of antiderivative = 2.34 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=-4 \, x + \frac {x^{2} \log \left (2\right )^{2} + 4 \, x \log \left (2\right )^{2} + {\left (x^{2} + 4 \, x\right )} \log \left (x\right )^{2} + 2 \, {\left (x^{2} \log \left (2\right ) + 4 \, x {\left (\log \left (2\right ) - 1\right )}\right )} \log \left (x\right ) + 32 \, \log \left (2\right )}{x + 4} - \frac {32 \, \log \left (2 \, x\right )}{x + 4} - \frac {2}{x + 4} + 8 \, \log \left (x\right ) \]

[In]

integrate(((x^2+8*x+16)*log(2*x)^2+(2*x^2+16*x+32)*log(2*x)-4*x^2-32*x-62)/(x^2+8*x+16),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.54 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=x \log \left (2 \, x\right )^{2} - 4 \, x - \frac {2}{x + 4} \]

[In]

integrate(((x^2+8*x+16)*log(2*x)^2+(2*x^2+16*x+32)*log(2*x)-4*x^2-32*x-62)/(x^2+8*x+16),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 10.53 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.51 \[ \int \frac {-62-32 x-4 x^2+\left (32+16 x+2 x^2\right ) \log (2 x)+\left (16+8 x+x^2\right ) \log ^2(2 x)}{16+8 x+x^2} \, dx=x\,\left ({\ln \left (2\,x\right )}^2-4\right )-\frac {2}{x+4} \]

[In]

int(-(32*x - log(2*x)*(16*x + 2*x^2 + 32) - log(2*x)^2*(8*x + x^2 + 16) + 4*x^2 + 62)/(8*x + x^2 + 16),x)

[Out]

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