\(\int \frac {e^{-4-x} (18+6 x-15 x^2-3 x^3+(-6-6 x+9 x^2+3 x^3) \log (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}))}{2+4 x+x^2} \, dx\) [5105]

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

Optimal result

Integrand size = 72, antiderivative size = 29 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=3 e^{-4-x} x \left (1-\log \left (\left (-5+\frac {-2+x}{x}-x\right )^2\right )\right ) \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(64\) vs. \(2(29)=58\).

Time = 0.58 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.21, number of steps used = 20, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {6860, 2225, 2207, 2209, 2634, 12} \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3 e^{-x-4} \log \left (\frac {\left (x^2+4 x+2\right )^2}{x^2}\right )+3 e^{-x-4} (1-x) \log \left (\frac {\left (x^2+4 x+2\right )^2}{x^2}\right )+3 e^{-x-4} x \]

[In]

Int[(E^(-4 - x)*(18 + 6*x - 15*x^2 - 3*x^3 + (-6 - 6*x + 9*x^2 + 3*x^3)*Log[(4 + 16*x + 20*x^2 + 8*x^3 + x^4)/
x^2]))/(2 + 4*x + x^2),x]

[Out]

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

Rule 12

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

Rule 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

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 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {3 e^{-4-x} \left (-6-2 x+5 x^2+x^3\right )}{2+4 x+x^2}+3 e^{-4-x} (-1+x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )\right ) \, dx \\ & = -\left (3 \int \frac {e^{-4-x} \left (-6-2 x+5 x^2+x^3\right )}{2+4 x+x^2} \, dx\right )+3 \int e^{-4-x} (-1+x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right ) \, dx \\ & = -3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )-3 \int \frac {2 e^{-4-x} \left (2-x^2\right )}{2+4 x+x^2} \, dx-3 \int \left (e^{-4-x}+e^{-4-x} x-\frac {8 e^{-4-x} (1+x)}{2+4 x+x^2}\right ) \, dx \\ & = -3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )-3 \int e^{-4-x} \, dx-3 \int e^{-4-x} x \, dx-6 \int \frac {e^{-4-x} \left (2-x^2\right )}{2+4 x+x^2} \, dx+24 \int \frac {e^{-4-x} (1+x)}{2+4 x+x^2} \, dx \\ & = 3 e^{-4-x}+3 e^{-4-x} x-3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )-3 \int e^{-4-x} \, dx-6 \int \left (-e^{-4-x}+\frac {4 e^{-4-x} (1+x)}{2+4 x+x^2}\right ) \, dx+24 \int \left (\frac {\left (1-\frac {1}{\sqrt {2}}\right ) e^{-4-x}}{4-2 \sqrt {2}+2 x}+\frac {\left (1+\frac {1}{\sqrt {2}}\right ) e^{-4-x}}{4+2 \sqrt {2}+2 x}\right ) \, dx \\ & = 6 e^{-4-x}+3 e^{-4-x} x-3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+6 \int e^{-4-x} \, dx-24 \int \frac {e^{-4-x} (1+x)}{2+4 x+x^2} \, dx+\left (12 \left (2-\sqrt {2}\right )\right ) \int \frac {e^{-4-x}}{4-2 \sqrt {2}+2 x} \, dx+\left (12 \left (2+\sqrt {2}\right )\right ) \int \frac {e^{-4-x}}{4+2 \sqrt {2}+2 x} \, dx \\ & = 3 e^{-4-x} x+6 \left (2+\sqrt {2}\right ) e^{-2+\sqrt {2}} \text {Ei}\left (-2-\sqrt {2}-x\right )+6 \left (2-\sqrt {2}\right ) e^{-2-\sqrt {2}} \text {Ei}\left (-2+\sqrt {2}-x\right )-3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )-24 \int \left (\frac {\left (1-\frac {1}{\sqrt {2}}\right ) e^{-4-x}}{4-2 \sqrt {2}+2 x}+\frac {\left (1+\frac {1}{\sqrt {2}}\right ) e^{-4-x}}{4+2 \sqrt {2}+2 x}\right ) \, dx \\ & = 3 e^{-4-x} x+6 \left (2+\sqrt {2}\right ) e^{-2+\sqrt {2}} \text {Ei}\left (-2-\sqrt {2}-x\right )+6 \left (2-\sqrt {2}\right ) e^{-2-\sqrt {2}} \text {Ei}\left (-2+\sqrt {2}-x\right )-3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )-\left (12 \left (2-\sqrt {2}\right )\right ) \int \frac {e^{-4-x}}{4-2 \sqrt {2}+2 x} \, dx-\left (12 \left (2+\sqrt {2}\right )\right ) \int \frac {e^{-4-x}}{4+2 \sqrt {2}+2 x} \, dx \\ & = 3 e^{-4-x} x-3 e^{-4-x} \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )+3 e^{-4-x} (1-x) \log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.94 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.93 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3 e^{-4-x} x \left (-1+\log \left (\frac {\left (2+4 x+x^2\right )^2}{x^2}\right )\right ) \]

[In]

Integrate[(E^(-4 - x)*(18 + 6*x - 15*x^2 - 3*x^3 + (-6 - 6*x + 9*x^2 + 3*x^3)*Log[(4 + 16*x + 20*x^2 + 8*x^3 +
 x^4)/x^2]))/(2 + 4*x + x^2),x]

[Out]

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

Maple [A] (verified)

Time = 0.61 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.41

