\(\int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} (-162+162 x-81 x^2+33 x^3-9 x^4+x^5)+(-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6) \log (2 x)+(-54 x^3+54 x^4-18 x^5+2 x^6) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx\) [5156]

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

Optimal result

Integrand size = 132, antiderivative size = 25 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=e^{-\frac {6}{x}+x}+\left (\frac {1}{-3+x}-x \log (2 x)\right )^2 \]

[Out]

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

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.64, number of steps used = 12, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.061, Rules used = {6820, 6838, 697, 2404, 2351, 31, 2341, 2342} \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=x^2 \log ^2(2 x)+e^{x-\frac {6}{x}}+\frac {1}{(3-x)^2}+\frac {2 x \log (2 x)}{3-x} \]

[In]

Int[(-20*x^2 + 12*x^3 - 2*x^4 + E^((-6 + x^2)/x)*(-162 + 162*x - 81*x^2 + 33*x^3 - 9*x^4 + x^5) + (-18*x^2 - 4
8*x^3 + 54*x^4 - 18*x^5 + 2*x^6)*Log[2*x] + (-54*x^3 + 54*x^4 - 18*x^5 + 2*x^6)*Log[2*x]^2)/(-27*x^2 + 27*x^3
- 9*x^4 + x^5),x]

[Out]

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

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 697

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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 2351

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_), x_Symbol] :> Simp[x*(d + e*x^r)^(q +
 1)*((a + b*Log[c*x^n])/d), x] - Dist[b*(n/d), Int[(d + e*x^r)^(q + 1), x], x] /; FreeQ[{a, b, c, d, e, n, q,
r}, x] && EqQ[r*(q + 1) + 1, 0]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 6820

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

Rule 6838

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[q*(F^v/Log[F]), x] /;  !FalseQ[q]
] /; FreeQ[F, x]

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

Mathematica [B] (verified)

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

Time = 0.20 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.24 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=e^{-\frac {6}{x}+x}+\frac {1}{(-3+x)^2}+2 \log (3-x)-2 \log (-3+x)-2 \log (x)+\frac {6 \log (2 x)}{3-x}+x^2 \log ^2(2 x) \]

[In]

Integrate[(-20*x^2 + 12*x^3 - 2*x^4 + E^((-6 + x^2)/x)*(-162 + 162*x - 81*x^2 + 33*x^3 - 9*x^4 + x^5) + (-18*x
^2 - 48*x^3 + 54*x^4 - 18*x^5 + 2*x^6)*Log[2*x] + (-54*x^3 + 54*x^4 - 18*x^5 + 2*x^6)*Log[2*x]^2)/(-27*x^2 + 2
7*x^3 - 9*x^4 + x^5),x]

[Out]

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

Maple [B] (verified)

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

Time = 0.57 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.20

method result size
default \({\mathrm e}^{\frac {x^{2}-6}{x}}+x^{2} \ln \left (2 x \right )^{2}-2 \ln \left (-3+x \right )+\frac {1}{\left (-3+x \right )^{2}}+2 \ln \left (2 x -6\right )-\frac {4 \ln \left (2 x \right ) x}{2 x -6}\) \(55\)
parts \({\mathrm e}^{\frac {x^{2}-6}{x}}+x^{2} \ln \left (2 x \right )^{2}-2 \ln \left (-3+x \right )+\frac {1}{\left (-3+x \right )^{2}}+2 \ln \left (2 x -6\right )-\frac {4 \ln \left (2 x \right ) x}{2 x -6}\) \(55\)
risch \(x^{2} \ln \left (2 x \right )^{2}-\frac {6 \ln \left (2 x \right )}{-3+x}-\frac {2 x^{2} \ln \left (x \right )-{\mathrm e}^{\frac {x^{2}-6}{x}} x^{2}-12 x \ln \left (x \right )+6 \,{\mathrm e}^{\frac {x^{2}-6}{x}} x +18 \ln \left (x \right )-9 \,{\mathrm e}^{\frac {x^{2}-6}{x}}-1}{\left (-3+x \right )^{2}}\) \(88\)
parallelrisch \(\frac {6 x^{4} \ln \left (2 x \right )^{2}-36 x^{3} \ln \left (2 x \right )^{2}+6+54 x^{2} \ln \left (2 x \right )^{2}-6 x^{2} \ln \left (x \right )-6 x^{2} \ln \left (2 x \right )+6 \,{\mathrm e}^{\frac {x^{2}-6}{x}} x^{2}+36 x \ln \left (x \right )-36 \,{\mathrm e}^{\frac {x^{2}-6}{x}} x -54 \ln \left (x \right )+54 \ln \left (2 x \right )+54 \,{\mathrm e}^{\frac {x^{2}-6}{x}}}{6 x^{2}-36 x +54}\) \(119\)

[In]

