\(\int \frac {8 e^{2 x} x+12 x^2+e^x (-8 x-8 x^2)+(-10+6 x^2+e^{2 x} (-2+8 x)+e^x (-4 x-8 x^2)) \log (x)+(-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)) \log ^2(x)}{x^2} \, dx\) [8887]

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

Optimal result

Integrand size = 94, antiderivative size = 28 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=4 x+\frac {x+\left (5+\left (e^x-x\right )^2\right ) (2+\log (x))^2}{x} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(77\) vs. \(2(28)=56\).

Time = 0.17 (sec) , antiderivative size = 77, normalized size of antiderivative = 2.75, number of steps used = 14, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.085, Rules used = {14, 2326, 2372, 2395, 2333, 2332, 2342, 2341} \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\frac {e^{2 x} (\log (x)+2) (2 x+x \log (x))}{x^2}+8 x+\frac {20}{x}+x \log ^2(x)+\frac {5 \log ^2(x)}{x}+4 x \log (x)+\frac {20 \log (x)}{x}-\frac {2 e^x (\log (x)+2) (2 x+x \log (x))}{x} \]

[In]

Int[(8*E^(2*x)*x + 12*x^2 + E^x*(-8*x - 8*x^2) + (-10 + 6*x^2 + E^(2*x)*(-2 + 8*x) + E^x*(-4*x - 8*x^2))*Log[x
] + (-5 + x^2 - 2*E^x*x^2 + E^(2*x)*(-1 + 2*x))*Log[x]^2)/x^2,x]

[Out]

20/x + 8*x + (20*Log[x])/x + 4*x*Log[x] + (5*Log[x]^2)/x + x*Log[x]^2 + (E^(2*x)*(2 + Log[x])*(2*x + x*Log[x])
)/x^2 - (2*E^x*(2 + Log[x])*(2*x + x*Log[x]))/x

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

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

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]]
 /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 2395

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

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {2 e^x (2+\log (x)) (2+2 x+x \log (x))}{x}+\frac {e^{2 x} (2+\log (x)) (4 x-\log (x)+2 x \log (x))}{x^2}+\frac {12 x^2-10 \log (x)+6 x^2 \log (x)-5 \log ^2(x)+x^2 \log ^2(x)}{x^2}\right ) \, dx \\ & = -\left (2 \int \frac {e^x (2+\log (x)) (2+2 x+x \log (x))}{x} \, dx\right )+\int \frac {e^{2 x} (2+\log (x)) (4 x-\log (x)+2 x \log (x))}{x^2} \, dx+\int \frac {12 x^2-10 \log (x)+6 x^2 \log (x)-5 \log ^2(x)+x^2 \log ^2(x)}{x^2} \, dx \\ & = \frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x}+\int \left (12+\frac {2 \left (-5+3 x^2\right ) \log (x)}{x^2}+\frac {\left (-5+x^2\right ) \log ^2(x)}{x^2}\right ) \, dx \\ & = 12 x+\frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x}+2 \int \frac {\left (-5+3 x^2\right ) \log (x)}{x^2} \, dx+\int \frac {\left (-5+x^2\right ) \log ^2(x)}{x^2} \, dx \\ & = 12 x+\frac {10 \log (x)}{x}+6 x \log (x)+\frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x}-2 \int \left (3+\frac {5}{x^2}\right ) \, dx+\int \left (\log ^2(x)-\frac {5 \log ^2(x)}{x^2}\right ) \, dx \\ & = \frac {10}{x}+6 x+\frac {10 \log (x)}{x}+6 x \log (x)+\frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x}-5 \int \frac {\log ^2(x)}{x^2} \, dx+\int \log ^2(x) \, dx \\ & = \frac {10}{x}+6 x+\frac {10 \log (x)}{x}+6 x \log (x)+\frac {5 \log ^2(x)}{x}+x \log ^2(x)+\frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x}-2 \int \log (x) \, dx-10 \int \frac {\log (x)}{x^2} \, dx \\ & = \frac {20}{x}+8 x+\frac {20 \log (x)}{x}+4 x \log (x)+\frac {5 \log ^2(x)}{x}+x \log ^2(x)+\frac {e^{2 x} (2+\log (x)) (2 x+x \log (x))}{x^2}-\frac {2 e^x (2+\log (x)) (2 x+x \log (x))}{x} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(66\) vs. \(2(28)=56\).

Time = 0.09 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.36 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\frac {4 \left (5+e^{2 x}-2 e^x x+2 x^2\right )+4 \left (5+e^{2 x}-2 e^x x+x^2\right ) \log (x)+\left (5+e^{2 x}-2 e^x x+x^2\right ) \log ^2(x)}{x} \]

[In]

Integrate[(8*E^(2*x)*x + 12*x^2 + E^x*(-8*x - 8*x^2) + (-10 + 6*x^2 + E^(2*x)*(-2 + 8*x) + E^x*(-4*x - 8*x^2))
*Log[x] + (-5 + x^2 - 2*E^x*x^2 + E^(2*x)*(-1 + 2*x))*Log[x]^2)/x^2,x]

