3.8.83 \(\int \frac {-4 x+8 x^2-5 x^3+x^4+(-4 x^2+4 x^3-x^4) \log (x)+(-2 x+3 x^2) \log ^2(x)+(2-2 x) \log (\frac {e^x}{3}) \log ^2(x)}{(4 x^2-4 x^3+x^4) \log ^2(x)} \, dx\) [783]

Optimal. Leaf size=33 \[ \frac {-x^2+\log \left (\frac {e^x}{3}\right )}{(-2+x) x}-\frac {-1+x}{\log (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.45, antiderivative size = 41, normalized size of antiderivative = 1.24, number of steps used = 19, number of rules used = 15, integrand size = 89, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.168, Rules used = {1608, 27, 6820, 6874, 78, 75, 2634, 36, 31, 29, 2395, 2334, 2335, 2339, 30} \begin {gather*} \frac {2}{2-x}-\frac {x}{\log (x)}+\frac {1}{\log (x)}-\frac {\log \left (\frac {e^x}{3}\right )}{(2-x) x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 31

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

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 75

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2, 0] &
& EqQ[a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)), 0]

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 1608

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_), x_Symbol] :> Simp[x*((a + b*Log[c*x^n])^(p + 1)/(b*n*(p + 1)))
, x] - Dist[1/(b*n*(p + 1)), Int[(a + b*Log[c*x^n])^(p + 1), x], x] /; FreeQ[{a, b, c, n}, x] && LtQ[p, -1] &&
 IntegerQ[2*p]

Rule 2335

Int[Log[(c_.)*(x_)]^(-1), x_Symbol] :> Simp[LogIntegral[c*x]/c, x] /; FreeQ[c, x]

Rule 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 2395

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

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 6820

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

