\(\int \frac {-512+500 x-78 x^2-4 x^3+e^2 (4 x^3-x^4) \log (4)+(32-32 x+6 x^2) \log (4-x)}{e^2 (-16 x^3+20 x^4-8 x^5+x^6)} \, dx\) [7748]

   Optimal result
   Rubi [B] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 74, antiderivative size = 28 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=\frac {\log (4)+\frac {2 (16+x-\log (4-x))}{e^2 x^2}}{-2+x} \]

[Out]

(2/x^2/exp(2)*(16-ln(-x+4)+x)+2*ln(2))/(-2+x)

Rubi [B] (verified)

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

Time = 0.53 (sec) , antiderivative size = 89, normalized size of antiderivative = 3.18, number of steps used = 25, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {12, 6873, 6874, 46, 90, 84, 2465, 2442, 36, 31, 29} \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=-\frac {16}{e^2 x^2}+\frac {\log (4-x)}{e^2 x^2}-\frac {9}{e^2 (2-x)}-\frac {9}{e^2 x}+\frac {\log (4-x)}{2 e^2 (2-x)}+\frac {\log (4-x)}{2 e^2 x}-\frac {\log (4)}{2-x} \]

[In]

Int[(-512 + 500*x - 78*x^2 - 4*x^3 + E^2*(4*x^3 - x^4)*Log[4] + (32 - 32*x + 6*x^2)*Log[4 - x])/(E^2*(-16*x^3
+ 20*x^4 - 8*x^5 + x^6)),x]

[Out]

