\(\int \frac {e^{-x} (12-12 e^x-x+x^2+e^3 (13 x-3 x^2+x^3)+(1+e^3 x) \log (3)+(-13 x+3 x^2-x^3-x \log (3)) \log (x))}{4 x} \, dx\) [3287]

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

Optimal result

Integrand size = 73, antiderivative size = 32 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=\left (-3+e^{-x} \left (3+\frac {1}{4} \left (-x+x^2+\log (3)\right )\right )\right ) \left (-e^3+\log (x)\right ) \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(157\) vs. \(2(32)=64\).

Time = 1.35 (sec) , antiderivative size = 157, normalized size of antiderivative = 4.91, number of steps used = 21, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.110, Rules used = {12, 6874, 2230, 2207, 2225, 2209, 2227, 2634} \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=-\frac {1}{4} e^{3-x} x^2+\frac {1}{4} e^{-x} x^2 \log (x)-\frac {1}{2} e^{3-x} x+\frac {e^{-x} x}{4}-\frac {1}{4} \left (1-3 e^3\right ) e^{-x} x-\frac {e^{3-x}}{2}-\frac {1}{4} \left (1-3 e^3\right ) e^{-x}-\frac {1}{4} e^{-x} x \log (x)-\frac {1}{4} e^{-x} \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x)-3 \log (x)+\frac {1}{4} e^{-x} \left (1-e^3 (13+\log (3))\right ) \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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

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

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]

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{x} \, dx \\ & = \frac {1}{4} \int \left (-\frac {12}{x}+\frac {e^{-x} \left (\left (1-3 e^3\right ) x^2+e^3 x^3+12 \left (1+\frac {\log (3)}{12}\right )-x \left (1-e^3 (13+\log (3))\right )+3 x^2 \log (x)-x^3 \log (x)-13 x \left (1+\frac {\log (3)}{13}\right ) \log (x)\right )}{x}\right ) \, dx \\ & = -3 \log (x)+\frac {1}{4} \int \frac {e^{-x} \left (\left (1-3 e^3\right ) x^2+e^3 x^3+12 \left (1+\frac {\log (3)}{12}\right )-x \left (1-e^3 (13+\log (3))\right )+3 x^2 \log (x)-x^3 \log (x)-13 x \left (1+\frac {\log (3)}{13}\right ) \log (x)\right )}{x} \, dx \\ & = -3 \log (x)+\frac {1}{4} \int \left (\frac {e^{-x} \left (12+\left (1-3 e^3\right ) x^2+e^3 x^3+\log (3)-x \left (1-e^3 (13+\log (3))\right )\right )}{x}-e^{-x} \left (13-3 x+x^2+\log (3)\right ) \log (x)\right ) \, dx \\ & = -3 \log (x)+\frac {1}{4} \int \frac {e^{-x} \left (12+\left (1-3 e^3\right ) x^2+e^3 x^3+\log (3)-x \left (1-e^3 (13+\log (3))\right )\right )}{x} \, dx-\frac {1}{4} \int e^{-x} \left (13-3 x+x^2+\log (3)\right ) \log (x) \, dx \\ & = -3 \log (x)-\frac {1}{4} e^{-x} \log (x)-\frac {1}{4} e^{-x} x \log (x)+\frac {1}{4} e^{-x} x^2 \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x)+\frac {1}{4} \int \frac {e^{-x} \left (-12+x-x^2-\log (3)\right )}{x} \, dx+\frac {1}{4} \int \left (e^{-x} \left (1-3 e^3\right ) x+e^{3-x} x^2+\frac {e^{-x} (12+\log (3))}{x}+e^{-x} \left (-1+e^3 (13+\log (3))\right )\right ) \, dx \\ & = -3 \log (x)-\frac {1}{4} e^{-x} \log (x)-\frac {1}{4} e^{-x} x \log (x)+\frac {1}{4} e^{-x} x^2 \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x)+\frac {1}{4} \int e^{3-x} x^2 \, dx+\frac {1}{4} \int \left (e^{-x}-e^{-x} x+\frac {e^{-x} (-12-\log (3))}{x}\right ) \, dx+\frac {1}{4} \left (1-3 e^3\right ) \int e^{-x} x \, dx+\frac {1}{4} (12+\log (3)) \int \frac {e^{-x}}{x} \, dx+\frac {1}{4} \left (-1+e^3 (13+\log (3))\right ) \int e^{-x} \, dx \\ & = -\frac {1}{4} e^{-x} \left (1-3 e^3\right ) x-\frac {1}{4} e^{3-x} x^2+\frac {1}{4} \text {Ei}(-x) (12+\log (3))+\frac {1}{4} e^{-x} \left (1-e^3 (13+\log (3))\right )-3 \log (x)-\frac {1}{4} e^{-x} \log (x)-\frac {1}{4} e^{-x} x \log (x)+\frac {1}{4} e^{-x} x^2 \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x)+\frac {1}{4} \int e^{-x} \, dx-\frac {1}{4} \int e^{-x} x \, dx+\frac {1}{2} \int e^{3-x} x \, dx+\frac {1}{4} \left (1-3 e^3\right ) \int e^{-x} \, dx+\frac {1}{4} (-12-\log (3)) \int \frac {e^{-x}}{x} \, dx \\ & = -\frac {e^{-x}}{4}-\frac {1}{4} e^{-x} \left (1-3 e^3\right )-\frac {1}{2} e^{3-x} x+\frac {e^{-x} x}{4}-\frac {1}{4} e^{-x} \left (1-3 e^3\right ) x-\frac {1}{4} e^{3-x} x^2+\frac {1}{4} e^{-x} \left (1-e^3 (13+\log (3))\right )-3 \log (x)-\frac {1}{4} e^{-x} \log (x)-\frac {1}{4} e^{-x} x \log (x)+\frac {1}{4} e^{-x} x^2 \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x)-\frac {1}{4} \int e^{-x} \, dx+\frac {1}{2} \int e^{3-x} \, dx \\ & = -\frac {e^{3-x}}{2}-\frac {1}{4} e^{-x} \left (1-3 e^3\right )-\frac {1}{2} e^{3-x} x+\frac {e^{-x} x}{4}-\frac {1}{4} e^{-x} \left (1-3 e^3\right ) x-\frac {1}{4} e^{3-x} x^2+\frac {1}{4} e^{-x} \left (1-e^3 (13+\log (3))\right )-3 \log (x)-\frac {1}{4} e^{-x} \log (x)-\frac {1}{4} e^{-x} x \log (x)+\frac {1}{4} e^{-x} x^2 \log (x)+\frac {1}{4} e^{-x} (13+\log (3)) \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 5.06 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.34 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=\frac {1}{4} e^{-x} \left (-e^3 \left (12-x+x^2+\log (3)\right )+\left (12-12 e^x-x+x^2+\log (3)\right ) \log (x)\right ) \]

