### 3.100 $$\int \frac{\log ^2(-1+x+x^2)}{x^3} \, dx$$

Optimal. Leaf size=443 $3 \text{PolyLog}\left (2,-\frac{2 x}{1+\sqrt{5}}\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \text{PolyLog}\left (2,-\frac{2 x-\sqrt{5}+1}{2 \sqrt{5}}\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \text{PolyLog}\left (2,\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right )-3 \text{PolyLog}\left (2,\frac{2 x}{1-\sqrt{5}}+1\right )-\frac{\log ^2\left (x^2+x-1\right )}{2 x^2}+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (x^2+x-1\right ) \log \left (2 x-\sqrt{5}+1\right )-3 \log (x) \log \left (x^2+x-1\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (2 x+\sqrt{5}+1\right ) \log \left (x^2+x-1\right )+\frac{\log \left (x^2+x-1\right )}{x}-\frac{1}{4} \left (3+\sqrt{5}\right ) \log ^2\left (2 x-\sqrt{5}+1\right )-\frac{1}{4} \left (3-\sqrt{5}\right ) \log ^2\left (2 x+\sqrt{5}+1\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (2 x-\sqrt{5}+1\right )+3 \log \left (\frac{1}{2} \left (\sqrt{5}-1\right )\right ) \log \left (2 x-\sqrt{5}+1\right )-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (2 x-\sqrt{5}+1\right )+\log (x)-\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (-\frac{2 x-\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (2 x+\sqrt{5}+1\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (2 x+\sqrt{5}+1\right )+3 \log (x) \log \left (\frac{2 x}{1+\sqrt{5}}+1\right )$

[Out]

Log[x] - ((1 + Sqrt[5])*Log[1 - Sqrt[5] + 2*x])/2 + 3*Log[(-1 + Sqrt[5])/2]*Log[1 - Sqrt[5] + 2*x] - ((3 + Sqr
t[5])*Log[1 - Sqrt[5] + 2*x]^2)/4 - ((1 - Sqrt[5])*Log[1 + Sqrt[5] + 2*x])/2 - ((3 - Sqrt[5])*Log[-(1 - Sqrt[5
] + 2*x)/(2*Sqrt[5])]*Log[1 + Sqrt[5] + 2*x])/2 - ((3 - Sqrt[5])*Log[1 + Sqrt[5] + 2*x]^2)/4 - ((3 + Sqrt[5])*
Log[1 - Sqrt[5] + 2*x]*Log[(1 + Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 + 3*Log[x]*Log[1 + (2*x)/(1 + Sqrt[5])] + Log[-
1 + x + x^2]/x - 3*Log[x]*Log[-1 + x + x^2] + ((3 + Sqrt[5])*Log[1 - Sqrt[5] + 2*x]*Log[-1 + x + x^2])/2 + ((3
- Sqrt[5])*Log[1 + Sqrt[5] + 2*x]*Log[-1 + x + x^2])/2 - Log[-1 + x + x^2]^2/(2*x^2) + 3*PolyLog[2, (-2*x)/(1
+ Sqrt[5])] - ((3 + Sqrt[5])*PolyLog[2, -(1 - Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 - ((3 - Sqrt[5])*PolyLog[2, (1 +
Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 - 3*PolyLog[2, 1 + (2*x)/(1 - Sqrt[5])]

________________________________________________________________________________________

Rubi [A]  time = 0.683829, antiderivative size = 443, normalized size of antiderivative = 1., number of steps used = 34, number of rules used = 16, integrand size = 13, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 1.231, Rules used = {2525, 2528, 800, 632, 31, 2524, 2357, 2316, 2315, 2317, 2391, 2418, 2390, 2301, 2394, 2393} $3 \text{PolyLog}\left (2,-\frac{2 x}{1+\sqrt{5}}\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \text{PolyLog}\left (2,-\frac{2 x-\sqrt{5}+1}{2 \sqrt{5}}\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \text{PolyLog}\left (2,\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right )-3 \text{PolyLog}\left (2,\frac{2 x}{1-\sqrt{5}}+1\right )-\frac{\log ^2\left (x^2+x-1\right )}{2 x^2}+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (x^2+x-1\right ) \log \left (2 x-\sqrt{5}+1\right )-3 \log (x) \log \left (x^2+x-1\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (2 x+\sqrt{5}+1\right ) \log \left (x^2+x-1\right )+\frac{\log \left (x^2+x-1\right )}{x}-\frac{1}{4} \left (3+\sqrt{5}\right ) \log ^2\left (2 x-\sqrt{5}+1\right )-\frac{1}{4} \left (3-\sqrt{5}\right ) \log ^2\left (2 x+\sqrt{5}+1\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (2 x-\sqrt{5}+1\right )+3 \log \left (\frac{1}{2} \left (\sqrt{5}-1\right )\right ) \log \left (2 x-\sqrt{5}+1\right )-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (2 x-\sqrt{5}+1\right )+\log (x)-\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (-\frac{2 x-\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (2 x+\sqrt{5}+1\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (2 x+\sqrt{5}+1\right )+3 \log (x) \log \left (\frac{2 x}{1+\sqrt{5}}+1\right )$

Antiderivative was successfully veriﬁed.

[In]

Int[Log[-1 + x + x^2]^2/x^3,x]

[Out]

Log[x] - ((1 + Sqrt[5])*Log[1 - Sqrt[5] + 2*x])/2 + 3*Log[(-1 + Sqrt[5])/2]*Log[1 - Sqrt[5] + 2*x] - ((3 + Sqr
t[5])*Log[1 - Sqrt[5] + 2*x]^2)/4 - ((1 - Sqrt[5])*Log[1 + Sqrt[5] + 2*x])/2 - ((3 - Sqrt[5])*Log[-(1 - Sqrt[5
] + 2*x)/(2*Sqrt[5])]*Log[1 + Sqrt[5] + 2*x])/2 - ((3 - Sqrt[5])*Log[1 + Sqrt[5] + 2*x]^2)/4 - ((3 + Sqrt[5])*
Log[1 - Sqrt[5] + 2*x]*Log[(1 + Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 + 3*Log[x]*Log[1 + (2*x)/(1 + Sqrt[5])] + Log[-
1 + x + x^2]/x - 3*Log[x]*Log[-1 + x + x^2] + ((3 + Sqrt[5])*Log[1 - Sqrt[5] + 2*x]*Log[-1 + x + x^2])/2 + ((3
- Sqrt[5])*Log[1 + Sqrt[5] + 2*x]*Log[-1 + x + x^2])/2 - Log[-1 + x + x^2]^2/(2*x^2) + 3*PolyLog[2, (-2*x)/(1
+ Sqrt[5])] - ((3 + Sqrt[5])*PolyLog[2, -(1 - Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 - ((3 - Sqrt[5])*PolyLog[2, (1 +
Sqrt[5] + 2*x)/(2*Sqrt[5])])/2 - 3*PolyLog[2, 1 + (2*x)/(1 - Sqrt[5])]

Rule 2525

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[((d + e*x)^(m
+ 1)*(a + b*Log[c*RFx^p])^n)/(e*(m + 1)), x] - Dist[(b*n*p)/(e*(m + 1)), Int[SimplifyIntegrand[((d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*D[RFx, x])/RFx, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 2528

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

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2524

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

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 2316

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

Rule 2315

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> -Simp[PolyLog[2, 1 - c*x]/e, x] /; FreeQ[{c, d, e}, x] &
& EqQ[e + c*d, 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 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 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2390

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

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 2394

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

Rule 2393

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Dist[1/g, Subst[Int[(a +
b*Log[1 + (c*e*x)/g])/x, x], x, f + g*x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] && EqQ[g
+ c*(e*f - d*g), 0]

Rubi steps

\begin{align*} \int \frac{\log ^2\left (-1+x+x^2\right )}{x^3} \, dx &=-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+\int \frac{(1+2 x) \log \left (-1+x+x^2\right )}{x^2 \left (-1+x+x^2\right )} \, dx\\ &=-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+\int \left (-\frac{\log \left (-1+x+x^2\right )}{x^2}-\frac{3 \log \left (-1+x+x^2\right )}{x}+\frac{(4+3 x) \log \left (-1+x+x^2\right )}{-1+x+x^2}\right ) \, dx\\ &=-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}-3 \int \frac{\log \left (-1+x+x^2\right )}{x} \, dx-\int \frac{\log \left (-1+x+x^2\right )}{x^2} \, dx+\int \frac{(4+3 x) \log \left (-1+x+x^2\right )}{-1+x+x^2} \, dx\\ &=\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \int \frac{(1+2 x) \log (x)}{-1+x+x^2} \, dx-\int \frac{1+2 x}{x \left (-1+x+x^2\right )} \, dx+\int \left (\frac{\left (3+\sqrt{5}\right ) \log \left (-1+x+x^2\right )}{1-\sqrt{5}+2 x}+\frac{\left (3-\sqrt{5}\right ) \log \left (-1+x+x^2\right )}{1+\sqrt{5}+2 x}\right ) \, dx\\ &=\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \int \left (\frac{2 \log (x)}{1-\sqrt{5}+2 x}+\frac{2 \log (x)}{1+\sqrt{5}+2 x}\right ) \, dx+\left (3-\sqrt{5}\right ) \int \frac{\log \left (-1+x+x^2\right )}{1+\sqrt{5}+2 x} \, dx+\left (3+\sqrt{5}\right ) \int \frac{\log \left (-1+x+x^2\right )}{1-\sqrt{5}+2 x} \, dx-\int \left (-\frac{1}{x}+\frac{3+x}{-1+x+x^2}\right ) \, dx\\ &=\log (x)+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+6 \int \frac{\log (x)}{1-\sqrt{5}+2 x} \, dx+6 \int \frac{\log (x)}{1+\sqrt{5}+2 x} \, dx+\frac{1}{2} \left (-3-\sqrt{5}\right ) \int \frac{(1+2 x) \log \left (1-\sqrt{5}+2 x\right )}{-1+x+x^2} \, dx+\frac{1}{2} \left (-3+\sqrt{5}\right ) \int \frac{(1+2 x) \log \left (1+\sqrt{5}+2 x\right )}{-1+x+x^2} \, dx-\int \frac{3+x}{-1+x+x^2} \, dx\\ &=\log (x)+3 \log \left (\frac{1}{2} \left (-1+\sqrt{5}\right )\right ) \log \left (1-\sqrt{5}+2 x\right )+3 \log (x) \log \left (1+\frac{2 x}{1+\sqrt{5}}\right )+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}-3 \int \frac{\log \left (1+\frac{2 x}{1+\sqrt{5}}\right )}{x} \, dx+6 \int \frac{\log \left (-\frac{2 x}{1-\sqrt{5}}\right )}{1-\sqrt{5}+2 x} \, dx+\frac{1}{2} \left (-3-\sqrt{5}\right ) \int \left (\frac{2 \log \left (1-\sqrt{5}+2 x\right )}{1-\sqrt{5}+2 x}+\frac{2 \log \left (1-\sqrt{5}+2 x\right )}{1+\sqrt{5}+2 x}\right ) \, dx+\frac{1}{2} \left (-3+\sqrt{5}\right ) \int \left (\frac{2 \log \left (1+\sqrt{5}+2 x\right )}{1-\sqrt{5}+2 x}+\frac{2 \log \left (1+\sqrt{5}+2 x\right )}{1+\sqrt{5}+2 x}\right ) \, dx+\frac{1}{2} \left (-1+\sqrt{5}\right ) \int \frac{1}{\frac{1}{2}+\frac{\sqrt{5}}{2}+x} \, dx-\frac{1}{2} \left (1+\sqrt{5}\right ) \int \frac{1}{\frac{1}{2}-\frac{\sqrt{5}}{2}+x} \, dx\\ &=\log (x)-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right )+3 \log \left (\frac{1}{2} \left (-1+\sqrt{5}\right )\right ) \log \left (1-\sqrt{5}+2 x\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right )+3 \log (x) \log \left (1+\frac{2 x}{1+\sqrt{5}}\right )+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \text{Li}_2\left (-\frac{2 x}{1+\sqrt{5}}\right )-3 \text{Li}_2\left (1+\frac{2 x}{1-\sqrt{5}}\right )+\left (-3-\sqrt{5}\right ) \int \frac{\log \left (1-\sqrt{5}+2 x\right )}{1-\sqrt{5}+2 x} \, dx+\left (-3-\sqrt{5}\right ) \int \frac{\log \left (1-\sqrt{5}+2 x\right )}{1+\sqrt{5}+2 x} \, dx+\left (-3+\sqrt{5}\right ) \int \frac{\log \left (1+\sqrt{5}+2 x\right )}{1-\sqrt{5}+2 x} \, dx+\left (-3+\sqrt{5}\right ) \int \frac{\log \left (1+\sqrt{5}+2 x\right )}{1+\sqrt{5}+2 x} \, dx\\ &=\log (x)-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right )+3 \log \left (\frac{1}{2} \left (-1+\sqrt{5}\right )\right ) \log \left (1-\sqrt{5}+2 x\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (-\frac{1-\sqrt{5}+2 x}{2 \sqrt{5}}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (\frac{1+\sqrt{5}+2 x}{2 \sqrt{5}}\right )+3 \log (x) \log \left (1+\frac{2 x}{1+\sqrt{5}}\right )+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \text{Li}_2\left (-\frac{2 x}{1+\sqrt{5}}\right )-3 \text{Li}_2\left (1+\frac{2 x}{1-\sqrt{5}}\right )+\frac{1}{2} \left (-3-\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,1-\sqrt{5}+2 x\right )+\left (3-\sqrt{5}\right ) \int \frac{\log \left (\frac{2 \left (1-\sqrt{5}+2 x\right )}{2 \left (1-\sqrt{5}\right )-2 \left (1+\sqrt{5}\right )}\right )}{1+\sqrt{5}+2 x} \, dx+\frac{1}{2} \left (-3+\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,1+\sqrt{5}+2 x\right )+\left (3+\sqrt{5}\right ) \int \frac{\log \left (\frac{2 \left (1+\sqrt{5}+2 x\right )}{-2 \left (1-\sqrt{5}\right )+2 \left (1+\sqrt{5}\right )}\right )}{1-\sqrt{5}+2 x} \, dx\\ &=\log (x)-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right )+3 \log \left (\frac{1}{2} \left (-1+\sqrt{5}\right )\right ) \log \left (1-\sqrt{5}+2 x\right )-\frac{1}{4} \left (3+\sqrt{5}\right ) \log ^2\left (1-\sqrt{5}+2 x\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (-\frac{1-\sqrt{5}+2 x}{2 \sqrt{5}}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{4} \left (3-\sqrt{5}\right ) \log ^2\left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (\frac{1+\sqrt{5}+2 x}{2 \sqrt{5}}\right )+3 \log (x) \log \left (1+\frac{2 x}{1+\sqrt{5}}\right )+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \text{Li}_2\left (-\frac{2 x}{1+\sqrt{5}}\right )-3 \text{Li}_2\left (1+\frac{2 x}{1-\sqrt{5}}\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 x}{2 \left (1-\sqrt{5}\right )-2 \left (1+\sqrt{5}\right )}\right )}{x} \, dx,x,1+\sqrt{5}+2 x\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{2 x}{-2 \left (1-\sqrt{5}\right )+2 \left (1+\sqrt{5}\right )}\right )}{x} \, dx,x,1-\sqrt{5}+2 x\right )\\ &=\log (x)-\frac{1}{2} \left (1+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right )+3 \log \left (\frac{1}{2} \left (-1+\sqrt{5}\right )\right ) \log \left (1-\sqrt{5}+2 x\right )-\frac{1}{4} \left (3+\sqrt{5}\right ) \log ^2\left (1-\sqrt{5}+2 x\right )-\frac{1}{2} \left (1-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (-\frac{1-\sqrt{5}+2 x}{2 \sqrt{5}}\right ) \log \left (1+\sqrt{5}+2 x\right )-\frac{1}{4} \left (3-\sqrt{5}\right ) \log ^2\left (1+\sqrt{5}+2 x\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (\frac{1+\sqrt{5}+2 x}{2 \sqrt{5}}\right )+3 \log (x) \log \left (1+\frac{2 x}{1+\sqrt{5}}\right )+\frac{\log \left (-1+x+x^2\right )}{x}-3 \log (x) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3+\sqrt{5}\right ) \log \left (1-\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )+\frac{1}{2} \left (3-\sqrt{5}\right ) \log \left (1+\sqrt{5}+2 x\right ) \log \left (-1+x+x^2\right )-\frac{\log ^2\left (-1+x+x^2\right )}{2 x^2}+3 \text{Li}_2\left (-\frac{2 x}{1+\sqrt{5}}\right )-\frac{1}{2} \left (3+\sqrt{5}\right ) \text{Li}_2\left (-\frac{1-\sqrt{5}+2 x}{2 \sqrt{5}}\right )-\frac{1}{2} \left (3-\sqrt{5}\right ) \text{Li}_2\left (\frac{1+\sqrt{5}+2 x}{2 \sqrt{5}}\right )-3 \text{Li}_2\left (1+\frac{2 x}{1-\sqrt{5}}\right )\\ \end{align*}

Mathematica [A]  time = 0.74486, size = 826, normalized size = 1.86 $\frac{x \left (\sqrt{5} x \log ^2\left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )+3 x \log ^2\left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-2 \sqrt{5} x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-6 x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )+12 x \log (x) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-12 x \log \left (\frac{2 x}{-1+\sqrt{5}}\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )+2 \sqrt{5} x \log \left (2 x+\sqrt{5}+1\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-6 x \log \left (2 x+\sqrt{5}+1\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-2 \sqrt{5} x \log \left (\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )+6 x \log \left (\frac{2 x+\sqrt{5}+1}{2 \sqrt{5}}\right ) \log \left (x-\frac{\sqrt{5}}{2}+\frac{1}{2}\right )-\sqrt{5} x \log ^2\left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right )+3 x \log ^2\left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right )+4 x \log (x)-12 x \log \left (\frac{1}{2} \left (1+\sqrt{5}\right )\right ) \log (x)-2 \sqrt{5} x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right )-6 x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right )+12 x \log (x) \log \left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right )-2 \sqrt{5} x \log \left (2 x-\sqrt{5}+1\right )-2 x \log \left (2 x-\sqrt{5}+1\right )+\sqrt{5} x \log (5) \log \left (2 x-\sqrt{5}+1\right )+3 x \log (5) \log \left (2 x-\sqrt{5}+1\right )+2 \sqrt{5} x \log \left (2 x+\sqrt{5}+1\right )-2 x \log \left (2 x+\sqrt{5}+1\right )+2 \sqrt{5} x \log \left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right ) \log \left (2 x+\sqrt{5}+1\right )-6 x \log \left (x+\frac{1}{2} \left (1+\sqrt{5}\right )\right ) \log \left (2 x+\sqrt{5}+1\right )+2 \sqrt{5} x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x^2+x-1\right )+6 x \log \left (-2 x+\sqrt{5}-1\right ) \log \left (x^2+x-1\right )-12 x \log (x) \log \left (x^2+x-1\right )-2 \sqrt{5} x \log \left (2 x+\sqrt{5}+1\right ) \log \left (x^2+x-1\right )+6 x \log \left (2 x+\sqrt{5}+1\right ) \log \left (x^2+x-1\right )+4 \log \left (x^2+x-1\right )-4 \sqrt{5} x \text{PolyLog}\left (2,\frac{-2 x+\sqrt{5}-1}{2 \sqrt{5}}\right )-12 x \text{PolyLog}\left (2,\frac{-2 x+\sqrt{5}-1}{-1+\sqrt{5}}\right )+12 x \text{PolyLog}\left (2,-\frac{2 x}{1+\sqrt{5}}\right )\right )-2 \log ^2\left (x^2+x-1\right )}{4 x^2}$

Warning: Unable to verify antiderivative.

[In]

Integrate[Log[-1 + x + x^2]^2/x^3,x]

[Out]

(-2*Log[-1 + x + x^2]^2 + x*(4*x*Log[x] - 12*x*Log[(1 + Sqrt[5])/2]*Log[x] - 6*x*Log[-1 + Sqrt[5] - 2*x]*Log[1
/2 - Sqrt[5]/2 + x] - 2*Sqrt[5]*x*Log[-1 + Sqrt[5] - 2*x]*Log[1/2 - Sqrt[5]/2 + x] + 12*x*Log[x]*Log[1/2 - Sqr
t[5]/2 + x] - 12*x*Log[(2*x)/(-1 + Sqrt[5])]*Log[1/2 - Sqrt[5]/2 + x] + 3*x*Log[1/2 - Sqrt[5]/2 + x]^2 + Sqrt[
5]*x*Log[1/2 - Sqrt[5]/2 + x]^2 - 6*x*Log[-1 + Sqrt[5] - 2*x]*Log[(1 + Sqrt[5])/2 + x] - 2*Sqrt[5]*x*Log[-1 +
Sqrt[5] - 2*x]*Log[(1 + Sqrt[5])/2 + x] + 12*x*Log[x]*Log[(1 + Sqrt[5])/2 + x] + 3*x*Log[(1 + Sqrt[5])/2 + x]^
2 - Sqrt[5]*x*Log[(1 + Sqrt[5])/2 + x]^2 - 2*x*Log[1 - Sqrt[5] + 2*x] - 2*Sqrt[5]*x*Log[1 - Sqrt[5] + 2*x] + 3
*x*Log[5]*Log[1 - Sqrt[5] + 2*x] + Sqrt[5]*x*Log[5]*Log[1 - Sqrt[5] + 2*x] - 2*x*Log[1 + Sqrt[5] + 2*x] + 2*Sq
rt[5]*x*Log[1 + Sqrt[5] + 2*x] - 6*x*Log[1/2 - Sqrt[5]/2 + x]*Log[1 + Sqrt[5] + 2*x] + 2*Sqrt[5]*x*Log[1/2 - S
qrt[5]/2 + x]*Log[1 + Sqrt[5] + 2*x] - 6*x*Log[(1 + Sqrt[5])/2 + x]*Log[1 + Sqrt[5] + 2*x] + 2*Sqrt[5]*x*Log[(
1 + Sqrt[5])/2 + x]*Log[1 + Sqrt[5] + 2*x] + 6*x*Log[1/2 - Sqrt[5]/2 + x]*Log[(1 + Sqrt[5] + 2*x)/(2*Sqrt[5])]
- 2*Sqrt[5]*x*Log[1/2 - Sqrt[5]/2 + x]*Log[(1 + Sqrt[5] + 2*x)/(2*Sqrt[5])] + 4*Log[-1 + x + x^2] + 6*x*Log[-
1 + Sqrt[5] - 2*x]*Log[-1 + x + x^2] + 2*Sqrt[5]*x*Log[-1 + Sqrt[5] - 2*x]*Log[-1 + x + x^2] - 12*x*Log[x]*Log
[-1 + x + x^2] + 6*x*Log[1 + Sqrt[5] + 2*x]*Log[-1 + x + x^2] - 2*Sqrt[5]*x*Log[1 + Sqrt[5] + 2*x]*Log[-1 + x
+ x^2] - 4*Sqrt[5]*x*PolyLog[2, (-1 + Sqrt[5] - 2*x)/(2*Sqrt[5])] - 12*x*PolyLog[2, (-1 + Sqrt[5] - 2*x)/(-1 +
Sqrt[5])] + 12*x*PolyLog[2, (-2*x)/(1 + Sqrt[5])]))/(4*x^2)

________________________________________________________________________________________

Maple [F]  time = 0.022, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( \ln \left ({x}^{2}+x-1 \right ) \right ) ^{2}}{{x}^{3}}}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(ln(x^2+x-1)^2/x^3,x)

[Out]

int(ln(x^2+x-1)^2/x^3,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\frac{\log \left (x^{2} + x - 1\right )^{2}}{2 \, x^{2}} + \int \frac{{\left (2 \, x + 1\right )} \log \left (x^{2} + x - 1\right )}{x^{4} + x^{3} - x^{2}}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x^2+x-1)^2/x^3,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\log \left (x^{2} + x - 1\right )^{2}}{x^{3}}, x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x^2+x-1)^2/x^3,x, algorithm="fricas")

[Out]

integral(log(x^2 + x - 1)^2/x^3, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(x**2+x-1)**2/x**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left (x^{2} + x - 1\right )^{2}}{x^{3}}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x^2+x-1)^2/x^3,x, algorithm="giac")

[Out]

integrate(log(x^2 + x - 1)^2/x^3, x)