[Out]

(4*(5 + E^(2*x) - 2*E^x*x + 2*x^2) + 4*(5 + E^(2*x) - 2*E^x*x + x^2)*Log[x] + (5 + E^(2*x) - 2*E^x*x + x^2)*Lo
g[x]^2)/x

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(65\) vs. \(2(27)=54\).

Time = 0.18 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.36

method result size
risch \(\frac {\left (x^{2}-2 \,{\mathrm e}^{x} x +{\mathrm e}^{2 x}+5\right ) \ln \left (x \right )^{2}}{x}+\frac {4 \left (x^{2}-2 \,{\mathrm e}^{x} x +{\mathrm e}^{2 x}+5\right ) \ln \left (x \right )}{x}+\frac {8 x^{2}-8 \,{\mathrm e}^{x} x +4 \,{\mathrm e}^{2 x}+20}{x}\) \(66\)
parallelrisch \(\frac {x^{2} \ln \left (x \right )^{2}-2 x \,{\mathrm e}^{x} \ln \left (x \right )^{2}+\ln \left (x \right )^{2} {\mathrm e}^{2 x}+4 x^{2} \ln \left (x \right )-8 x \,{\mathrm e}^{x} \ln \left (x \right )+4 \ln \left (x \right ) {\mathrm e}^{2 x}+8 x^{2}-8 \,{\mathrm e}^{x} x +20+5 \ln \left (x \right )^{2}+4 \,{\mathrm e}^{2 x}+20 \ln \left (x \right )}{x}\) \(81\)
default \(8 x -8 \,{\mathrm e}^{x} \ln \left (x \right )-2 \,{\mathrm e}^{x} \ln \left (x \right )^{2}-8 \,{\mathrm e}^{x}+\frac {\ln \left (x \right )^{2} {\mathrm e}^{2 x}+4 \ln \left (x \right ) {\mathrm e}^{2 x}+4 \,{\mathrm e}^{2 x}}{x}+x \ln \left (x \right )^{2}+4 x \ln \left (x \right )+\frac {5 \ln \left (x \right )^{2}}{x}+\frac {20 \ln \left (x \right )}{x}+\frac {20}{x}\) \(83\)

[In]

int((((-1+2*x)*exp(x)^2-2*exp(x)*x^2+x^2-5)*ln(x)^2+((8*x-2)*exp(x)^2+(-8*x^2-4*x)*exp(x)+6*x^2-10)*ln(x)+8*x*
exp(x)^2+(-8*x^2-8*x)*exp(x)+12*x^2)/x^2,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 59 vs. \(2 (27) = 54\).

Time = 0.27 (sec) , antiderivative size = 59, normalized size of antiderivative = 2.11 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\frac {{\left (x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )} + 5\right )} \log \left (x\right )^{2} + 8 \, x^{2} - 8 \, x e^{x} + 4 \, {\left (x^{2} - 2 \, x e^{x} + e^{\left (2 \, x\right )} + 5\right )} \log \left (x\right ) + 4 \, e^{\left (2 \, x\right )} + 20}{x} \]

[In]

integrate((((-1+2*x)*exp(x)^2-2*exp(x)*x^2+x^2-5)*log(x)^2+((8*x-2)*exp(x)^2+(-8*x^2-4*x)*exp(x)+6*x^2-10)*log
(x)+8*x*exp(x)^2+(-8*x^2-8*x)*exp(x)+12*x^2)/x^2,x, algorithm="fricas")

[Out]

((x^2 - 2*x*e^x + e^(2*x) + 5)*log(x)^2 + 8*x^2 - 8*x*e^x + 4*(x^2 - 2*x*e^x + e^(2*x) + 5)*log(x) + 4*e^(2*x)
 + 20)/x

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 71 vs. \(2 (20) = 40\).

Time = 0.16 (sec) , antiderivative size = 71, normalized size of antiderivative = 2.54 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=8 x + \frac {\left (x^{2} + 5\right ) \log {\left (x \right )}^{2}}{x} + \frac {\left (4 x^{2} + 20\right ) \log {\left (x \right )}}{x} + \frac {\left (- 2 x \log {\left (x \right )}^{2} - 8 x \log {\left (x \right )} - 8 x\right ) e^{x} + \left (\log {\left (x \right )}^{2} + 4 \log {\left (x \right )} + 4\right ) e^{2 x}}{x} + \frac {20}{x} \]

[In]

integrate((((-1+2*x)*exp(x)**2-2*exp(x)*x**2+x**2-5)*ln(x)**2+((8*x-2)*exp(x)**2+(-8*x**2-4*x)*exp(x)+6*x**2-1
0)*ln(x)+8*x*exp(x)**2+(-8*x**2-8*x)*exp(x)+12*x**2)/x**2,x)

[Out]

