3.5.83 \(\int \frac {1+x+(1+2 x+x^2) \log (x)+(-2-4 x) \log (x) \log (x+x^2)}{(x+x^2) \log (x)} \, dx\) [483]

Optimal. Leaf size=20 \[ -\log ^2\left (x+x^2\right )+\log \left (4 e^x x \log (x)\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(47\) vs. \(2(20)=40\).
time = 0.31, antiderivative size = 47, normalized size of antiderivative = 2.35, number of steps used = 19, number of rules used = 11, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.275, Rules used = {1607, 6874, 45, 2339, 29, 2594, 2580, 2338, 2354, 2438, 2437} \begin {gather*} x+\log ^2(x)+\log ^2(x+1)+2 \log (x+1) \log (x)-2 \log (x (x+1)) \log (x)+\log (x)-2 \log (x+1) \log (x (x+1))+\log (\log (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x + Log[x] + Log[x]^2 + 2*Log[x]*Log[1 + x] + Log[1 + x]^2 - 2*Log[x]*Log[x*(1 + x)] - 2*Log[1 + x]*Log[x*(1 +
 x)] + Log[Log[x]]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

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 1607

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]

Rule 2338

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 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

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 2437

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 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 2580

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]/((g_.) + (h_.)*(x_)), x_Sym
bol] :> Simp[Log[g + h*x]*(Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]/h), x] + (-Dist[b*p*(r/h), Int[Log[g + h*x]/(a
 + b*x), x], x] - Dist[d*q*(r/h), Int[Log[g + h*x]/(c + d*x), x], x]) /; FreeQ[{a, b, c, d, e, f, g, h, p, q,
r}, x] && NeQ[b*c - a*d, 0]

Rule 2594

