\(\int \frac {16 x^2+32 x^3+24 x^4+(32 x^2+32 x^3) \log (4)+(-16+8 x^2) \log ^2(4)+e^x (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4))}{x^2} \, dx\) [9188]

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

Optimal result

Integrand size = 78, antiderivative size = 23 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=8 \left (x+\frac {e^x+2 (1+x)}{x}\right ) (x+\log (4))^2 \]

[Out]

8*(x+2*ln(2))^2*((2*x+2+exp(x))/x+x)

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(67\) vs. \(2(23)=46\).

Time = 0.12 (sec) , antiderivative size = 67, normalized size of antiderivative = 2.91, number of steps used = 12, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {14, 2230, 2207, 2225, 2208, 2209} \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=8 x^3+16 x^2 (1+\log (4))+8 e^x x-8 e^x+8 x \left (2+\log ^2(4)+\log (256)\right )+\frac {8 e^x \log ^2(4)}{x}+\frac {16 \log ^2(4)}{x}+8 e^x (1+\log (16)) \]

[In]

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

[Out]

-8*E^x + 8*E^x*x + 8*x^3 + (16*Log[4]^2)/x + (8*E^x*Log[4]^2)/x + 16*x^2*(1 + Log[4]) + 8*E^x*(1 + Log[16]) +
8*x*(2 + Log[4]^2 + Log[256])

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 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2225

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

Rule 2230

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !TrueQ[$UseGamma]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {8 e^x (x+\log (4)) \left (x^2-\log (4)+x (1+\log (4))\right )}{x^2}+\frac {8 \left (3 x^4-2 \log ^2(4)+4 x^3 (1+\log (4))+x^2 \left (2+\log ^2(4)+\log (256)\right )\right )}{x^2}\right ) \, dx \\ & = 8 \int \frac {e^x (x+\log (4)) \left (x^2-\log (4)+x (1+\log (4))\right )}{x^2} \, dx+8 \int \frac {3 x^4-2 \log ^2(4)+4 x^3 (1+\log (4))+x^2 \left (2+\log ^2(4)+\log (256)\right )}{x^2} \, dx \\ & = 8 \int \left (e^x x-\frac {e^x \log ^2(4)}{x^2}+\frac {e^x \log ^2(4)}{x}+e^x (1+\log (16))\right ) \, dx+8 \int \left (3 x^2-\frac {2 \log ^2(4)}{x^2}+4 x (1+\log (4))+2 \left (1+\frac {\log ^2(4)}{2}+\log (16)\right )\right ) \, dx \\ & = 8 x^3+\frac {16 \log ^2(4)}{x}+16 x^2 (1+\log (4))+8 x \left (2+\log ^2(4)+\log (256)\right )+8 \int e^x x \, dx-\left (8 \log ^2(4)\right ) \int \frac {e^x}{x^2} \, dx+\left (8 \log ^2(4)\right ) \int \frac {e^x}{x} \, dx+(8 (1+\log (16))) \int e^x \, dx \\ & = 8 e^x x+8 x^3+\frac {16 \log ^2(4)}{x}+\frac {8 e^x \log ^2(4)}{x}+8 \operatorname {ExpIntegralEi}(x) \log ^2(4)+16 x^2 (1+\log (4))+8 e^x (1+\log (16))+8 x \left (2+\log ^2(4)+\log (256)\right )-8 \int e^x \, dx-\left (8 \log ^2(4)\right ) \int \frac {e^x}{x} \, dx \\ & = -8 e^x+8 e^x x+8 x^3+\frac {16 \log ^2(4)}{x}+\frac {8 e^x \log ^2(4)}{x}+16 x^2 (1+\log (4))+8 e^x (1+\log (16))+8 x \left (2+\log ^2(4)+\log (256)\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(47\) vs. \(2(23)=46\).

Time = 0.23 (sec) , antiderivative size = 47, normalized size of antiderivative = 2.04 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=8 \left (x^3+\frac {\left (2+e^x\right ) \log ^2(4)}{x}+2 x^2 (1+\log (4))+e^x \log (16)+x \left (2+e^x+\log ^2(4)+\log (256)\right )\right ) \]

[In]

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

[Out]

8*(x^3 + ((2 + E^x)*Log[4]^2)/x + 2*x^2*(1 + Log[4]) + E^x*Log[16] + x*(2 + E^x + Log[4]^2 + Log[256]))

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(64\) vs. \(2(23)=46\).