[In]

Integrate[(12 - 12*E^x - x + x^2 + E^3*(13*x - 3*x^2 + x^3) + (1 + E^3*x)*Log[3] + (-13*x + 3*x^2 - x^3 - x*Lo
g[3])*Log[x])/(4*E^x*x),x]

[Out]

(-(E^3*(12 - x + x^2 + Log[3])) + (12 - 12*E^x - x + x^2 + Log[3])*Log[x])/(4*E^x)

Maple [A] (verified)

Time = 1.47 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.62

method result size
default \(\frac {\left (x \,{\mathrm e}^{3}+x^{2} \ln \left (x \right )+\left (\ln \left (3\right )+12\right ) \ln \left (x \right )-x^{2} {\mathrm e}^{3}-x \ln \left (x \right )-12 \,{\mathrm e}^{3}-{\mathrm e}^{3} \ln \left (3\right )\right ) {\mathrm e}^{-x}}{4}-3 \ln \left (x \right )\) \(52\)
risch \(\frac {\left (x^{2}+\ln \left (3\right )-x +12\right ) {\mathrm e}^{-x} \ln \left (x \right )}{4}-\frac {\left (x^{2} {\mathrm e}^{3}+12 \,{\mathrm e}^{x} \ln \left (x \right )+{\mathrm e}^{3} \ln \left (3\right )-x \,{\mathrm e}^{3}+12 \,{\mathrm e}^{3}\right ) {\mathrm e}^{-x}}{4}\) \(53\)
parallelrisch \(-\frac {\left (x^{2} {\mathrm e}^{3}-x^{2} \ln \left (x \right )+{\mathrm e}^{3} \ln \left (3\right )-\ln \left (3\right ) \ln \left (x \right )-x \,{\mathrm e}^{3}+x \ln \left (x \right )+12 \,{\mathrm e}^{x} \ln \left (x \right )+12 \,{\mathrm e}^{3}-12 \ln \left (x \right )\right ) {\mathrm e}^{-x}}{4}\) \(55\)
parts \(\left (\left (\frac {\ln \left (3\right )}{4}+3\right ) \ln \left (x \right )+\frac {x \,{\mathrm e}^{3}}{4}-\frac {x^{2} {\mathrm e}^{3}}{4}+\frac {x^{2} \ln \left (x \right )}{4}-\frac {x \ln \left (x \right )}{4}-3 \,{\mathrm e}^{3}-\frac {{\mathrm e}^{3} \ln \left (3\right )}{4}\right ) {\mathrm e}^{-x}-3 \ln \left (x \right )\) \(55\)
norman \(\left (\left (\frac {\ln \left (3\right )}{4}+3\right ) \ln \left (x \right )-3 \,{\mathrm e}^{x} \ln \left (x \right )+\frac {x \,{\mathrm e}^{3}}{4}-\frac {x \ln \left (x \right )}{4}-\frac {x^{2} {\mathrm e}^{3}}{4}+\frac {x^{2} \ln \left (x \right )}{4}-3 \,{\mathrm e}^{3}-\frac {{\mathrm e}^{3} \ln \left (3\right )}{4}\right ) {\mathrm e}^{-x}\) \(56\)

