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

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

Optimal result

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

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(60\) vs. \(2(25)=50\).

Time = 0.20 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.40, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {12, 6820, 14, 2393, 2338, 2341, 2342} \[ \int \frac {e^4 \left (-3+2 x+x^2+4 \log (x)-\log ^2(x)\right ) \left (-12-6 x-4 x^2-6 x^3-4 x^4+\left (6-6 x^2\right ) \log (x)+2 x^2 \log ^2(x)\right )}{3 x-2 x^2-x^3-4 x \log (x)+x \log ^2(x)} \, dx=e^4 x^4+2 e^4 x^3-e^4 x^2 \log ^2(x)+4 e^4 x^2 \log (x)+6 e^4 x-3 e^4 \log ^2(x)+12 e^4 \log (x) \]

[In]

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

[Out]

6*E^4*x + 2*E^4*x^3 + E^4*x^4 + 12*E^4*Log[x] + 4*E^4*x^2*Log[x] - 3*E^4*Log[x]^2 - E^4*x^2*Log[x]^2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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 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 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 2393

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

Rule 6820

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(60\) vs. \(2(25)=50\).

Time = 0.01 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.40 \[ \int \frac {e^4 \left (-3+2 x+x^2+4 \log (x)-\log ^2(x)\right ) \left (-12-6 x-4 x^2-6 x^3-4 x^4+\left (6-6 x^2\right ) \log (x)+2 x^2 \log ^2(x)\right )}{3 x-2 x^2-x^3-4 x \log (x)+x \log ^2(x)} \, dx=6 e^4 x+2 e^4 x^3+e^4 x^4+12 e^4 \log (x)+4 e^4 x^2 \log (x)-3 e^4 \log ^2(x)-e^4 x^2 \log ^2(x) \]

[In]

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

[Out]

6*E^4*x + 2*E^4*x^3 + E^4*x^4 + 12*E^4*Log[x] + 4*E^4*x^2*Log[x] - 3*E^4*Log[x]^2 - E^4*x^2*Log[x]^2

Maple [A] (verified)

Time = 5.92 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.68

method result size
default \({\mathrm e}^{4} \left (-x^{2} \ln \left (x \right )^{2}+4 x^{2} \ln \left (x \right )+x^{4}+2 x^{3}-3 \ln \left (x \right )^{2}+6 x +12 \ln \left (x \right )\right )\) \(42\)
risch \({\mathrm e}^{4} \left (-x^{2}-3\right ) \ln \left (x \right )^{2}+4 x^{2} {\mathrm e}^{4} \ln \left (x \right )+x^{4} {\mathrm e}^{4}+2 x^{3} {\mathrm e}^{4}+6 x \,{\mathrm e}^{4}+12 \,{\mathrm e}^{4} \ln \left (x \right )\) \(49\)
parallelrisch \(\frac {-342 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4}+384 \ln \left (x \right ) {\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4}+192 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x +138 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x^{2}+2 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x^{4}+8 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x^{5}+2 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x^{6}-48 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{3}+6 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{4}+2 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{4} x^{2}-24 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{2} x +32 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{2} x^{2}-8 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{2} x^{3}-4 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right )^{2} x^{4}-16 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} x^{2} \ln \left (x \right )^{3}+32 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right ) x^{3}+16 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right ) x^{4}+96 \,{\mathrm e}^{\ln \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )+4} \ln \left (x \right ) x}{2 \left (-\ln \left (x \right )^{2}+4 \ln \left (x \right )+x^{2}+2 x -3\right )^{2}}\) \(532\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.18 (sec) , antiderivative size = 60, normalized size of antiderivative = 2.40 \[ \int \frac {e^4 \left (-3+2 x+x^2+4 \log (x)-\log ^2(x)\right ) \left (-12-6 x-4 x^2-6 x^3-4 x^4+\left (6-6 x^2\right ) \log (x)+2 x^2 \log ^2(x)\right )}{3 x-2 x^2-x^3-4 x \log (x)+x \log ^2(x)} \, dx=x^{4} e^{4} + 2 x^{3} e^{4} + 4 x^{2} e^{4} \log {\left (x \right )} + 6 x e^{4} + \left (- x^{2} e^{4} - 3 e^{4}\right ) \log {\left (x \right )}^{2} + 12 e^{4} \log {\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.12 \[ \int \frac {e^4 \left (-3+2 x+x^2+4 \log (x)-\log ^2(x)\right ) \left (-12-6 x-4 x^2-6 x^3-4 x^4+\left (6-6 x^2\right ) \log (x)+2 x^2 \log ^2(x)\right )}{3 x-2 x^2-x^3-4 x \log (x)+x \log ^2(x)} \, dx=x^{4} e^{4} - x^{2} e^{4} \log \left (x\right )^{2} + 2 \, x^{3} e^{4} + 4 \, x^{2} e^{4} \log \left (x\right ) - 3 \, e^{4} \log \left (x\right )^{2} + 6 \, x e^{4} + 12 \, e^{4} \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 15.35 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.64 \[ \int \frac {e^4 \left (-3+2 x+x^2+4 \log (x)-\log ^2(x)\right ) \left (-12-6 x-4 x^2-6 x^3-4 x^4+\left (6-6 x^2\right ) \log (x)+2 x^2 \log ^2(x)\right )}{3 x-2 x^2-x^3-4 x \log (x)+x \log ^2(x)} \, dx={\mathrm {e}}^4\,\left (x^4+2\,x^3-x^2\,{\ln \left (x\right )}^2+4\,x^2\,\ln \left (x\right )+6\,x-3\,{\ln \left (x\right )}^2+12\,\ln \left (x\right )\right ) \]

[In]

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

[Out]

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