Time = 0.13 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.83

method result size
norman \(\frac {\left (32 \ln \left (2\right )+16\right ) x^{3}+\left (32 \ln \left (2\right )^{2}+64 \ln \left (2\right )+16\right ) x^{2}+8 x^{4}+64 \ln \left (2\right )^{2}+8 \,{\mathrm e}^{x} x^{2}+32 \ln \left (2\right )^{2} {\mathrm e}^{x}+32 x \ln \left (2\right ) {\mathrm e}^{x}}{x}\) \(65\)
risch \(32 x \ln \left (2\right )^{2}+32 x^{2} \ln \left (2\right )+8 x^{3}+64 x \ln \left (2\right )+16 x^{2}+16 x +\frac {64 \ln \left (2\right )^{2}}{x}+\frac {8 \left (4 \ln \left (2\right )^{2}+4 x \ln \left (2\right )+x^{2}\right ) {\mathrm e}^{x}}{x}\) \(65\)
parts \(32 x \ln \left (2\right )^{2}+32 x^{2} \ln \left (2\right )+8 x^{3}+64 x \ln \left (2\right )+16 x^{2}+16 x +\frac {64 \ln \left (2\right )^{2}}{x}+8 \,{\mathrm e}^{x} x +32 \,{\mathrm e}^{x} \ln \left (2\right )+\frac {32 \ln \left (2\right )^{2} {\mathrm e}^{x}}{x}\) \(65\)
parallelrisch \(\frac {32 x^{2} \ln \left (2\right )^{2}+32 x^{3} \ln \left (2\right )+8 x^{4}+32 \ln \left (2\right )^{2} {\mathrm e}^{x}+64 x^{2} \ln \left (2\right )+32 x \ln \left (2\right ) {\mathrm e}^{x}+16 x^{3}+8 \,{\mathrm e}^{x} x^{2}+64 \ln \left (2\right )^{2}+16 x^{2}}{x}\) \(72\)
default \(8 x^{3}+16 x^{2}+16 x +32 x \ln \left (2\right )^{2}+32 x^{2} \ln \left (2\right )+8 \,{\mathrm e}^{x} x +32 \,{\mathrm e}^{x} \ln \left (2\right )+\frac {64 \ln \left (2\right )^{2}}{x}-32 \ln \left (2\right )^{2} \left (-\frac {{\mathrm e}^{x}}{x}-\operatorname {Ei}_{1}\left (-x \right )\right )-32 \ln \left (2\right )^{2} \operatorname {Ei}_{1}\left (-x \right )+64 x \ln \left (2\right )\) \(86\)

[In]

int(((4*(8*x-8)*ln(2)^2+32*x^2*ln(2)+8*x^3+8*x^2)*exp(x)+4*(8*x^2-16)*ln(2)^2+2*(32*x^3+32*x^2)*ln(2)+24*x^4+3
2*x^3+16*x^2)/x^2,x,method=_RETURNVERBOSE)

[Out]

((32*ln(2)+16)*x^3+(32*ln(2)^2+64*ln(2)+16)*x^2+8*x^4+64*ln(2)^2+8*exp(x)*x^2+32*ln(2)^2*exp(x)+32*x*ln(2)*exp
(x))/x

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (23) = 46\).

Time = 0.25 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.65 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=\frac {8 \, {\left (x^{4} + 2 \, x^{3} + 4 \, {\left (x^{2} + 2\right )} \log \left (2\right )^{2} + 2 \, x^{2} + {\left (x^{2} + 4 \, x \log \left (2\right ) + 4 \, \log \left (2\right )^{2}\right )} e^{x} + 4 \, {\left (x^{3} + 2 \, x^{2}\right )} \log \left (2\right )\right )}}{x} \]

[In]

integrate(((4*(8*x-8)*log(2)^2+32*x^2*log(2)+8*x^3+8*x^2)*exp(x)+4*(8*x^2-16)*log(2)^2+2*(32*x^3+32*x^2)*log(2
)+24*x^4+32*x^3+16*x^2)/x^2,x, algorithm="fricas")

[Out]

8*(x^4 + 2*x^3 + 4*(x^2 + 2)*log(2)^2 + 2*x^2 + (x^2 + 4*x*log(2) + 4*log(2)^2)*e^x + 4*(x^3 + 2*x^2)*log(2))/
x