-9/(E^2*(2 - x)) - 16/(E^2*x^2) - 9/(E^2*x) - Log[4]/(2 - x) + Log[4 - x]/(2*E^2*(2 - x)) + Log[4 - x]/(E^2*x^
2) + Log[4 - x]/(2*E^2*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 29

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

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 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 84

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 2442

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

Rule 2465

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

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}& = \frac {\int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{-16 x^3+20 x^4-8 x^5+x^6} \, dx}{e^2} \\ & = \frac {\int \frac {512-500 x+78 x^2+4 x^3-e^2 \left (4 x^3-x^4\right ) \log (4)-\left (32-32 x+6 x^2\right ) \log (4-x)}{(2-x)^2 (4-x) x^3} \, dx}{e^2} \\ & = \frac {\int \left (-\frac {4}{(-4+x) (-2+x)^2}-\frac {512}{(-4+x) (-2+x)^2 x^3}+\frac {500}{(-4+x) (-2+x)^2 x^2}-\frac {78}{(-4+x) (-2+x)^2 x}-\frac {e^2 \log (4)}{(-2+x)^2}+\frac {2 (-4+3 x) \log (4-x)}{(-2+x)^2 x^3}\right ) \, dx}{e^2} \\ & = -\frac {\log (4)}{2-x}+\frac {2 \int \frac {(-4+3 x) \log (4-x)}{(-2+x)^2 x^3} \, dx}{e^2}-\frac {4 \int \frac {1}{(-4+x) (-2+x)^2} \, dx}{e^2}-\frac {78 \int \frac {1}{(-4+x) (-2+x)^2 x} \, dx}{e^2}+\frac {500 \int \frac {1}{(-4+x) (-2+x)^2 x^2} \, dx}{e^2}-\frac {512 \int \frac {1}{(-4+x) (-2+x)^2 x^3} \, dx}{e^2} \\ & = -\frac {\log (4)}{2-x}+\frac {2 \int \left (\frac {\log (4-x)}{4 (-2+x)^2}-\frac {\log (4-x)}{x^3}-\frac {\log (4-x)}{4 x^2}\right ) \, dx}{e^2}-\frac {4 \int \left (\frac {1}{4 (-4+x)}-\frac {1}{2 (-2+x)^2}-\frac {1}{4 (-2+x)}\right ) \, dx}{e^2}-\frac {78 \int \left (\frac {1}{16 (-4+x)}-\frac {1}{4 (-2+x)^2}-\frac {1}{16 x}\right ) \, dx}{e^2}+\frac {500 \int \left (\frac {1}{64 (-4+x)}-\frac {1}{8 (-2+x)^2}+\frac {1}{16 (-2+x)}-\frac {1}{16 x^2}-\frac {5}{64 x}\right ) \, dx}{e^2}-\frac {512 \int \left (\frac {1}{256 (-4+x)}-\frac {1}{16 (-2+x)^2}+\frac {1}{16 (-2+x)}-\frac {1}{16 x^3}-\frac {5}{64 x^2}-\frac {17}{256 x}\right ) \, dx}{e^2} \\ & = -\frac {9}{e^2 (2-x)}-\frac {16}{e^2 x^2}-\frac {35}{4 e^2 x}-\frac {\log (4)}{2-x}+\frac {\log (2-x)}{4 e^2}-\frac {\log (4-x)}{16 e^2}-\frac {3 \log (x)}{16 e^2}+\frac {\int \frac {\log (4-x)}{(-2+x)^2} \, dx}{2 e^2}-\frac {\int \frac {\log (4-x)}{x^2} \, dx}{2 e^2}-\frac {2 \int \frac {\log (4-x)}{x^3} \, dx}{e^2} \\ & = -\frac {9}{e^2 (2-x)}-\frac {16}{e^2 x^2}-\frac {35}{4 e^2 x}-\frac {\log (4)}{2-x}+\frac {\log (2-x)}{4 e^2}-\frac {\log (4-x)}{16 e^2}+\frac {\log (4-x)}{2 e^2 (2-x)}+\frac {\log (4-x)}{e^2 x^2}+\frac {\log (4-x)}{2 e^2 x}-\frac {3 \log (x)}{16 e^2}-\frac {\int \frac {1}{(4-x) (-2+x)} \, dx}{2 e^2}+\frac {\int \frac {1}{(4-x) x} \, dx}{2 e^2}+\frac {\int \frac {1}{(4-x) x^2} \, dx}{e^2} \\ & = -\frac {9}{e^2 (2-x)}-\frac {16}{e^2 x^2}-\frac {35}{4 e^2 x}-\frac {\log (4)}{2-x}+\frac {\log (2-x)}{4 e^2}-\frac {\log (4-x)}{16 e^2}+\frac {\log (4-x)}{2 e^2 (2-x)}+\frac {\log (4-x)}{e^2 x^2}+\frac {\log (4-x)}{2 e^2 x}-\frac {3 \log (x)}{16 e^2}+\frac {\int \frac {1}{4-x} \, dx}{8 e^2}+\frac {\int \frac {1}{x} \, dx}{8 e^2}-\frac {\int \frac {1}{4-x} \, dx}{4 e^2}-\frac {\int \frac {1}{-2+x} \, dx}{4 e^2}+\frac {\int \left (-\frac {1}{16 (-4+x)}+\frac {1}{4 x^2}+\frac {1}{16 x}\right ) \, dx}{e^2} \\ & = -\frac {9}{e^2 (2-x)}-\frac {16}{e^2 x^2}-\frac {9}{e^2 x}-\frac {\log (4)}{2-x}+\frac {\log (4-x)}{2 e^2 (2-x)}+\frac {\log (4-x)}{e^2 x^2}+\frac {\log (4-x)}{2 e^2 x} \\ \end{align*}

Mathematica [B] (verified)

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

Time = 0.17 (sec) , antiderivative size = 87, normalized size of antiderivative = 3.11 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=\frac {128+8 x+2 (-2+x) x^2 \text {arctanh}(3-x)+4 e^2 x^2 \log (4)+(-2+x) x^2 \log (2-x)-8 \log (4-x)+2 x^2 \log (4-x)-x^3 \log (4-x)}{4 e^2 (-2+x) x^2} \]

[In]

Integrate[(-512 + 500*x - 78*x^2 - 4*x^3 + E^2*(4*x^3 - x^4)*Log[4] + (32 - 32*x + 6*x^2)*Log[4 - x])/(E^2*(-1
6*x^3 + 20*x^4 - 8*x^5 + x^6)),x]

[Out]

(128 + 8*x + 2*(-2 + x)*x^2*ArcTanh[3 - x] + 4*E^2*x^2*Log[4] + (-2 + x)*x^2*Log[2 - x] - 8*Log[4 - x] + 2*x^2
*Log[4 - x] - x^3*Log[4 - x])/(4*E^2*(-2 + x)*x^2)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.29