8*x + (x**2 + 5)*log(x)**2/x + (4*x**2 + 20)*log(x)/x + ((-2*x*log(x)**2 - 8*x*log(x) - 8*x)*exp(x) + (log(x)*
*2 + 4*log(x) + 4)*exp(2*x))/x + 20/x

Maxima [F]

\[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\int { -\frac {{\left (2 \, x^{2} e^{x} - x^{2} - {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 5\right )} \log \left (x\right )^{2} - 12 \, x^{2} - 8 \, x e^{\left (2 \, x\right )} + 8 \, {\left (x^{2} + x\right )} e^{x} - 2 \, {\left (3 \, x^{2} + {\left (4 \, x - 1\right )} e^{\left (2 \, x\right )} - 2 \, {\left (2 \, x^{2} + x\right )} e^{x} - 5\right )} \log \left (x\right )}{x^{2}} \,d x } \]

[In]

integrate((((-1+2*x)*exp(x)^2-2*exp(x)*x^2+x^2-5)*log(x)^2+((8*x-2)*exp(x)^2+(-8*x^2-4*x)*exp(x)+6*x^2-10)*log
(x)+8*x*exp(x)^2+(-8*x^2-8*x)*exp(x)+12*x^2)/x^2,x, algorithm="maxima")

[Out]

6*x*log(x) - 8*e^x*log(x) + 6*x - (2*x*e^x*log(x)^2 - (x^2 + 5)*log(x)^2 - 2*x^2 - (log(x)^2 + 4*log(x))*e^(2*
x) + 2*(x^2 - 5)*log(x) - 10)/x + 10*log(x)/x + 10/x + 8*Ei(2*x) - 8*e^x - 4*integrate(e^(2*x)/x^2, x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 80 vs. \(2 (27) = 54\).

Time = 0.30 (sec) , antiderivative size = 80, normalized size of antiderivative = 2.86 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\frac {x^{2} \log \left (x\right )^{2} - 2 \, x e^{x} \log \left (x\right )^{2} + 4 \, x^{2} \log \left (x\right ) - 8 \, x e^{x} \log \left (x\right ) + e^{\left (2 \, x\right )} \log \left (x\right )^{2} + 8 \, x^{2} - 8 \, x e^{x} + 4 \, e^{\left (2 \, x\right )} \log \left (x\right ) + 5 \, \log \left (x\right )^{2} + 4 \, e^{\left (2 \, x\right )} + 20 \, \log \left (x\right ) + 20}{x} \]

[In]

integrate((((-1+2*x)*exp(x)^2-2*exp(x)*x^2+x^2-5)*log(x)^2+((8*x-2)*exp(x)^2+(-8*x^2-4*x)*exp(x)+6*x^2-10)*log
(x)+8*x*exp(x)^2+(-8*x^2-8*x)*exp(x)+12*x^2)/x^2,x, algorithm="giac")

[Out]

(x^2*log(x)^2 - 2*x*e^x*log(x)^2 + 4*x^2*log(x) - 8*x*e^x*log(x) + e^(2*x)*log(x)^2 + 8*x^2 - 8*x*e^x + 4*e^(2
*x)*log(x) + 5*log(x)^2 + 4*e^(2*x) + 20*log(x) + 20)/x

Mupad [B] (verification not implemented)

Time = 13.40 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.50 \[ \int \frac {8 e^{2 x} x+12 x^2+e^x \left (-8 x-8 x^2\right )+\left (-10+6 x^2+e^{2 x} (-2+8 x)+e^x \left (-4 x-8 x^2\right )\right ) \log (x)+\left (-5+x^2-2 e^x x^2+e^{2 x} (-1+2 x)\right ) \log ^2(x)}{x^2} \, dx=\frac {4\,{\mathrm {e}}^{2\,x}+20\,\ln \left (x\right )+5\,{\ln \left (x\right )}^2+4\,{\mathrm {e}}^{2\,x}\,\ln \left (x\right )+{\mathrm {e}}^{2\,x}\,{\ln \left (x\right )}^2+20}{x}-8\,{\mathrm {e}}^x\,\ln \left (x\right )-8\,{\mathrm {e}}^x-2\,{\mathrm {e}}^x\,{\ln \left (x\right )}^2+x\,\left ({\ln \left (x\right )}^2+4\,\ln \left (x\right )+8\right ) \]

[In]

int(-(log(x)^2*(2*x^2*exp(x) - exp(2*x)*(2*x - 1) - x^2 + 5) - 8*x*exp(2*x) + log(x)*(exp(x)*(4*x + 8*x^2) - e
xp(2*x)*(8*x - 2) - 6*x^2 + 10) + exp(x)*(8*x + 8*x^2) - 12*x^2)/x^2,x)

[Out]

(4*exp(2*x) + 20*log(x) + 5*log(x)^2 + 4*exp(2*x)*log(x) + exp(2*x)*log(x)^2 + 20)/x - 8*exp(x)*log(x) - 8*exp
(x) - 2*exp(x)*log(x)^2 + x*(4*log(x) + log(x)^2 + 8)