3.45.5 \(\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\)

Optimal. Leaf size=30 \[ -6+2 x+\frac {2+\frac {4 \log ^2(x+(-1+x) x)}{4-x}}{x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.52, antiderivative size = 47, normalized size of antiderivative = 1.57, number of steps used = 25, number of rules used = 13, integrand size = 59, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {1594, 27, 6742, 44, 43, 2351, 2317, 2391, 2304, 2301, 2357, 2318, 2305} \begin {gather*} \frac {x \log ^2\left (x^2\right )}{4 (4-x)}+\frac {\log ^2\left (x^2\right )}{x}+\frac {1}{4} \log ^2\left (x^2\right )+2 x+\frac {2}{x} \end {gather*}

Antiderivative was successfully verified.

[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[x^2]^2/4 + Log[x^2]^2/x + (x*Log[x^2]^2)/(4*(4 - x))

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 43

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 44

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] && L
tQ[m + n + 2, 0])

Rule 1594

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 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2304

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 2305

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 2317

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 2318

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 2351

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Wit
h[{u = ExpandIntegrand[a + b*Log[c*x^n], (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c,
d, e, f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && IntegerQ[r]))

Rule 2357

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 2391

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 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \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+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-16 \int \left (\frac {\log \left (x^2\right )}{16 (-4+x)}-\frac {\log \left (x^2\right )}{4 x^2}-\frac {\log \left (x^2\right )}{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 {2}{x}+2 x+4 \int \frac {\log \left (x^2\right )}{x^2} \, dx-\int \frac {\log \left (x^2\right )}{-4+x} \, dx+\int \frac {\log \left (x^2\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 {x}{4}\right ) \log \left (x^2\right )+\frac {1}{4} \log ^2\left (x^2\right )+\frac {\log ^2\left (x^2\right )}{x}+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}+2 \int \frac {\log \left (1-\frac {x}{4}\right )}{x} \, dx-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+\frac {1}{4} \log ^2\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 {x}{4}\right )-2 \int \frac {\log \left (1-\frac {x}{4}\right )}{x} \, dx\\ &=\frac {2}{x}+2 x+\frac {1}{4} \log ^2\left (x^2\right )+\frac {\log ^2\left (x^2\right )}{x}+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 29, normalized size = 0.97 \begin {gather*} \frac {2 \left (-4+x-4 x^2+x^3-2 \log ^2\left (x^2\right )\right )}{(-4+x) x} \end {gather*}

Antiderivative was successfully verified.

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

________________________________________________________________________________________

fricas [A]  time = 0.60, size = 30, normalized size = 1.00 \begin {gather*} \frac {2 \, {\left (x^{3} - 4 \, x^{2} - 2 \, \log \left (x^{2}\right )^{2} + x - 4\right )}}{x^{2} - 4 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

giac [A]  time = 0.15, size = 28, normalized size = 0.93 \begin {gather*} -{\left (\frac {1}{x - 4} - \frac {1}{x}\right )} \log \left (x^{2}\right )^{2} + 2 \, x + \frac {2}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

maple [A]  time = 0.06, size = 28, normalized size = 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\)



Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 40, normalized size = 1.33 \begin {gather*} 2 \, x - \frac {16 \, \log \relax (x)^{2}}{x^{2} - 4 \, x} + \frac {4 \, {\left (x - 2\right )}}{x^{2} - 4 \, x} - \frac {2}{x - 4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

mupad [B]  time = 3.22, size = 30, normalized size = 1.00 \begin {gather*} -\frac {-4\,x^3+15\,x^2+8\,{\ln \left (x^2\right )}^2+16}{2\,x\,\left (x-4\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 20, normalized size = 0.67 \begin {gather*} 2 x - \frac {4 \log {\left (x^{2} \right )}^{2}}{x^{2} - 4 x} + \frac {2}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________