method result size
parallelrisch \(\frac {{\mathrm e}^{-2} \left (32+2 x^{2} {\mathrm e}^{2} \ln \left (2\right )+2 x -2 \ln \left (-x +4\right )\right )}{x^{2} \left (-2+x \right )}\) \(36\)
norman \(\frac {2 x^{2} \ln \left (2\right )+32 \,{\mathrm e}^{-2}+2 x \,{\mathrm e}^{-2}-2 \,{\mathrm e}^{-2} \ln \left (-x +4\right )}{\left (-2+x \right ) x^{2}}\) \(43\)
risch \(-\frac {2 \,{\mathrm e}^{-2} \ln \left (-x +4\right )}{x^{2} \left (-2+x \right )}+\frac {2 \,{\mathrm e}^{-2} \left (x^{2} {\mathrm e}^{2} \ln \left (2\right )+x +16\right )}{\left (-2+x \right ) x^{2}}\) \(43\)
default \({\mathrm e}^{-2} \left (-\frac {2 \,{\mathrm e}^{2} \ln \left (2\right )}{2-x}+\frac {\left (-x +4\right ) \ln \left (-x +4\right )}{-4 x +8}-\frac {9}{x}-\frac {\ln \left (-x +4\right ) \left (-x +4\right ) \left (-4-x \right )}{16 x^{2}}+\frac {\ln \left (-x +4\right ) \left (-x +4\right )}{8 x}-\frac {9}{2-x}-\frac {16}{x^{2}}-\frac {\ln \left (-x +4\right )}{16}\right )\) \(104\)
derivativedivides \(-{\mathrm e}^{-2} \left (\frac {2 \,{\mathrm e}^{2} \ln \left (2\right )}{2-x}-\frac {\ln \left (-x +4\right ) \left (-x +4\right )}{4 \left (2-x \right )}+\frac {9}{x}+\frac {\ln \left (-x +4\right ) \left (-x +4\right ) \left (-4-x \right )}{16 x^{2}}-\frac {\ln \left (-x +4\right ) \left (-x +4\right )}{8 x}+\frac {9}{2-x}+\frac {16}{x^{2}}+\frac {\ln \left (-x +4\right )}{16}\right )\) \(105\)
parts \(-2 \,{\mathrm e}^{-2} \left (\frac {8}{x^{2}}+\frac {35}{8 x}+\frac {3 \ln \left (x \right )}{32}-\frac {\ln \left (-2+x \right )}{8}-\frac {{\mathrm e}^{2} \ln \left (2\right )+\frac {9}{2}}{-2+x}+\frac {\ln \left (x -4\right )}{32}\right )+2 \,{\mathrm e}^{-2} \left (\frac {3 \ln \left (-x \right )}{32}+\frac {\ln \left (-x +4\right ) \left (-x +4\right )}{16 x}-\frac {\ln \left (2-x \right )}{8}+\frac {\left (-x +4\right ) \ln \left (-x +4\right )}{-8 x +16}-\frac {1}{8 x}-\frac {\ln \left (-x +4\right ) \left (-x +4\right ) \left (-4-x \right )}{32 x^{2}}\right )\) \(132\)

[In]

int(((6*x^2-32*x+32)*ln(-x+4)+2*(-x^4+4*x^3)*exp(2)*ln(2)-4*x^3-78*x^2+500*x-512)/(x^6-8*x^5+20*x^4-16*x^3)/ex
p(2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.21 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=\frac {2 \, {\left (x^{2} e^{2} \log \left (2\right ) + x - \log \left (-x + 4\right ) + 16\right )} e^{\left (-2\right )}}{x^{3} - 2 \, x^{2}} \]

[In]

integrate(((6*x^2-32*x+32)*log(-x+4)+2*(-x^4+4*x^3)*exp(2)*log(2)-4*x^3-78*x^2+500*x-512)/(x^6-8*x^5+20*x^4-16
*x^3)/exp(2),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (26) = 52\).

Time = 0.47 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.00 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=- \frac {- 2 x^{2} e^{2} \log {\left (2 \right )} - 2 x - 32}{x^{3} e^{2} - 2 x^{2} e^{2}} - \frac {2 \log {\left (4 - x \right )}}{x^{3} e^{2} - 2 x^{2} e^{2}} \]