int(((2*x^6-18*x^5+54*x^4-54*x^3)*ln(2*x)^2+(2*x^6-18*x^5+54*x^4-48*x^3-18*x^2)*ln(2*x)+(x^5-9*x^4+33*x^3-81*x
^2+162*x-162)*exp((x^2-6)/x)-2*x^4+12*x^3-20*x^2)/(x^5-9*x^4+27*x^3-27*x^2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.29 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.64 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=\frac {{\left (x^{4} - 6 \, x^{3} + 9 \, x^{2}\right )} \log \left (2 \, x\right )^{2} + {\left (x^{2} - 6 \, x + 9\right )} e^{\left (\frac {x^{2} - 6}{x}\right )} - 2 \, {\left (x^{2} - 3 \, x\right )} \log \left (2 \, x\right ) + 1}{x^{2} - 6 \, x + 9} \]

[In]

integrate(((2*x^6-18*x^5+54*x^4-54*x^3)*log(2*x)^2+(2*x^6-18*x^5+54*x^4-48*x^3-18*x^2)*log(2*x)+(x^5-9*x^4+33*
x^3-81*x^2+162*x-162)*exp((x^2-6)/x)-2*x^4+12*x^3-20*x^2)/(x^5-9*x^4+27*x^3-27*x^2),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.68 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=x^{2} \log {\left (2 x \right )}^{2} + e^{\frac {x^{2} - 6}{x}} - 2 \log {\left (x \right )} + \frac {1}{x^{2} - 6 x + 9} - \frac {6 \log {\left (2 x \right )}}{x - 3} \]

[In]

integrate(((2*x**6-18*x**5+54*x**4-54*x**3)*ln(2*x)**2+(2*x**6-18*x**5+54*x**4-48*x**3-18*x**2)*ln(2*x)+(x**5-
9*x**4+33*x**3-81*x**2+162*x-162)*exp((x**2-6)/x)-2*x**4+12*x**3-20*x**2)/(x**5-9*x**4+27*x**3-27*x**2),x)

[Out]

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

Maxima [B] (verification not implemented)

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

Time = 0.33 (sec) , antiderivative size = 122, normalized size of antiderivative = 4.88 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=\frac {3 \, {\left (4 \, x - 9\right )}}{x^{2} - 6 \, x + 9} - \frac {6 \, {\left (2 \, x - 3\right )}}{x^{2} - 6 \, x + 9} + \frac {x^{3} \log \left (2\right )^{2} - 3 \, x^{2} \log \left (2\right )^{2} + {\left (x^{3} - 3 \, x^{2}\right )} \log \left (x\right )^{2} + {\left (x - 3\right )} e^{\left (x - \frac {6}{x}\right )} + 2 \, {\left (x^{3} \log \left (2\right ) - 3 \, x^{2} \log \left (2\right ) - x\right )} \log \left (x\right ) - 6 \, \log \left (2\right )}{x - 3} + \frac {10}{x^{2} - 6 \, x + 9} \]

[In]

integrate(((2*x^6-18*x^5+54*x^4-54*x^3)*log(2*x)^2+(2*x^6-18*x^5+54*x^4-48*x^3-18*x^2)*log(2*x)+(x^5-9*x^4+33*
x^3-81*x^2+162*x-162)*exp((x^2-6)/x)-2*x^4+12*x^3-20*x^2)/(x^5-9*x^4+27*x^3-27*x^2),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 4.52 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx=\frac {x^{4} \log \left (2 \, x\right )^{2} - 6 \, x^{3} \log \left (2 \, x\right )^{2} + 9 \, x^{2} \log \left (2 \, x\right )^{2} + x^{2} e^{\left (\frac {x^{2} - 6}{x}\right )} - 2 \, x^{2} \log \left (x\right ) - 6 \, x e^{\left (\frac {x^{2} - 6}{x}\right )} - 6 \, x \log \left (2 \, x\right ) + 12 \, x \log \left (x\right ) + 9 \, e^{\left (\frac {x^{2} - 6}{x}\right )} + 18 \, \log \left (2 \, x\right ) - 18 \, \log \left (x\right ) + 1}{x^{2} - 6 \, x + 9} \]

[In]

integrate(((2*x^6-18*x^5+54*x^4-54*x^3)*log(2*x)^2+(2*x^6-18*x^5+54*x^4-48*x^3-18*x^2)*log(2*x)+(x^5-9*x^4+33*
x^3-81*x^2+162*x-162)*exp((x^2-6)/x)-2*x^4+12*x^3-20*x^2)/(x^5-9*x^4+27*x^3-27*x^2),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 11.71 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.76 \[ \int \frac {-20 x^2+12 x^3-2 x^4+e^{\frac {-6+x^2}{x}} \left (-162+162 x-81 x^2+33 x^3-9 x^4+x^5\right )+\left (-18 x^2-48 x^3+54 x^4-18 x^5+2 x^6\right ) \log (2 x)+\left (-54 x^3+54 x^4-18 x^5+2 x^6\right ) \log ^2(2 x)}{-27 x^2+27 x^3-9 x^4+x^5} \, dx={\mathrm {e}}^{x-\frac {6}{x}}-2\,\ln \left (x\right )+\frac {1}{x^2-6\,x+9}-\frac {6\,\ln \left (2\,x\right )}{x-3}+x^2\,{\ln \left (2\,x\right )}^2 \]

[In]

int((log(2*x)*(18*x^2 + 48*x^3 - 54*x^4 + 18*x^5 - 2*x^6) + log(2*x)^2*(54*x^3 - 54*x^4 + 18*x^5 - 2*x^6) + 20
*x^2 - 12*x^3 + 2*x^4 - exp((x^2 - 6)/x)*(162*x - 81*x^2 + 33*x^3 - 9*x^4 + x^5 - 162))/(27*x^2 - 27*x^3 + 9*x
^4 - x^5),x)

[Out]

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