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

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

Optimal result

Integrand size = 104, antiderivative size = 30 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=e^3-\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (4 (4+x))}{x} \]

[Out]

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

Rubi [A] (verified)

Time = 2.21 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87, number of steps used = 17, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.106, Rules used = {6820, 6874, 14, 36, 29, 31, 2442, 2631, 30, 2637, 2634} \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=-\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (4 x+16)}{x} \]

[In]

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

[Out]

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

Int[Log[u_]*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[(a + b*x)^(m + 1)*(Log[u]/(b*(m + 1))), x] - Dist[1/
(b*(m + 1)), Int[SimplifyIntegrand[(a + b*x)^(m + 1)*(D[u, x]/u), x], x], x] /; FreeQ[{a, b, m}, x] && Inverse
FunctionFreeQ[u, x] && NeQ[m, -1]

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 2637

Int[Log[v_]*Log[w_]*(u_), x_Symbol] :> With[{z = IntHide[u, x]}, Dist[Log[v]*Log[w], z, x] + (-Int[SimplifyInt
egrand[z*Log[w]*(D[v, x]/v), x], x] - Int[SimplifyIntegrand[z*Log[v]*(D[w, x]/w), x], x]) /; InverseFunctionFr
eeQ[z, x]] /; InverseFunctionFreeQ[v, x] && InverseFunctionFreeQ[w, 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{align*} \text {integral}& = \int \frac {\left (4+5 x+x^2\right ) \log (4 (4+x))-\left (-1+2 e^x x\right ) \log \left (5-\frac {5 e^{-x}}{2 x}\right ) (-x+(4+x) \log (4 (4+x)))}{x^2 (4+x) \left (1-2 e^x x\right )} \, dx \\ & = \int \left (\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) (-x+4 \log (4 (4+x))+x \log (4 (4+x)))}{x^2 (4+x)}+\frac {(1+x) \log (16+4 x)}{x^2 \left (1-2 e^x x\right )}\right ) \, dx \\ & = \int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) (-x+4 \log (4 (4+x))+x \log (4 (4+x)))}{x^2 (4+x)} \, dx+\int \frac {(1+x) \log (16+4 x)}{x^2 \left (1-2 e^x x\right )} \, dx \\ & = -\left (\log (16+4 x) \int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx\right )-\log (16+4 x) \int \frac {1}{x \left (-1+2 e^x x\right )} \, dx+\int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) (-x+(4+x) \log (4 (4+x)))}{x^2 (4+x)} \, dx-\int \frac {-\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx-\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx \\ & = -\left (\log (16+4 x) \int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx\right )-\log (16+4 x) \int \frac {1}{x \left (-1+2 e^x x\right )} \, dx+\int \left (-\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{x (4+x)}+\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x^2}\right ) \, dx-\int \left (-\frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x}-\frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x}\right ) \, dx \\ & = -\left (\log (16+4 x) \int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx\right )-\log (16+4 x) \int \frac {1}{x \left (-1+2 e^x x\right )} \, dx-\int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{x (4+x)} \, dx+\int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x^2} \, dx+\int \frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx \\ & = -\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x}-\log (16+4 x) \int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx-\log (16+4 x) \int \frac {1}{x \left (-1+2 e^x x\right )} \, dx-\int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{(-4-x) x} \, dx-\int \left (\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{4 x}-\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{4 (4+x)}\right ) \, dx-\int \frac {(1+x) \log (16+4 x)}{x^2 \left (1-2 e^x x\right )} \, dx+\int \frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx \\ & = -\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x}-\frac {1}{4} \int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{x} \, dx+\frac {1}{4} \int \frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{4+x} \, dx-\int \left (-\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{4 x}+\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right )}{4 (4+x)}\right ) \, dx+\int \frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \frac {-\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx-\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx \\ & = -\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x}+\int \frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x} \, dx+\int \left (-\frac {\int \frac {1}{x^2 \left (-1+2 e^x x\right )} \, dx}{4+x}-\frac {\int \frac {1}{x \left (-1+2 e^x x\right )} \, dx}{4+x}\right ) \, dx \\ & = -\frac {\log \left (5-\frac {5 e^{-x}}{2 x}\right ) \log (16+4 x)}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.10 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=\log (4+x)-\frac {\left (x+\log \left (5-\frac {5 e^{-x}}{2 x}\right )\right ) \log (4 (4+x))}{x} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 7.08 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97

