\(\int \frac {e (-24-8 x)+42 x^2+(-18 x^2+e (24+8 x)) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx\) [4516]

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

Optimal result

Integrand size = 58, antiderivative size = 24 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=x \left (-x+3 \left (-2-\frac {2 x^2}{e (-2+\log (x))}\right )\right ) \]

[Out]

x*(-6-6*x^2/exp(1)/(ln(x)-2)-x)

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {6873, 12, 6874, 2343, 2346, 2209} \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=\frac {6 x^3}{e (2-\log (x))}-(x+3)^2 \]

[In]

Int[(E*(-24 - 8*x) + 42*x^2 + (-18*x^2 + E*(24 + 8*x))*Log[x] + E*(-6 - 2*x)*Log[x]^2)/(4*E - 4*E*Log[x] + E*L
og[x]^2),x]

[Out]

-(3 + x)^2 + (6*x^3)/(E*(2 - Log[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 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 2343

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log
[c*x^n])^(p + 1)/(b*d*n*(p + 1))), x] - Dist[(m + 1)/(b*n*(p + 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] && LtQ[p, -1]

Rule 2346

Int[((a_.) + Log[(c_.)*(x_)]*(b_.))^(p_)*(x_)^(m_.), x_Symbol] :> Dist[1/c^(m + 1), Subst[Int[E^((m + 1)*x)*(a
 + b*x)^p, x], x, Log[c*x]], x] /; FreeQ[{a, b, c, p}, x] && IntegerQ[m]

Rule 6873

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

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{e (2-\log (x))^2} \, dx \\ & = \frac {\int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{(2-\log (x))^2} \, dx}{e} \\ & = \frac {\int \left (-2 e (3+x)+\frac {6 x^2}{(-2+\log (x))^2}-\frac {18 x^2}{-2+\log (x)}\right ) \, dx}{e} \\ & = -(3+x)^2+\frac {6 \int \frac {x^2}{(-2+\log (x))^2} \, dx}{e}-\frac {18 \int \frac {x^2}{-2+\log (x)} \, dx}{e} \\ & = -(3+x)^2+\frac {6 x^3}{e (2-\log (x))}+\frac {18 \int \frac {x^2}{-2+\log (x)} \, dx}{e}-\frac {18 \text {Subst}\left (\int \frac {e^{3 x}}{-2+x} \, dx,x,\log (x)\right )}{e} \\ & = -(3+x)^2-18 e^5 \text {Ei}(-3 (2-\log (x)))+\frac {6 x^3}{e (2-\log (x))}+\frac {18 \text {Subst}\left (\int \frac {e^{3 x}}{-2+x} \, dx,x,\log (x)\right )}{e} \\ & = -(3+x)^2+\frac {6 x^3}{e (2-\log (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=-\frac {2 \left (\frac {1}{2} e x (6+x)+\frac {3 x^3}{-2+\log (x)}\right )}{e} \]

[In]

Integrate[(E*(-24 - 8*x) + 42*x^2 + (-18*x^2 + E*(24 + 8*x))*Log[x] + E*(-6 - 2*x)*Log[x]^2)/(4*E - 4*E*Log[x]
 + E*Log[x]^2),x]

[Out]

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

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.96

method result size
risch \(-x^{2}-6 x -\frac {6 x^{3} {\mathrm e}^{-1}}{\ln \left (x \right )-2}\) \(23\)
norman \(\frac {12 x +2 x^{2}-6 x \ln \left (x \right )-x^{2} \ln \left (x \right )-6 x^{3} {\mathrm e}^{-1}}{\ln \left (x \right )-2}\) \(38\)
parallelrisch \(\frac {\left (-x^{2} {\mathrm e} \ln \left (x \right )+2 x^{2} {\mathrm e}-6 x \,{\mathrm e} \ln \left (x \right )-6 x^{3}+12 x \,{\mathrm e}\right ) {\mathrm e}^{-1}}{\ln \left (x \right )-2}\) \(46\)
default \(-2 \,{\mathrm e}^{-1} \left ({\mathrm e} \left (\frac {x^{2}}{2}-12 \,{\mathrm e}^{4} \operatorname {Ei}_{1}\left (-2 \ln \left (x \right )+4\right )-\frac {4 x^{2}}{\ln \left (x \right )-2}\right )+\frac {3 x^{3}}{\ln \left (x \right )-2}+12 \,{\mathrm e} \left (-\frac {x}{\ln \left (x \right )-2}-{\mathrm e}^{2} \operatorname {Ei}_{1}\left (-\ln \left (x \right )+2\right )\right )+4 \,{\mathrm e} \left (-\frac {x^{2}}{\ln \left (x \right )-2}-2 \,{\mathrm e}^{4} \operatorname {Ei}_{1}\left (-2 \ln \left (x \right )+4\right )\right )-12 \,{\mathrm e} \left (-3 \,{\mathrm e}^{2} \operatorname {Ei}_{1}\left (-\ln \left (x \right )+2\right )-\frac {2 x}{\ln \left (x \right )-2}\right )+3 \,{\mathrm e} \left (x -8 \,{\mathrm e}^{2} \operatorname {Ei}_{1}\left (-\ln \left (x \right )+2\right )-\frac {4 x}{\ln \left (x \right )-2}\right )-4 \,{\mathrm e} \left (-5 \,{\mathrm e}^{4} \operatorname {Ei}_{1}\left (-2 \ln \left (x \right )+4\right )-\frac {2 x^{2}}{\ln \left (x \right )-2}\right )\right )\) \(186\)

[In]

int(((-2*x-6)*exp(1)*ln(x)^2+((8*x+24)*exp(1)-18*x^2)*ln(x)+(-8*x-24)*exp(1)+42*x^2)/(exp(1)*ln(x)^2-4*exp(1)*
ln(x)+4*exp(1)),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (19) = 38\).

Time = 0.24 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.79 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=-\frac {6 \, x^{3} + {\left (x^{2} + 6 \, x\right )} e \log \left (x\right ) - 2 \, {\left (x^{2} + 6 \, x\right )} e}{e \log \left (x\right ) - 2 \, e} \]

[In]

integrate(((-2*x-6)*exp(1)*log(x)^2+((8*x+24)*exp(1)-18*x^2)*log(x)+(-8*x-24)*exp(1)+42*x^2)/(exp(1)*log(x)^2-
4*exp(1)*log(x)+4*exp(1)),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=- \frac {6 x^{3}}{e \log {\left (x \right )} - 2 e} - x^{2} - 6 x \]

[In]

integrate(((-2*x-6)*exp(1)*ln(x)**2+((8*x+24)*exp(1)-18*x**2)*ln(x)+(-8*x-24)*exp(1)+42*x**2)/(exp(1)*ln(x)**2
-4*exp(1)*ln(x)+4*exp(1)),x)

[Out]

-6*x**3/(E*log(x) - 2*E) - x**2 - 6*x

Maxima [F]

\[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=\int { -\frac {2 \, {\left ({\left (x + 3\right )} e \log \left (x\right )^{2} - 21 \, x^{2} + 4 \, {\left (x + 3\right )} e + {\left (9 \, x^{2} - 4 \, {\left (x + 3\right )} e\right )} \log \left (x\right )\right )}}{e \log \left (x\right )^{2} - 4 \, e \log \left (x\right ) + 4 \, e} \,d x } \]

[In]

integrate(((-2*x-6)*exp(1)*log(x)^2+((8*x+24)*exp(1)-18*x^2)*log(x)+(-8*x-24)*exp(1)+42*x^2)/(exp(1)*log(x)^2-
4*exp(1)*log(x)+4*exp(1)),x, algorithm="maxima")

[Out]

24*e^2*exp_integral_e(2, -log(x) + 2)/(log(x) - 2) + 8*e^4*exp_integral_e(2, -2*log(x) + 4)/(log(x) - 2) - 42*
e^5*exp_integral_e(2, -3*log(x) + 6)/(log(x) - 2) + (36*x^3 - 6*x^2*e - 12*x*e - (x^2*e + 6*x*e)*log(x))/(e*lo
g(x) - 2*e) - 2*integrate((63*x^2 - 8*x*e - 12*e)/(e*log(x) - 2*e), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (19) = 38\).

Time = 0.26 (sec) , antiderivative size = 94, normalized size of antiderivative = 3.92 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=-\frac {x^{2} e \log \left (x\right )}{e \log \left (x\right ) - 2 \, e} - \frac {6 \, x^{3}}{e \log \left (x\right ) - 2 \, e} + \frac {2 \, x^{2} e}{e \log \left (x\right ) - 2 \, e} - \frac {6 \, x e \log \left (x\right )}{e \log \left (x\right ) - 2 \, e} + \frac {12 \, x e}{e \log \left (x\right ) - 2 \, e} \]

[In]

integrate(((-2*x-6)*exp(1)*log(x)^2+((8*x+24)*exp(1)-18*x^2)*log(x)+(-8*x-24)*exp(1)+42*x^2)/(exp(1)*log(x)^2-
4*exp(1)*log(x)+4*exp(1)),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 13.60 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.75 \[ \int \frac {e (-24-8 x)+42 x^2+\left (-18 x^2+e (24+8 x)\right ) \log (x)+e (-6-2 x) \log ^2(x)}{4 e-4 e \log (x)+e \log ^2(x)} \, dx=\frac {6\,x^4}{2\,x\,\mathrm {e}-x\,\mathrm {e}\,\ln \left (x\right )}-\frac {{\mathrm {e}}^{-1}\,\left (\mathrm {e}\,x^3+6\,\mathrm {e}\,x^2\right )}{x} \]

[In]

int(-(log(x)*(18*x^2 - exp(1)*(8*x + 24)) - 42*x^2 + exp(1)*(8*x + 24) + exp(1)*log(x)^2*(2*x + 6))/(4*exp(1)
+ exp(1)*log(x)^2 - 4*exp(1)*log(x)),x)

[Out]

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