Int[Log[(e_.)*((f_.)*((a_.) + (b_.)*(x_))^(p_.)*((c_.) + (d_.)*(x_))^(q_.))^(r_.)]^(s_.)*(RFx_), x_Symbol] :>
With[{u = ExpandIntegrand[Log[e*(f*(a + b*x)^p*(c + d*x)^q)^r]^s, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a,
 b, c, d, e, f, p, q, r, s}, x] && RationalFunctionQ[RFx, x] && IGtQ[s, 0]

Rule 6874

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {1+x+\left (1+2 x+x^2\right ) \log (x)+(-2-4 x) \log (x) \log \left (x+x^2\right )}{x (1+x) \log (x)} \, dx\\ &=\int \left (\frac {1+\log (x)+x \log (x)}{x \log (x)}-\frac {2 (1+2 x) \log (x (1+x))}{x (1+x)}\right ) \, dx\\ &=-\left (2 \int \frac {(1+2 x) \log (x (1+x))}{x (1+x)} \, dx\right )+\int \frac {1+\log (x)+x \log (x)}{x \log (x)} \, dx\\ &=-\left (2 \int \left (\frac {\log (x (1+x))}{x}+\frac {\log (x (1+x))}{1+x}\right ) \, dx\right )+\int \left (\frac {1+x}{x}+\frac {1}{x \log (x)}\right ) \, dx\\ &=-\left (2 \int \frac {\log (x (1+x))}{x} \, dx\right )-2 \int \frac {\log (x (1+x))}{1+x} \, dx+\int \frac {1+x}{x} \, dx+\int \frac {1}{x \log (x)} \, dx\\ &=-2 \log (x) \log (x (1+x))-2 \log (1+x) \log (x (1+x))+2 \int \frac {\log (x)}{x} \, dx+2 \int \frac {\log (x)}{1+x} \, dx+2 \int \frac {\log (1+x)}{x} \, dx+2 \int \frac {\log (1+x)}{1+x} \, dx+\int \left (1+\frac {1}{x}\right ) \, dx+\text {Subst}\left (\int \frac {1}{x} \, dx,x,\log (x)\right )\\ &=x+\log (x)+\log ^2(x)+2 \log (x) \log (1+x)-2 \log (x) \log (x (1+x))-2 \log (1+x) \log (x (1+x))+\log (\log (x))-2 \text {Li}_2(-x)-2 \int \frac {\log (1+x)}{x} \, dx+2 \text {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,1+x\right )\\ &=x+\log (x)+\log ^2(x)+2 \log (x) \log (1+x)+\log ^2(1+x)-2 \log (x) \log (x (1+x))-2 \log (1+x) \log (x (1+x))+\log (\log (x))\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 17, normalized size = 0.85 \begin {gather*} x+\log (x)-\log ^2(x (1+x))+\log (\log (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x + Log[x] - Log[x*(1 + x)]^2 + Log[Log[x]]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(47\) vs. \(2(19)=38\).
time = 0.18, size = 48, normalized size = 2.40

method result size
norman \(x +\ln \left (x^{2}+x \right )-\ln \left (x^{2}+x \right )^{2}-\ln \left (x +1\right )+\ln \left (\ln \left (x \right )\right )\) \(28\)
default \(\ln \left (\ln \left (x \right )\right )+x +\ln \left (x \right )-2 \ln \left (x \right ) \ln \left (x^{2}+x \right )+\ln \left (x \right )^{2}+2 \ln \left (x \right ) \ln \left (x +1\right )-2 \ln \left (x +1\right ) \ln \left (x^{2}+x \right )+\ln \left (x +1\right )^{2}\) \(48\)
risch \(\ln \left (\ln \left (x \right )\right )+x +i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i \left (x +1\right )\right ) \mathrm {csgn}\left (i x \left (x +1\right )\right ) \ln \left (x \right )-i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )^{2} \ln \left (x \right )-i \pi \,\mathrm {csgn}\left (i \left (x +1\right )\right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )^{2} \ln \left (x \right )+i \pi \mathrm {csgn}\left (i x \left (x +1\right )\right )^{3} \ln \left (x \right )+\ln \left (x \right )+i \pi \ln \left (x +1\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i \left (x +1\right )\right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )-i \pi \ln \left (x +1\right ) \mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )^{2}-i \pi \ln \left (x +1\right ) \mathrm {csgn}\left (i \left (x +1\right )\right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )^{2}+i \pi \ln \left (x +1\right ) \mathrm {csgn}\left (i x \left (x +1\right )\right )^{3}-\ln \left (x \right )^{2}-2 \ln \left (x \right ) \ln \left (x +1\right )-\ln \left (x +1\right )^{2}\) \(210\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-4*x-2)*ln(x)*ln(x^2+x)+(x^2+2*x+1)*ln(x)+x+1)/(x^2+x)/ln(x),x,method=_RETURNVERBOSE)

[Out]

ln(ln(x))+x+ln(x)-2*ln(x)*ln(x^2+x)+ln(x)^2+2*ln(x)*ln(x+1)-2*ln(x+1)*ln(x^2+x)+ln(x+1)^2

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 29, normalized size = 1.45 \begin {gather*} -\log \left (x + 1\right )^{2} - 2 \, \log \left (x + 1\right ) \log \left (x\right ) - \log \left (x\right )^{2} + x + \log \left (x\right ) + \log \left (\log \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.31, size = 17, normalized size = 0.85 \begin {gather*} -\log \left (x^{2} + x\right )^{2} + x + \log \left (x\right ) + \log \left (\log \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(x^2 + x)^2 + x + log(x) + log(log(x))

________________________________________________________________________________________

Sympy [A]
time = 0.12, size = 17, normalized size = 0.85 \begin {gather*} x + \log {\left (x \right )} - \log {\left (x^{2} + x \right )}^{2} + \log {\left (\log {\left (x \right )} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 32, normalized size = 1.60 \begin {gather*} -2 \, {\left (\log \left (x + 1\right ) + \log \left (x\right )\right )} \log \left (x + 1\right ) + \log \left (x + 1\right )^{2} - \log \left (x\right )^{2} + x + \log \left (x\right ) + \log \left (\log \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.66, size = 17, normalized size = 0.85 \begin {gather*} -{\ln \left (x^2+x\right )}^2+x+\ln \left (\ln \left (x\right )\right )+\ln \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(log(x)) + log(x) - log(x + x^2)^2

________________________________________________________________________________________