\(\int \frac {4 x^2-9 x^4+4 x^5+e^3 (-2+2 x^2)+(-4 x+4 x^2+5 x^3-3 x^4) \log (-1-x)}{e^3 (x+x^2)} \, dx\) [4825]

   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 = 64, antiderivative size = 28 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=x \left (2+\frac {(-2+x)^2 (x-\log (-1-x))}{e^3}\right )-2 \log (x) \]

[Out]

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

Rubi [B] (verified)

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

Time = 0.23 (sec) , antiderivative size = 98, normalized size of antiderivative = 3.50, number of steps used = 16, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.141, Rules used = {12, 1607, 6874, 1634, 2464, 2436, 2332, 2442, 45} \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=\frac {x^4}{e^3}-\frac {4 x^3}{e^3}-\frac {x^3 \log (-x-1)}{e^3}+\frac {4 x^2}{e^3}+\frac {4 x^2 \log (-x-1)}{e^3}-\frac {\left (9-2 e^3\right ) x}{e^3}+\frac {9 x}{e^3}-\frac {4 (x+1) \log (-x-1)}{e^3}-2 \log (x)+\frac {4 \log (x+1)}{e^3} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

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, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 1607

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

Rule 1634

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2436

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

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 2464

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(Polyx_), x_Symbol] :> Int[ExpandIntegrand[Poly
x*(a + b*Log[c*(d + e*x)^n])^p, x], x] /; FreeQ[{a, b, c, d, e, n, p}, x] && PolynomialQ[Polyx, x]

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 {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{x+x^2} \, dx}{e^3} \\ & = \frac {\int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{x (1+x)} \, dx}{e^3} \\ & = \frac {\int \left (\frac {-2 e^3+4 \left (1+\frac {e^3}{2}\right ) x^2-9 x^4+4 x^5}{x (1+x)}-(-2+x) (-2+3 x) \log (-1-x)\right ) \, dx}{e^3} \\ & = \frac {\int \frac {-2 e^3+4 \left (1+\frac {e^3}{2}\right ) x^2-9 x^4+4 x^5}{x (1+x)} \, dx}{e^3}-\frac {\int (-2+x) (-2+3 x) \log (-1-x) \, dx}{e^3} \\ & = \frac {\int \left (-9 \left (1-\frac {2 e^3}{9}\right )-\frac {2 e^3}{x}+13 x-13 x^2+4 x^3+\frac {9}{1+x}\right ) \, dx}{e^3}-\frac {\int \left (4 \log (-1-x)-8 x \log (-1-x)+3 x^2 \log (-1-x)\right ) \, dx}{e^3} \\ & = -\frac {\left (9-2 e^3\right ) x}{e^3}+\frac {13 x^2}{2 e^3}-\frac {13 x^3}{3 e^3}+\frac {x^4}{e^3}-2 \log (x)+\frac {9 \log (1+x)}{e^3}-\frac {3 \int x^2 \log (-1-x) \, dx}{e^3}-\frac {4 \int \log (-1-x) \, dx}{e^3}+\frac {8 \int x \log (-1-x) \, dx}{e^3} \\ & = -\frac {\left (9-2 e^3\right ) x}{e^3}+\frac {13 x^2}{2 e^3}-\frac {13 x^3}{3 e^3}+\frac {x^4}{e^3}+\frac {4 x^2 \log (-1-x)}{e^3}-\frac {x^3 \log (-1-x)}{e^3}-2 \log (x)+\frac {9 \log (1+x)}{e^3}-\frac {\int \frac {x^3}{-1-x} \, dx}{e^3}+\frac {4 \int \frac {x^2}{-1-x} \, dx}{e^3}+\frac {4 \text {Subst}(\int \log (x) \, dx,x,-1-x)}{e^3} \\ & = \frac {4 x}{e^3}-\frac {\left (9-2 e^3\right ) x}{e^3}+\frac {13 x^2}{2 e^3}-\frac {13 x^3}{3 e^3}+\frac {x^4}{e^3}+\frac {4 x^2 \log (-1-x)}{e^3}-\frac {x^3 \log (-1-x)}{e^3}-\frac {4 (1+x) \log (-1-x)}{e^3}-2 \log (x)+\frac {9 \log (1+x)}{e^3}-\frac {\int \left (-1+x-x^2+\frac {1}{1+x}\right ) \, dx}{e^3}+\frac {4 \int \left (1+\frac {1}{-1-x}-x\right ) \, dx}{e^3} \\ & = \frac {9 x}{e^3}-\frac {\left (9-2 e^3\right ) x}{e^3}+\frac {4 x^2}{e^3}-\frac {4 x^3}{e^3}+\frac {x^4}{e^3}+\frac {4 x^2 \log (-1-x)}{e^3}-\frac {x^3 \log (-1-x)}{e^3}-\frac {4 (1+x) \log (-1-x)}{e^3}-2 \log (x)+\frac {4 \log (1+x)}{e^3} \\ \end{align*}