Rule 6874

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-4 x+8 x^2-5 x^3+x^4+\left (-4 x^2+4 x^3-x^4\right ) \log (x)+\left (-2 x+3 x^2\right ) \log ^2(x)+(2-2 x) \log \left (\frac {e^x}{3}\right ) \log ^2(x)}{x^2 \left (4-4 x+x^2\right ) \log ^2(x)} \, dx\\ &=\int \frac {-4 x+8 x^2-5 x^3+x^4+\left (-4 x^2+4 x^3-x^4\right ) \log (x)+\left (-2 x+3 x^2\right ) \log ^2(x)+(2-2 x) \log \left (\frac {e^x}{3}\right ) \log ^2(x)}{(-2+x)^2 x^2 \log ^2(x)} \, dx\\ &=\int \left (\frac {x (-2+3 x)-2 (-1+x) \log \left (\frac {e^x}{3}\right )}{(-2+x)^2 x^2}+\frac {-1+x}{x \log ^2(x)}-\frac {1}{\log (x)}\right ) \, dx\\ &=\int \frac {x (-2+3 x)-2 (-1+x) \log \left (\frac {e^x}{3}\right )}{(-2+x)^2 x^2} \, dx+\int \frac {-1+x}{x \log ^2(x)} \, dx-\int \frac {1}{\log (x)} \, dx\\ &=-\text {li}(x)+\int \left (\frac {-2+3 x}{(-2+x)^2 x}-\frac {2 (-1+x) \log \left (\frac {e^x}{3}\right )}{(-2+x)^2 x^2}\right ) \, dx+\int \left (\frac {1}{\log ^2(x)}-\frac {1}{x \log ^2(x)}\right ) \, dx\\ &=-\text {li}(x)-2 \int \frac {(-1+x) \log \left (\frac {e^x}{3}\right )}{(-2+x)^2 x^2} \, dx+\int \frac {-2+3 x}{(-2+x)^2 x} \, dx+\int \frac {1}{\log ^2(x)} \, dx-\int \frac {1}{x \log ^2(x)} \, dx\\ &=-\frac {\log \left (\frac {e^x}{3}\right )}{(2-x) x}-\frac {x}{\log (x)}-\text {li}(x)+2 \int \frac {1}{(4-2 x) x} \, dx+\int \left (\frac {2}{(-2+x)^2}+\frac {1}{2 (-2+x)}-\frac {1}{2 x}\right ) \, dx+\int \frac {1}{\log (x)} \, dx-\text {Subst}\left (\int \frac {1}{x^2} \, dx,x,\log (x)\right )\\ &=\frac {2}{2-x}-\frac {\log \left (\frac {e^x}{3}\right )}{(2-x) x}+\frac {1}{2} \log (2-x)+\frac {1}{\log (x)}-\frac {x}{\log (x)}-\frac {\log (x)}{2}+\frac {1}{2} \int \frac {1}{x} \, dx+\int \frac {1}{4-2 x} \, dx\\ &=\frac {2}{2-x}-\frac {\log \left (\frac {e^x}{3}\right )}{(2-x) x}+\frac {1}{\log (x)}-\frac {x}{\log (x)}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 40, normalized size = 1.21 \begin {gather*} \frac {-x \left (2-3 x+x^2\right )+\left (-2 x+\log \left (\frac {e^x}{3}\right )\right ) \log (x)}{(-2+x) x \log (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-4*x + 8*x^2 - 5*x^3 + x^4 + (-4*x^2 + 4*x^3 - x^4)*Log[x] + (-2*x + 3*x^2)*Log[x]^2 + (2 - 2*x)*Lo
g[E^x/3]*Log[x]^2)/((4*x^2 - 4*x^3 + x^4)*Log[x]^2),x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 42, normalized size = 1.27

method result size
default \(-\frac {2}{x -2}+\frac {1}{\ln \left (x \right )}-\frac {x}{\ln \left (x \right )}+\frac {\ln \left (\frac {{\mathrm e}^{x}}{3}\right )}{2 x -4}-\frac {\ln \left (\frac {{\mathrm e}^{x}}{3}\right )}{2 x}\) \(42\)
risch \(\frac {\ln \left ({\mathrm e}^{x}\right )}{\left (x -2\right ) x}-\frac {2 x^{3}+2 \ln \left (3\right ) \ln \left (x \right )-6 x^{2}+4 x \ln \left (x \right )+4 x}{2 \ln \left (x \right ) \left (x -2\right ) x}\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.51, size = 34, normalized size = 1.03 \begin {gather*} -\frac {x^{3} - 3 \, x^{2} + {\left (x + \log \left (3\right )\right )} \log \left (x\right ) + 2 \, x}{{\left (x^{2} - 2 \, x\right )} \log \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 34, normalized size = 1.03 \begin {gather*} -\frac {x^{3} - 3 \, x^{2} + {\left (x + \log \left (3\right )\right )} \log \left (x\right ) + 2 \, x}{{\left (x^{2} - 2 \, x\right )} \log \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.17, size = 19, normalized size = 0.58 \begin {gather*} \frac {1 - x}{\log {\left (x \right )}} + \frac {- x - \log {\left (3 \right )}}{x^{2} - 2 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((2-2*x)*ln(x)**2*ln(1/3*exp(x))+(3*x**2-2*x)*ln(x)**2+(-x**4+4*x**3-4*x**2)*ln(x)+x**4-5*x**3+8*x**
2-4*x)/(x**4-4*x**3+4*x**2)/ln(x)**2,x)

[Out]

(1 - x)/log(x) + (-x - log(3))/(x**2 - 2*x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 28, normalized size = 0.85 \begin {gather*} -\frac {\log \left (3\right ) + 2}{2 \, {\left (x - 2\right )}} + \frac {\log \left (3\right )}{2 \, x} - \frac {x - 1}{\log \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(log(3) + 2)/(x - 2) + 1/2*log(3)/x - (x - 1)/log(x)

________________________________________________________________________________________

Mupad [B]
time = 0.71, size = 34, normalized size = 1.03 \begin {gather*} \frac {x+\ln \left (3\right )}{2\,x-x^2}-x+\frac {x\,\ln \left (x\right )-x+1}{\ln \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________