[In]

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

[Out]

1/4*(x*exp(3)+x^2*ln(x)+(ln(3)+12)*ln(x)-x^2*exp(3)-x*ln(x)-12*exp(3)-exp(3)*ln(3))/exp(x)-3*ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.28 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=-\frac {1}{4} \, {\left ({\left (x^{2} - x + 12\right )} e^{3} + e^{3} \log \left (3\right ) - {\left (x^{2} - x - 12 \, e^{x} + \log \left (3\right ) + 12\right )} \log \left (x\right )\right )} e^{\left (-x\right )} \]

[In]

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

[Out]

-1/4*((x^2 - x + 12)*e^3 + e^3*log(3) - (x^2 - x - 12*e^x + log(3) + 12)*log(x))*e^(-x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (26) = 52\).

Time = 0.24 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.75 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=\frac {\left (x^{2} \log {\left (x \right )} - x^{2} e^{3} - x \log {\left (x \right )} + x e^{3} + \log {\left (3 \right )} \log {\left (x \right )} + 12 \log {\left (x \right )} - 12 e^{3} - e^{3} \log {\left (3 \right )}\right ) e^{- x}}{4} - 3 \log {\left (x \right )} \]

[In]

integrate(1/4*((-x*ln(3)-x**3+3*x**2-13*x)*ln(x)-12*exp(x)+(x*exp(3)+1)*ln(3)+(x**3-3*x**2+13*x)*exp(3)+x**2-x
+12)/exp(x)/x,x)

[Out]

(x**2*log(x) - x**2*exp(3) - x*log(x) + x*exp(3) + log(3)*log(x) + 12*log(x) - 12*exp(3) - exp(3)*log(3))*exp(
-x)/4 - 3*log(x)

Maxima [F]

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (26) = 52\).

Time = 0.26 (sec) , antiderivative size = 81, normalized size of antiderivative = 2.53 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=\frac {1}{4} \, x^{2} e^{\left (-x\right )} \log \left (x\right ) - \frac {1}{4} \, x^{2} e^{\left (-x + 3\right )} - \frac {1}{4} \, x e^{\left (-x\right )} \log \left (x\right ) + \frac {1}{4} \, e^{\left (-x\right )} \log \left (3\right ) \log \left (x\right ) + \frac {1}{4} \, x e^{\left (-x + 3\right )} - \frac {1}{4} \, e^{\left (-x + 3\right )} \log \left (3\right ) + 3 \, e^{\left (-x\right )} \log \left (x\right ) - 3 \, e^{\left (-x + 3\right )} - 3 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.29 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.84 \[ \int \frac {e^{-x} \left (12-12 e^x-x+x^2+e^3 \left (13 x-3 x^2+x^3\right )+\left (1+e^3 x\right ) \log (3)+\left (-13 x+3 x^2-x^3-x \log (3)\right ) \log (x)\right )}{4 x} \, dx=\frac {x\,{\mathrm {e}}^{-x}\,\left ({\mathrm {e}}^3-\ln \left (x\right )\right )}{4}-\frac {{\mathrm {e}}^{-x}\,\left (12\,{\mathrm {e}}^x\,\ln \left (x\right )-\ln \left (x\right )\,\left (\ln \left (3\right )+12\right )+{\mathrm {e}}^3\,\left (\ln \left (3\right )+12\right )\right )}{4}-\frac {x^2\,{\mathrm {e}}^{-x}\,\left ({\mathrm {e}}^3-\ln \left (x\right )\right )}{4} \]

[In]

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

[Out]

(x*exp(-x)*(exp(3) - log(x)))/4 - (exp(-x)*(12*exp(x)*log(x) - log(x)*(log(3) + 12) + exp(3)*(log(3) + 12)))/4
 - (x^2*exp(-x)*(exp(3) - log(x)))/4