Mathematica [B] (verified)

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

Time = 0.09 (sec) , antiderivative size = 76, normalized size of antiderivative = 2.71 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=\frac {2 e^3 x+4 x^2-4 x^3+x^4-4 \log (-1-x)-4 x \log (-1-x)+4 x^2 \log (-1-x)-x^3 \log (-1-x)-2 e^3 \log (x)+4 \log (1+x)}{e^3} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.86

method result size
risch \({\mathrm e}^{-3} \left (-x^{3}+4 x^{2}-4 x \right ) \ln \left (-1-x \right )+{\mathrm e}^{-3} x^{4}-4 \,{\mathrm e}^{-3} x^{3}+2 x +4 x^{2} {\mathrm e}^{-3}-2 \ln \left (x \right )\) \(52\)
parallelrisch \({\mathrm e}^{-3} \left (x^{4}-\ln \left (-1-x \right ) x^{3}-4 x^{3}+4 \ln \left (-1-x \right ) x^{2}-2 \ln \left (x \right ) {\mathrm e}^{3}+2 x \,{\mathrm e}^{3}-4+4 x^{2}-4 \ln \left (-1-x \right ) x -4 \,{\mathrm e}^{3}\right )\) \(67\)
norman \(-\ln \left (-1-x \right ) {\mathrm e}^{-3} x^{3}+{\mathrm e}^{-3} x^{4}+4 \ln \left (-1-x \right ) {\mathrm e}^{-3} x^{2}-4 \,{\mathrm e}^{-3} x^{3}-4 \ln \left (-1-x \right ) {\mathrm e}^{-3} x +4 x^{2} {\mathrm e}^{-3}-2 \ln \left (x \right )+2 x\) \(78\)
default \({\mathrm e}^{-3} \left (\ln \left (-1-x \right ) \left (-1-x \right )^{3}+8 \left (-1-x \right )^{3}+7 \ln \left (-1-x \right ) \left (-1-x \right )^{2}+22 \left (-1-x \right )^{2}+15 \ln \left (-1-x \right ) \left (-1-x \right )-24-24 x +\left (-1-x \right )^{4}-2 \left (-1-x \right ) {\mathrm e}^{3}-2 \,{\mathrm e}^{3} \ln \left (-x \right )+9 \ln \left (-1-x \right )\right )\) \(103\)
derivativedivides \(-{\mathrm e}^{-3} \left (-\ln \left (-1-x \right ) \left (-1-x \right )^{3}-8 \left (-1-x \right )^{3}-7 \ln \left (-1-x \right ) \left (-1-x \right )^{2}-22 \left (-1-x \right )^{2}-15 \ln \left (-1-x \right ) \left (-1-x \right )+24+24 x -\left (-1-x \right )^{4}+2 \left (-1-x \right ) {\mathrm e}^{3}+2 \,{\mathrm e}^{3} \ln \left (-x \right )-9 \ln \left (-1-x \right )\right )\) \(107\)
parts \({\mathrm e}^{-3} \left (x^{4}-\frac {13 x^{3}}{3}+\frac {13 x^{2}}{2}-9 x +2 x \,{\mathrm e}^{3}+9 \ln \left (1+x \right )-2 \ln \left (x \right ) {\mathrm e}^{3}\right )-{\mathrm e}^{-3} \left (-\ln \left (-1-x \right ) \left (-1-x \right )^{3}+\frac {\left (-1-x \right )^{3}}{3}-7 \ln \left (-1-x \right ) \left (-1-x \right )^{2}+\frac {7 \left (-1-x \right )^{2}}{2}-15 \ln \left (-1-x \right ) \left (-1-x \right )-15-15 x \right )\) \(113\)

