Optimal. Leaf size=38 \[ \frac{x^2}{2}+2 e^x x+\frac{1}{2} e^{2 x} x-2 e^x-\frac{e^{2 x}}{4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0326818, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2183, 2176, 2194} \[ \frac{x^2}{2}+2 e^x x+\frac{1}{2} e^{2 x} x-2 e^x-\frac{e^{2 x}}{4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2183
Rule 2176
Rule 2194
Rubi steps
\begin{align*} \int \left (1+e^x\right )^2 x \, dx &=\int \left (x+2 e^x x+e^{2 x} x\right ) \, dx\\ &=\frac{x^2}{2}+2 \int e^x x \, dx+\int e^{2 x} x \, dx\\ &=2 e^x x+\frac{1}{2} e^{2 x} x+\frac{x^2}{2}-\frac{1}{2} \int e^{2 x} \, dx-2 \int e^x \, dx\\ &=-2 e^x-\frac{e^{2 x}}{4}+2 e^x x+\frac{1}{2} e^{2 x} x+\frac{x^2}{2}\\ \end{align*}
Mathematica [A] time = 0.0256854, size = 29, normalized size = 0.76 \[ \frac{1}{4} \left (2 x^2+8 e^x (x-1)+e^{2 x} (2 x-1)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.002, size = 29, normalized size = 0.8 \begin{align*}{\frac{{x}^{2}}{2}}+{\frac{ \left ({{\rm e}^{x}} \right ) ^{2}x}{2}}-{\frac{ \left ({{\rm e}^{x}} \right ) ^{2}}{4}}+2\,{{\rm e}^{x}}x-2\,{{\rm e}^{x}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.936797, size = 32, normalized size = 0.84 \begin{align*} \frac{1}{2} \, x^{2} + \frac{1}{4} \,{\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \,{\left (x - 1\right )} e^{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.9211, size = 66, normalized size = 1.74 \begin{align*} \frac{1}{2} \, x^{2} + \frac{1}{4} \,{\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \,{\left (x - 1\right )} e^{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.088345, size = 26, normalized size = 0.68 \begin{align*} \frac{x^{2}}{2} + \frac{\left (2 x - 1\right ) e^{2 x}}{4} + \frac{\left (8 x - 8\right ) e^{x}}{4} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06624, size = 32, normalized size = 0.84 \begin{align*} \frac{1}{2} \, x^{2} + \frac{1}{4} \,{\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} + 2 \,{\left (x - 1\right )} e^{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]