3.27.71 \(\int \frac {e^{-4+2 e^x+2 x+4 x^2} (3-3 x)+2 x-x^2-2 e^x x^2-9 x^3+(-3 e^{-4+2 e^x+2 x+4 x^2}-x^2) \log (e^{4-2 e^x-2 x-4 x^2} (3 e^{-4+2 e^x+2 x+4 x^2}+x^2))}{3 e^{-4+2 e^x+3 x+4 x^2}+e^x x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 4.76, antiderivative size = 40, normalized size of antiderivative = 1.05, number of steps used = 13, number of rules used = 5, integrand size = 143, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.035, Rules used = {6742, 2194, 2176, 2554, 12} \begin {gather*} e^{-x} \log \left (e^{2 \left (-2 x^2-x-e^x+2\right )} x^2+3\right )+e^{-x} x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x/E^x + Log[3 + E^(2*(2 - E^x - x - 2*x^2))*x^2]/E^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 2176

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] &&  !$UseGamma === True

Rule 2194

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 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 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-\frac {2 e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}-e^{-x} \left (-1+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right )\right ) \, dx\\ &=-\left (2 \int \frac {e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\right )-\int e^{-x} \left (-1+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \, dx\\ &=-\left (2 \int \left (-\frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^4 x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {4 e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}\right ) \, dx\right )-\int \left (-e^{-x}+e^{-x} x+e^{-x} \log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \, dx\\ &=2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx+\int e^{-x} \, dx-\int e^{-x} x \, dx-\int e^{-x} \log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right ) \, dx\\ &=-e^{-x}+e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\int e^{-x} \, dx+\int \frac {2 e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 \left (e^x+x+2 x^2\right )}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x \left (-1+x+e^x x+4 x^2\right )}{3 e^{2 \left (e^x+x+2 x^2\right )}+e^4 x^2} \, dx+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )+2 \int \frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-2 \int \frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx+2 \int \left (-\frac {e^{4-x} x}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^4 x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {e^{4-x} x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}+\frac {4 e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2}\right ) \, dx-8 \int \frac {e^{4-x} x^3}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx-\left (2 e^4\right ) \int \frac {x^2}{3 e^{2 e^x+2 x+4 x^2}+e^4 x^2} \, dx\\ &=e^{-x} x+e^{-x} \log \left (3+e^{2 \left (2-e^x-x-2 x^2\right )} x^2\right )\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.30, size = 35, normalized size = 0.92 \begin {gather*} e^{-x} \left (2 e^x+x+\log \left (3+e^{-2 \left (-2+e^x+x+2 x^2\right )} x^2\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 48, normalized size = 1.26 \begin {gather*} {\left (x + \log \left ({\left (x^{2} e^{x} + 3 \, e^{\left (4 \, x^{2} + 3 \, x + 2 \, e^{x} - 4\right )}\right )} e^{\left (-4 \, x^{2} - 3 \, x - 2 \, e^{x} + 4\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*exp(exp(x)+2*x^2+x-2)^2-x^2)*log((3*exp(exp(x)+2*x^2+x-2)^2+x^2)/exp(exp(x)+2*x^2+x-2)^2)+(-3*x
+3)*exp(exp(x)+2*x^2+x-2)^2-2*exp(x)*x^2-9*x^3-x^2+2*x)/(3*exp(x)*exp(exp(x)+2*x^2+x-2)^2+exp(x)*x^2),x, algor
ithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.29, size = 39, normalized size = 1.03 \begin {gather*} -{\left (4 \, x^{2} + x - \log \left (x^{2} e^{4} + 3 \, e^{\left (4 \, x^{2} + 2 \, x + 2 \, e^{x}\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*exp(exp(x)+2*x^2+x-2)^2-x^2)*log((3*exp(exp(x)+2*x^2+x-2)^2+x^2)/exp(exp(x)+2*x^2+x-2)^2)+(-3*x
+3)*exp(exp(x)+2*x^2+x-2)^2-2*exp(x)*x^2-9*x^3-x^2+2*x)/(3*exp(x)*exp(exp(x)+2*x^2+x-2)^2+exp(x)*x^2),x, algor
ithm="giac")

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.23, size = 429, normalized size = 11.29




method result size



risch \(-2 \,{\mathrm e}^{-x} \ln \left ({\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right )+\frac {\left (-i \pi \,\mathrm {csgn}\left (i \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4}\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )+i \pi \,\mathrm {csgn}\left (i \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{2}+i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4}\right ) \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{2}+i \pi \mathrm {csgn}\left (i {\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )-2 i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{{\mathrm e}^{x}+2 x^{2}+x -2}\right ) \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )^{2}+i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}\right )^{3}-i \pi \mathrm {csgn}\left (i {\mathrm e}^{-2 \,{\mathrm e}^{x}-4 x^{2}-2 x +4} \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right )^{3}+2 x +2 \ln \left (3 \,{\mathrm e}^{2 \,{\mathrm e}^{x}+4 x^{2}+2 x -4}+x^{2}\right )\right ) {\mathrm e}^{-x}}{2}\) \(429\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-3*exp(exp(x)+2*x^2+x-2)^2-x^2)*ln((3*exp(exp(x)+2*x^2+x-2)^2+x^2)/exp(exp(x)+2*x^2+x-2)^2)+(-3*x+3)*exp
(exp(x)+2*x^2+x-2)^2-2*exp(x)*x^2-9*x^3-x^2+2*x)/(3*exp(x)*exp(exp(x)+2*x^2+x-2)^2+exp(x)*x^2),x,method=_RETUR
NVERBOSE)

[Out]

-2*exp(-x)*ln(exp(exp(x)+2*x^2+x-2))+1/2*(-I*Pi*csgn(I*(3*exp(2*exp(x)+4*x^2+2*x-4)+x^2))*csgn(I*exp(-2*exp(x)
-4*x^2-2*x+4))*csgn(I*exp(-2*exp(x)-4*x^2-2*x+4)*(3*exp(2*exp(x)+4*x^2+2*x-4)+x^2))+I*Pi*csgn(I*(3*exp(2*exp(x
)+4*x^2+2*x-4)+x^2))*csgn(I*exp(-2*exp(x)-4*x^2-2*x+4)*(3*exp(2*exp(x)+4*x^2+2*x-4)+x^2))^2+I*Pi*csgn(I*exp(-2
*exp(x)-4*x^2-2*x+4))*csgn(I*exp(-2*exp(x)-4*x^2-2*x+4)*(3*exp(2*exp(x)+4*x^2+2*x-4)+x^2))^2+I*Pi*csgn(I*exp(e
xp(x)+2*x^2+x-2))^2*csgn(I*exp(2*exp(x)+4*x^2+2*x-4))-2*I*Pi*csgn(I*exp(exp(x)+2*x^2+x-2))*csgn(I*exp(2*exp(x)
+4*x^2+2*x-4))^2+I*Pi*csgn(I*exp(2*exp(x)+4*x^2+2*x-4))^3-I*Pi*csgn(I*exp(-2*exp(x)-4*x^2-2*x+4)*(3*exp(2*exp(
x)+4*x^2+2*x-4)+x^2))^3+2*x+2*ln(3*exp(2*exp(x)+4*x^2+2*x-4)+x^2))*exp(-x)

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 39, normalized size = 1.03 \begin {gather*} -{\left (4 \, x^{2} + x - \log \left (x^{2} e^{4} + 3 \, e^{\left (4 \, x^{2} + 2 \, x + 2 \, e^{x}\right )}\right )\right )} e^{\left (-x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-3*exp(exp(x)+2*x^2+x-2)^2-x^2)*log((3*exp(exp(x)+2*x^2+x-2)^2+x^2)/exp(exp(x)+2*x^2+x-2)^2)+(-3*x
+3)*exp(exp(x)+2*x^2+x-2)^2-2*exp(x)*x^2-9*x^3-x^2+2*x)/(3*exp(x)*exp(exp(x)+2*x^2+x-2)^2+exp(x)*x^2),x, algor
ithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int -\frac {2\,x^2\,{\mathrm {e}}^x-2\,x+\ln \left ({\mathrm {e}}^{4-2\,{\mathrm {e}}^x-4\,x^2-2\,x}\,\left (3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}+x^2\right )\right )\,\left (3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}+x^2\right )+{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}\,\left (3\,x-3\right )+x^2+9\,x^3}{x^2\,{\mathrm {e}}^x+3\,{\mathrm {e}}^{2\,x+2\,{\mathrm {e}}^x+4\,x^2-4}\,{\mathrm {e}}^x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.86, size = 48, normalized size = 1.26 \begin {gather*} x e^{- x} + e^{- x} \log {\left (\left (x^{2} + 3 e^{4 x^{2} + 2 x + 2 e^{x} - 4}\right ) e^{- 4 x^{2} - 2 x - 2 e^{x} + 4} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________