[In]

int(((-3*x^4+5*x^3+4*x^2-4*x)*ln(-1-x)+(2*x^2-2)*exp(3)+4*x^5-9*x^4+4*x^2)/(x^2+x)/exp(3),x,method=_RETURNVERB
OSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.71 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx={\left (x^{4} - 4 \, x^{3} + 4 \, x^{2} + 2 \, x e^{3} - 2 \, e^{3} \log \left (x\right ) - {\left (x^{3} - 4 \, x^{2} + 4 \, x\right )} \log \left (-x - 1\right )\right )} e^{\left (-3\right )} \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.11 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.89 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=\frac {\left (- x^{3} + 4 x^{2} - 4 x\right ) \log {\left (- x - 1 \right )}}{e^{3}} + \frac {x^{4} - 4 x^{3} + 4 x^{2} + 2 x e^{3} - 2 e^{3} \log {\left (x \right )}}{e^{3}} \]

[In]

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

[Out]

(-x**3 + 4*x**2 - 4*x)*exp(-3)*log(-x - 1) + (x**4 - 4*x**3 + 4*x**2 + 2*x*exp(3) - 2*exp(3)*log(x))*exp(-3)

Maxima [B] (verification not implemented)

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

Time = 0.18 (sec) , antiderivative size = 128, normalized size of antiderivative = 4.57 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=\frac {1}{2} \, {\left (2 \, x^{4} - 8 \, x^{3} + 8 \, x^{2} + 4 \, {\left (x - \log \left (x + 1\right )\right )} e^{3} + 4 \, {\left (\log \left (x + 1\right ) - \log \left (x\right )\right )} e^{3} - 4 \, \log \left (x + 1\right )^{2} - {\left (2 \, x^{3} - 3 \, x^{2} + 6 \, x - 6 \, \log \left (x + 1\right )\right )} \log \left (-x - 1\right ) + 5 \, {\left (x^{2} - 2 \, x + 2 \, \log \left (x + 1\right )\right )} \log \left (-x - 1\right ) + 8 \, {\left (x - \log \left (x + 1\right )\right )} \log \left (-x - 1\right ) - 4 \, \log \left (-x - 1\right )^{2}\right )} e^{\left (-3\right )} \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 87, normalized size of antiderivative = 3.11 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx={\left ({\left (x + 1\right )}^{4} - {\left (x + 1\right )}^{3} \log \left (-x - 1\right ) - 8 \, {\left (x + 1\right )}^{3} + 7 \, {\left (x + 1\right )}^{2} \log \left (-x - 1\right ) + 22 \, {\left (x + 1\right )}^{2} + 2 \, {\left (x + 1\right )} e^{3} - 2 \, e^{3} \log \left (-x\right ) - 15 \, {\left (x + 1\right )} \log \left (-x - 1\right ) - 24 \, x + 9 \, \log \left (-x - 1\right ) - 24\right )} e^{\left (-3\right )} \]

[In]

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

[Out]

((x + 1)^4 - (x + 1)^3*log(-x - 1) - 8*(x + 1)^3 + 7*(x + 1)^2*log(-x - 1) + 22*(x + 1)^2 + 2*(x + 1)*e^3 - 2*
e^3*log(-x) - 15*(x + 1)*log(-x - 1) - 24*x + 9*log(-x - 1) - 24)*e^(-3)

Mupad [B] (verification not implemented)

Time = 10.41 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.32 \[ \int \frac {4 x^2-9 x^4+4 x^5+e^3 \left (-2+2 x^2\right )+\left (-4 x+4 x^2+5 x^3-3 x^4\right ) \log (-1-x)}{e^3 \left (x+x^2\right )} \, dx=2\,x-2\,\ln \left (x\right )+4\,x^2\,{\mathrm {e}}^{-3}-4\,x^3\,{\mathrm {e}}^{-3}+x^4\,{\mathrm {e}}^{-3}+4\,x^2\,{\mathrm {e}}^{-3}\,\ln \left (-x-1\right )-x^3\,{\mathrm {e}}^{-3}\,\ln \left (-x-1\right )-4\,x\,{\mathrm {e}}^{-3}\,\ln \left (-x-1\right ) \]

[In]

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

[Out]

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