\(\int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log (x^2)+(-16+8 x) \log ^2(x^2)}{16 x^2-8 x^3+x^4} \, dx\) [4405]

   Optimal result
   Rubi [C] (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 = 59, antiderivative size = 30 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=-6+2 x+\frac {2+\frac {4 \log ^2(x+(-1+x) x)}{4-x}}{x} \]

[Out]

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

Rubi [C] (verified)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

Time = 0.33 (sec) , antiderivative size = 82, normalized size of antiderivative = 2.73, number of steps used = 23, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {1608, 27, 6874, 46, 45, 2380, 2341, 2379, 2438, 2404, 2355, 2354, 2342} \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=2 \operatorname {PolyLog}\left (2,\frac {4}{x}\right )+2 \operatorname {PolyLog}\left (2,\frac {x}{4}\right )+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}+\frac {\log ^2\left (x^2\right )}{x}-\log \left (1-\frac {4}{x}\right ) \log \left (x^2\right )+\log \left (1-\frac {x}{4}\right ) \log \left (x^2\right )+2 x+\frac {2}{x} \]

[In]

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

[Out]

2/x + 2*x - Log[1 - 4/x]*Log[x^2] + Log[1 - x/4]*Log[x^2] + Log[x^2]^2/x + (x*Log[x^2]^2)/(4*(4 - x)) + 2*Poly
Log[2, 4/x] + 2*PolyLog[2, x/4]

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 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 1608

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

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2354

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[Log[1 + e*(x/d)]*((a +
b*Log[c*x^n])^p/e), x] - Dist[b*n*(p/e), Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2355

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

Rule 2379

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^(r_.))), x_Symbol] :> Simp[(-Log[1 +
d/(e*x^r)])*((a + b*Log[c*x^n])^p/(d*r)), x] + Dist[b*n*(p/(d*r)), Int[Log[1 + d/(e*x^r)]*((a + b*Log[c*x^n])^
(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[p, 0]

Rule 2380

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.))/((d_) + (e_.)*(x_)^(r_.)), x_Symbol] :> Dist[1/d,
 Int[x^m*(a + b*Log[c*x^n])^p, x], x] - Dist[e/d, Int[(x^(m + r)*(a + b*Log[c*x^n])^p)/(d + e*x^r), x], x] /;
FreeQ[{a, b, c, d, e, m, n, r}, x] && IGtQ[p, 0] && IGtQ[r, 0] && ILtQ[m, -1]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 6874

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

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=\frac {2 \left (-4+x-4 x^2+x^3-2 \log ^2\left (x^2\right )\right )}{(-4+x) x} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93

method result size
norman \(\frac {-8-30 x +2 x^{3}-4 \ln \left (x^{2}\right )^{2}}{\left (x -4\right ) x}\) \(28\)
risch \(-\frac {4 \ln \left (x^{2}\right )^{2}}{\left (x -4\right ) x}+\frac {2 x^{2}+2}{x}\) \(28\)
parallelrisch \(\frac {-16+4 x^{3}-8 \ln \left (x^{2}\right )^{2}-60 x}{2 x \left (x -4\right )}\) \(29\)

[In]

int(((8*x-16)*ln(x^2)^2+(-16*x+64)*ln(x^2)+2*x^4-16*x^3+30*x^2+16*x-32)/(x^4-8*x^3+16*x^2),x,method=_RETURNVER
BOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

integrate(((8*x-16)*log(x^2)^2+(-16*x+64)*log(x^2)+2*x^4-16*x^3+30*x^2+16*x-32)/(x^4-8*x^3+16*x^2),x, algorith
m="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.67 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=2 x - \frac {4 \log {\left (x^{2} \right )}^{2}}{x^{2} - 4 x} + \frac {2}{x} \]

[In]

integrate(((8*x-16)*ln(x**2)**2+(-16*x+64)*ln(x**2)+2*x**4-16*x**3+30*x**2+16*x-32)/(x**4-8*x**3+16*x**2),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.33 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=2 \, x - \frac {16 \, \log \left (x\right )^{2}}{x^{2} - 4 \, x} + \frac {4 \, {\left (x - 2\right )}}{x^{2} - 4 \, x} - \frac {2}{x - 4} \]

[In]

integrate(((8*x-16)*log(x^2)^2+(-16*x+64)*log(x^2)+2*x^4-16*x^3+30*x^2+16*x-32)/(x^4-8*x^3+16*x^2),x, algorith
m="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=-{\left (\frac {1}{x - 4} - \frac {1}{x}\right )} \log \left (x^{2}\right )^{2} + 2 \, x + \frac {2}{x} \]

[In]

integrate(((8*x-16)*log(x^2)^2+(-16*x+64)*log(x^2)+2*x^4-16*x^3+30*x^2+16*x-32)/(x^4-8*x^3+16*x^2),x, algorith
m="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 10.31 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00 \[ \int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{16 x^2-8 x^3+x^4} \, dx=-\frac {-4\,x^3+15\,x^2+8\,{\ln \left (x^2\right )}^2+16}{2\,x\,\left (x-4\right )} \]

[In]

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

[Out]

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