Optimal. Leaf size=38 \[ -2 e^x-\frac {e^{2 x}}{4}+2 e^x x+\frac {1}{2} e^{2 x} x+\frac {x^2}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 38, normalized size of antiderivative = 1.00, 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 = {2214, 2207,
2225} \begin {gather*} \frac {x^2}{2}+2 e^x x+\frac {1}{2} e^{2 x} x-2 e^x-\frac {e^{2 x}}{4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2207
Rule 2214
Rule 2225
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.04, size = 29, normalized size = 0.76 \begin {gather*} \frac {1}{4} \left (8 e^x (-1+x)+2 x^2+e^{2 x} (-1+2 x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [A]
time = 1.97, size = 26, normalized size = 0.68 \begin {gather*} \frac {x^2}{2}+\frac {\left (-1+2 x\right ) E^{2 x}}{4}+2 \left (-1+x\right ) E^x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.01, size = 29, normalized size = 0.76
method | result | size |
risch | \(\frac {x^{2}}{2}+\left (-\frac {1}{4}+\frac {x}{2}\right ) {\mathrm e}^{2 x}+\left (2 x -2\right ) {\mathrm e}^{x}\) | \(25\) |
default | \(-2 \,{\mathrm e}^{x}-\frac {{\mathrm e}^{2 x}}{4}+2 \,{\mathrm e}^{x} x +\frac {{\mathrm e}^{2 x} x}{2}+\frac {x^{2}}{2}\) | \(29\) |
norman | \(-2 \,{\mathrm e}^{x}-\frac {{\mathrm e}^{2 x}}{4}+2 \,{\mathrm e}^{x} x +\frac {{\mathrm e}^{2 x} x}{2}+\frac {x^{2}}{2}\) | \(29\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 24, normalized size = 0.63 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.32, size = 24, normalized size = 0.63 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.05, size = 26, normalized size = 0.68 \begin {gather*} \frac {x^{2}}{2} + \frac {\left (2 x - 1\right ) e^{2 x}}{4} + \frac {\left (8 x - 8\right ) e^{x}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 28, normalized size = 0.74 \begin {gather*} \frac {1}{2} x^{2}+\left (2 x-2\right ) \mathrm {e}^{x}+\frac {1}{4} \left (2 x-1\right ) \mathrm {e}^{2 x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.16, size = 28, normalized size = 0.74 \begin {gather*} \frac {x\,{\mathrm {e}}^{2\,x}}{2}-2\,{\mathrm {e}}^x-\frac {{\mathrm {e}}^{2\,x}}{4}+2\,x\,{\mathrm {e}}^x+\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________