[In]

integrate(((6*x**2-32*x+32)*ln(-x+4)+2*(-x**4+4*x**3)*exp(2)*ln(2)-4*x**3-78*x**2+500*x-512)/(x**6-8*x**5+20*x
**4-16*x**3)/exp(2),x)

[Out]

-(-2*x**2*exp(2)*log(2) - 2*x - 32)/(x**3*exp(2) - 2*x**2*exp(2)) - 2*log(4 - x)/(x**3*exp(2) - 2*x**2*exp(2))

Maxima [B] (verification not implemented)

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

Time = 0.33 (sec) , antiderivative size = 78, normalized size of antiderivative = 2.79 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=2 \, {\left (\frac {{\left (e^{2} \log \left (2\right ) + 36\right )} x^{2} + {\left (x^{3} - 2 \, x^{2} - 1\right )} \log \left (-x + 4\right ) - 31 \, x}{x^{3} - 2 \, x^{2}} - \frac {4 \, {\left (9 \, x^{2} - 8 \, x - 4\right )}}{x^{3} - 2 \, x^{2}} - \log \left (x - 4\right )\right )} e^{\left (-2\right )} \]

[In]

integrate(((6*x^2-32*x+32)*log(-x+4)+2*(-x^4+4*x^3)*exp(2)*log(2)-4*x^3-78*x^2+500*x-512)/(x^6-8*x^5+20*x^4-16
*x^3)/exp(2),x, algorithm="maxima")

[Out]

2*(((e^2*log(2) + 36)*x^2 + (x^3 - 2*x^2 - 1)*log(-x + 4) - 31*x)/(x^3 - 2*x^2) - 4*(9*x^2 - 8*x - 4)/(x^3 - 2
*x^2) - log(x - 4))*e^(-2)

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 59, normalized size of antiderivative = 2.11 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=\frac {2 \, {\left ({\left (x - 4\right )}^{2} e^{2} \log \left (2\right ) + 8 \, {\left (x - 4\right )} e^{2} \log \left (2\right ) + 16 \, e^{2} \log \left (2\right ) + x - \log \left (-x + 4\right ) + 16\right )} e^{\left (-2\right )}}{{\left (x - 4\right )}^{3} + 10 \, {\left (x - 4\right )}^{2} + 32 \, x - 96} \]

[In]

integrate(((6*x^2-32*x+32)*log(-x+4)+2*(-x^4+4*x^3)*exp(2)*log(2)-4*x^3-78*x^2+500*x-512)/(x^6-8*x^5+20*x^4-16
*x^3)/exp(2),x, algorithm="giac")

[Out]

2*((x - 4)^2*e^2*log(2) + 8*(x - 4)*e^2*log(2) + 16*e^2*log(2) + x - log(-x + 4) + 16)*e^(-2)/((x - 4)^3 + 10*
(x - 4)^2 + 32*x - 96)

Mupad [B] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.75 \[ \int \frac {-512+500 x-78 x^2-4 x^3+e^2 \left (4 x^3-x^4\right ) \log (4)+\left (32-32 x+6 x^2\right ) \log (4-x)}{e^2 \left (-16 x^3+20 x^4-8 x^5+x^6\right )} \, dx=-\frac {\frac {{\mathrm {e}}^{-2}\,\left (4\,\ln \left (4-x\right )-64\right )}{2}-2\,x\,{\mathrm {e}}^{-2}+x^2\,\left ({\mathrm {e}}^{-2}-{\mathrm {e}}^{-2}\,\left (2\,{\mathrm {e}}^2\,\ln \left (2\right )+1\right )\right )}{x^2\,\left (x-2\right )} \]

[In]

int(-(exp(-2)*(500*x + log(4 - x)*(6*x^2 - 32*x + 32) - 78*x^2 - 4*x^3 + 2*exp(2)*log(2)*(4*x^3 - x^4) - 512))
/(16*x^3 - 20*x^4 + 8*x^5 - x^6),x)

[Out]

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