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

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

________________________________________________________________________________________

Rubi [A]  time = 3.02, antiderivative size = 36, normalized size of antiderivative = 1.12, number of steps used = 21, number of rules used = 9, integrand size = 193, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.047, Rules used = {6741, 6728, 6684, 6688, 2194, 2176, 2178, 2554, 2270} \begin {gather*} -e^x \log \left (-x^2+x+1\right )-e^x x+\log \left (2 x-2 \log (x)-2 e^3+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$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 2270

Int[((F_)^((g_.)*((d_.) + (e_.)*(x_))^(n_.))*(u_)^(m_.))/((a_.) + (b_.)*(x_) + (c_)*(x_)^2), x_Symbol] :> Int[
ExpandIntegrand[F^(g*(d + e*x)^n), u^m/(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e, g, n}, x] && Poly
nomialQ[u, x] && IntegerQ[m]

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 6684

Int[(u_)/(y_), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*Log[RemoveContent[y, x]], x] /;  !Fa
lseQ[q]]

Rule 6688

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

Rule 6728

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]

Rule 6741

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

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.75, size = 33, normalized size = 1.03 \begin {gather*} -x e^{x} - e^{x} \log \left (-x^{2} + x + 1\right ) + \log \left (-2 \, x + 2 \, e^{3} + 2 \, \log \relax (x) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.49, size = 30, normalized size = 0.94




method result size



risch \(-{\mathrm e}^{x} \ln \left (-x^{2}+x +1\right )-{\mathrm e}^{x} x +\ln \left ({\mathrm e}^{3}-x +\ln \relax (x )-\frac {1}{2}\right )\) \(30\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.40, size = 29, normalized size = 0.91 \begin {gather*} -x e^{x} - e^{x} \log \left (-x^{2} + x + 1\right ) + \log \left (-x + e^{3} + \log \relax (x) - \frac {1}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 7.48, size = 29, normalized size = 0.91 \begin {gather*} \ln \left ({\mathrm {e}}^3-x+\ln \relax (x)-\frac {1}{2}\right )-x\,{\mathrm {e}}^x-{\mathrm {e}}^x\,\ln \left (-x^2+x+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 1.08, size = 27, normalized size = 0.84 \begin {gather*} \left (- x - \log {\left (- x^{2} + x + 1 \right )}\right ) e^{x} + \log {\left (- x + \log {\relax (x )} - \frac {1}{2} + e^{3} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________