Sympy [B] (verification not implemented)

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

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

[In]

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

[Out]

8*x**3 + x**2*(16 + 32*log(2)) + x*(32*log(2)**2 + 16 + 64*log(2)) + (8*x**2 + 32*x*log(2) + 32*log(2)**2)*exp
(x)/x + 64*log(2)**2/x

Maxima [C] (verification not implemented)

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

Time = 0.23 (sec) , antiderivative size = 78, normalized size of antiderivative = 3.39 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=8 \, x^{3} + 32 \, x^{2} \log \left (2\right ) + 32 \, x \log \left (2\right )^{2} + 32 \, {\rm Ei}\left (x\right ) \log \left (2\right )^{2} - 32 \, \Gamma \left (-1, -x\right ) \log \left (2\right )^{2} + 16 \, x^{2} + 8 \, {\left (x - 1\right )} e^{x} + 64 \, x \log \left (2\right ) + 32 \, e^{x} \log \left (2\right ) + 16 \, x + \frac {64 \, \log \left (2\right )^{2}}{x} + 8 \, e^{x} \]

[In]

integrate(((4*(8*x-8)*log(2)^2+32*x^2*log(2)+8*x^3+8*x^2)*exp(x)+4*(8*x^2-16)*log(2)^2+2*(32*x^3+32*x^2)*log(2
)+24*x^4+32*x^3+16*x^2)/x^2,x, algorithm="maxima")

[Out]

8*x^3 + 32*x^2*log(2) + 32*x*log(2)^2 + 32*Ei(x)*log(2)^2 - 32*gamma(-1, -x)*log(2)^2 + 16*x^2 + 8*(x - 1)*e^x
 + 64*x*log(2) + 32*e^x*log(2) + 16*x + 64*log(2)^2/x + 8*e^x

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (23) = 46\).

Time = 0.28 (sec) , antiderivative size = 69, normalized size of antiderivative = 3.00 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=\frac {8 \, {\left (x^{4} + 4 \, x^{3} \log \left (2\right ) + 4 \, x^{2} \log \left (2\right )^{2} + 2 \, x^{3} + x^{2} e^{x} + 8 \, x^{2} \log \left (2\right ) + 4 \, x e^{x} \log \left (2\right ) + 4 \, e^{x} \log \left (2\right )^{2} + 2 \, x^{2} + 8 \, \log \left (2\right )^{2}\right )}}{x} \]

[In]

integrate(((4*(8*x-8)*log(2)^2+32*x^2*log(2)+8*x^3+8*x^2)*exp(x)+4*(8*x^2-16)*log(2)^2+2*(32*x^3+32*x^2)*log(2
)+24*x^4+32*x^3+16*x^2)/x^2,x, algorithm="giac")

[Out]

8*(x^4 + 4*x^3*log(2) + 4*x^2*log(2)^2 + 2*x^3 + x^2*e^x + 8*x^2*log(2) + 4*x*e^x*log(2) + 4*e^x*log(2)^2 + 2*
x^2 + 8*log(2)^2)/x

Mupad [B] (verification not implemented)

Time = 13.82 (sec) , antiderivative size = 59, normalized size of antiderivative = 2.57 \[ \int \frac {16 x^2+32 x^3+24 x^4+\left (32 x^2+32 x^3\right ) \log (4)+\left (-16+8 x^2\right ) \log ^2(4)+e^x \left (8 x^2+8 x^3+16 x^2 \log (4)+(-8+8 x) \log ^2(4)\right )}{x^2} \, dx=x^2\,\left (32\,\ln \left (2\right )+16\right )+x\,\left (64\,\ln \left (2\right )+8\,{\mathrm {e}}^x+32\,{\ln \left (2\right )}^2+16\right )+32\,{\mathrm {e}}^x\,\ln \left (2\right )+\frac {32\,{\mathrm {e}}^x\,{\ln \left (2\right )}^2+64\,{\ln \left (2\right )}^2}{x}+8\,x^3 \]

[In]

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

[Out]

x^2*(32*log(2) + 16) + x*(64*log(2) + 8*exp(x) + 32*log(2)^2 + 16) + 32*exp(x)*log(2) + (32*exp(x)*log(2)^2 +
64*log(2)^2)/x + 8*x^3