3.12.13 \(\int \frac {e^{2 x} (-1+x)-x^2+x^3+e^x (-3 x+3 x^2)}{e^{2 x} x+2 e^x x^2+x^3} \, dx\)

Optimal. Leaf size=19 \[ \frac {31}{2}+x-\frac {x}{e^x+x}-\log (x) \]

________________________________________________________________________________________

Rubi [F]  time = 0.82, antiderivative size = 0, normalized size of antiderivative = 0.00, number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.000, Rules used = {} \begin {gather*} \int \frac {e^{2 x} (-1+x)-x^2+x^3+e^x \left (-3 x+3 x^2\right )}{e^{2 x} x+2 e^x x^2+x^3} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

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

[Out]

x + (E^x + x)^(-1) - Log[x] + Defer[Int][(E^x + x)^(-2), x] - Defer[Int][x^2/(E^x + x)^2, x] + Defer[Int][x/(E
^x + x), x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 16, normalized size = 0.84 \begin {gather*} x-\frac {x}{e^x+x}-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - x/(E^x + x) - Log[x]

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 26, normalized size = 1.37 \begin {gather*} \frac {x^{2} + x e^{x} - {\left (x + e^{x}\right )} \log \relax (x) - x}{x + e^{x}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.47, size = 69, normalized size = 3.63 \begin {gather*} \frac {x^{2} + x e^{x} + x \log \left (x + e^{x}\right ) + e^{x} \log \left (x + e^{x}\right ) - x \log \relax (x) - e^{x} \log \relax (x) - x \log \left (-x - e^{x}\right ) - e^{x} \log \left (-x - e^{x}\right ) - x}{x + e^{x}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 16, normalized size = 0.84




method result size



risch \(x -\ln \relax (x )-\frac {x}{{\mathrm e}^{x}+x}\) \(16\)
norman \(\frac {x^{2}+{\mathrm e}^{x}+{\mathrm e}^{x} x}{{\mathrm e}^{x}+x}-\ln \relax (x )\) \(23\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x-ln(x)-x/(exp(x)+x)

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 23, normalized size = 1.21 \begin {gather*} \frac {x^{2} + x e^{x} - x}{x + e^{x}} - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.10, size = 23, normalized size = 1.21 \begin {gather*} \frac {x\,{\mathrm {e}}^x-x+x^2}{x+{\mathrm {e}}^x}-\ln \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 10, normalized size = 0.53 \begin {gather*} x - \frac {x}{x + e^{x}} - \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - x/(x + exp(x)) - log(x)

________________________________________________________________________________________