method result size
parallelrisch \(\frac {{\mathrm e}^{-4} \left (-24 \ln \left (\frac {x^{4}+8 x^{3}+20 x^{2}+16 x +4}{x^{2}}\right ) x +24 x \right ) {\mathrm e}^{-x}}{8}\) \(41\)
norman \(\left (3 x \,{\mathrm e}^{-4}-3 x \,{\mathrm e}^{-4} \ln \left (\frac {x^{4}+8 x^{3}+20 x^{2}+16 x +4}{x^{2}}\right )\right ) {\mathrm e}^{-x}\) \(44\)
risch \(-6 \ln \left (x^{2}+4 x +2\right ) x \,{\mathrm e}^{-4-x}+\frac {3 \left (-i \pi \operatorname {csgn}\left (i x \right )^{2} \operatorname {csgn}\left (i x^{2}\right )+2 i \pi \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i x^{2}\right )^{2}+i \pi \,\operatorname {csgn}\left (\frac {i}{x^{2}}\right ) \operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )^{2}\right ) \operatorname {csgn}\left (\frac {i \left (x^{2}+4 x +2\right )^{2}}{x^{2}}\right )-i \pi \,\operatorname {csgn}\left (\frac {i}{x^{2}}\right ) {\operatorname {csgn}\left (\frac {i \left (x^{2}+4 x +2\right )^{2}}{x^{2}}\right )}^{2}-i \pi \operatorname {csgn}\left (i x^{2}\right )^{3}+i \pi {\operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )\right )}^{2} \operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )^{2}\right )-2 i \pi \,\operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )\right ) {\operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )^{2}\right )}^{2}+i \pi {\operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )^{2}\right )}^{3}-i \pi \,\operatorname {csgn}\left (i \left (x^{2}+4 x +2\right )^{2}\right ) {\operatorname {csgn}\left (\frac {i \left (x^{2}+4 x +2\right )^{2}}{x^{2}}\right )}^{2}+i \pi {\operatorname {csgn}\left (\frac {i \left (x^{2}+4 x +2\right )^{2}}{x^{2}}\right )}^{3}+4 \ln \left (x \right )+2\right ) x \,{\mathrm e}^{-4-x}}{2}\) \(300\)

[In]

int(((3*x^3+9*x^2-6*x-6)*ln((x^4+8*x^3+20*x^2+16*x+4)/x^2)-3*x^3-15*x^2+6*x+18)/(x^2+4*x+2)/exp(4)/exp(x),x,me
thod=_RETURNVERBOSE)

[Out]

1/8/exp(4)*(-24*ln((x^4+8*x^3+20*x^2+16*x+4)/x^2)*x+24*x)/exp(x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.45 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3 \, x e^{\left (-x - 4\right )} \log \left (\frac {x^{4} + 8 \, x^{3} + 20 \, x^{2} + 16 \, x + 4}{x^{2}}\right ) + 3 \, x e^{\left (-x - 4\right )} \]

[In]

integrate(((3*x^3+9*x^2-6*x-6)*log((x^4+8*x^3+20*x^2+16*x+4)/x^2)-3*x^3-15*x^2+6*x+18)/(x^2+4*x+2)/exp(4)/exp(
x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.24 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=\frac {\left (- 3 x \log {\left (\frac {x^{4} + 8 x^{3} + 20 x^{2} + 16 x + 4}{x^{2}} \right )} + 3 x\right ) e^{- x}}{e^{4}} \]

[In]

integrate(((3*x**3+9*x**2-6*x-6)*ln((x**4+8*x**3+20*x**2+16*x+4)/x**2)-3*x**3-15*x**2+6*x+18)/(x**2+4*x+2)/exp
(4)/exp(x),x)

[Out]

(-3*x*log((x**4 + 8*x**3 + 20*x**2 + 16*x + 4)/x**2) + 3*x)*exp(-4)*exp(-x)

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.17 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3 \, {\left (2 \, x e^{\left (-x\right )} \log \left (x^{2} + 4 \, x + 2\right ) - {\left (2 \, x \log \left (x\right ) + x\right )} e^{\left (-x\right )}\right )} e^{\left (-4\right )} \]

[In]

integrate(((3*x^3+9*x^2-6*x-6)*log((x^4+8*x^3+20*x^2+16*x+4)/x^2)-3*x^3-15*x^2+6*x+18)/(x^2+4*x+2)/exp(4)/exp(
x),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.41 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3 \, {\left (x e^{\left (-x\right )} \log \left (\frac {x^{4} + 8 \, x^{3} + 20 \, x^{2} + 16 \, x + 4}{x^{2}}\right ) - x e^{\left (-x\right )}\right )} e^{\left (-4\right )} \]

[In]

integrate(((3*x^3+9*x^2-6*x-6)*log((x^4+8*x^3+20*x^2+16*x+4)/x^2)-3*x^3-15*x^2+6*x+18)/(x^2+4*x+2)/exp(4)/exp(
x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.01 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.17 \[ \int \frac {e^{-4-x} \left (18+6 x-15 x^2-3 x^3+\left (-6-6 x+9 x^2+3 x^3\right ) \log \left (\frac {4+16 x+20 x^2+8 x^3+x^4}{x^2}\right )\right )}{2+4 x+x^2} \, dx=-3\,x\,{\mathrm {e}}^{-x-4}\,\left (\ln \left (\frac {x^4+8\,x^3+20\,x^2+16\,x+4}{x^2}\right )-1\right ) \]

[In]

int(-(exp(-x)*exp(-4)*(log((16*x + 20*x^2 + 8*x^3 + x^4 + 4)/x^2)*(6*x - 9*x^2 - 3*x^3 + 6) - 6*x + 15*x^2 + 3
*x^3 - 18))/(4*x + x^2 + 2),x)

[Out]

-3*x*exp(- x - 4)*(log((16*x + 20*x^2 + 8*x^3 + x^4 + 4)/x^2) - 1)