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\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.69, 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 = {1594, 27, 6688, 6742, 77, 74, 2554, 36, 31, 29, 2353, 2297, 2298, 2302, 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 74

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 77

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 1594

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 2297

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 2298

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

Rule 2302

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 2353

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 2554

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 6688

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

Rule 6742

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-\operatorname {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.10, size = 56, normalized size = 1.70 \begin {gather*} \frac {4+\log (3)}{2 (2-x)}-\frac {\log \left (\frac {e^x}{3}\right )}{2 x}-\frac {\log \left (e^x\right )}{2 (2-x)}+\frac {1-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]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x+2)*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))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x+2)*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)

________________________________________________________________________________________

maple [A]  time = 0.10, size = 42, normalized size = 1.27




method result size



default \(-\frac {2}{x -2}-\frac {x}{\ln \relax (x )}+\frac {1}{\ln \relax (x )}+\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 \relax (3) \ln \relax (x )-6 x^{2}+4 x \ln \relax (x )+4 x}{2 \ln \relax (x ) \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)-x/ln(x)+1/ln(x)+1/2*ln(1/3*exp(x))/(x-2)-1/2*ln(1/3*exp(x))/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-2*x+2)*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))

________________________________________________________________________________________

mupad [B]  time = 0.71, size = 34, normalized size = 1.03 \begin {gather*} \frac {x+\ln \relax (3)}{2\,x-x^2}-x+\frac {x\,\ln \relax (x)-x+1}{\ln \relax (x)} \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)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-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)

[Out]

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

________________________________________________________________________________________