method result size
parallelrisch \(-\frac {\ln \left (4 x +16\right ) \ln \left (\frac {5 \left (2 \,{\mathrm e}^{x} x -1\right ) {\mathrm e}^{-x}}{2 x}\right )}{x}\) \(29\)
risch \(\frac {\ln \left (4 x +16\right ) \ln \left ({\mathrm e}^{x}\right )}{x}+\frac {\ln \left (4 x +16\right ) \left (i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{-x}\right ) \operatorname {csgn}\left (i \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right )-i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{-x}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right )^{2}+i \pi \,\operatorname {csgn}\left (\frac {i}{x}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right ) \operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{x} x -\frac {1}{2}\right ) {\mathrm e}^{-x}}{x}\right )-i \pi \,\operatorname {csgn}\left (\frac {i}{x}\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{x} x -\frac {1}{2}\right ) {\mathrm e}^{-x}}{x}\right )}^{2}-i \pi \,\operatorname {csgn}\left (i \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right )^{2}+i \pi \operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right )^{3}-i \pi \,\operatorname {csgn}\left (i {\mathrm e}^{-x} \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right ) {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{x} x -\frac {1}{2}\right ) {\mathrm e}^{-x}}{x}\right )}^{2}+i \pi {\operatorname {csgn}\left (\frac {i \left ({\mathrm e}^{x} x -\frac {1}{2}\right ) {\mathrm e}^{-x}}{x}\right )}^{3}-2 \ln \left (5\right )+2 \ln \left (x \right )-2 \ln \left ({\mathrm e}^{x} x -\frac {1}{2}\right )\right )}{2 x}\) \(290\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=-\frac {\log \left (4 \, x + 16\right ) \log \left (\frac {5 \, {\left (2 \, x e^{x} - 1\right )} e^{\left (-x\right )}}{2 \, x}\right )}{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=- \frac {\log {\left (\frac {\left (5 x e^{x} - \frac {5}{2}\right ) e^{- x}}{x} \right )} \log {\left (4 x + 16 \right )}}{x} \]

[In]

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

[Out]

-log((5*x*exp(x) - 5/2)*exp(-x)/x)*log(4*x + 16)/x

Maxima [B] (verification not implemented)

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

Time = 0.33 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.93 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=-\frac {2 \, \log \left (5\right ) \log \left (2\right ) - 2 \, \log \left (2\right )^{2} + {\left (2 \, \log \left (2\right ) + \log \left (x + 4\right )\right )} \log \left (2 \, x e^{x} - 1\right ) - {\left (x - \log \left (5\right ) + \log \left (2\right ) + \log \left (x\right )\right )} \log \left (x + 4\right ) - 2 \, \log \left (2\right ) \log \left (x\right )}{x} \]

[In]

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

[Out]

-(2*log(5)*log(2) - 2*log(2)^2 + (2*log(2) + log(x + 4))*log(2*x*e^x - 1) - (x - log(5) + log(2) + log(x))*log
(x + 4) - 2*log(2)*log(x))/x

Giac [B] (verification not implemented)

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

Time = 0.35 (sec) , antiderivative size = 69, normalized size of antiderivative = 2.30 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=\frac {2 \, \log \left (2\right )^{2} - 2 \, \log \left (2\right ) \log \left (5 \, {\left (2 \, x e^{x} - 1\right )} e^{\left (-x\right )}\right ) + \log \left (2\right ) \log \left (x + 4\right ) - \log \left (5 \, {\left (2 \, x e^{x} - 1\right )} e^{\left (-x\right )}\right ) \log \left (x + 4\right ) + 2 \, \log \left (2\right ) \log \left (x\right ) + \log \left (x + 4\right ) \log \left (x\right )}{x} \]

[In]

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

[Out]

(2*log(2)^2 - 2*log(2)*log(5*(2*x*e^x - 1)*e^(-x)) + log(2)*log(x + 4) - log(5*(2*x*e^x - 1)*e^(-x))*log(x + 4
) + 2*log(2)*log(x) + log(x + 4)*log(x))/x

Mupad [B] (verification not implemented)

Time = 11.37 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.97 \[ \int \frac {\left (-4-5 x-x^2\right ) \log (16+4 x)+\left (x-2 e^x x^2+\left (-4-x+e^x \left (8 x+2 x^2\right )\right ) \log (16+4 x)\right ) \log \left (\frac {e^{-x} \left (-5+10 e^x x\right )}{2 x}\right )}{-4 x^2-x^3+e^x \left (8 x^3+2 x^4\right )} \, dx=\ln \left (x+4\right )-\frac {\ln \left (4\,x+16\right )\,\ln \left (\frac {5\,\left (2\,x\,{\mathrm {e}}^x-1\right )}{2\,x}\right )}{x} \]

[In]

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

[Out]

log(x + 4) - (log(4*x + 16)*log((5*(2*x*exp(x) - 1))/(2*x)))/x