Integrand size = 12, antiderivative size = 128 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=-\frac {3 e^{2 x}}{32}+\frac {1}{8} e^{2 x} x+\frac {x^2}{2}+e^x \cos (x)-e^x x \cos (x)-\frac {1}{32} e^{2 x} \cos (2 x)+e^x x \sin (x)+\frac {1}{16} e^{2 x} \cos (x) \sin (x)-\frac {1}{4} e^{2 x} x \cos (x) \sin (x)-\frac {1}{16} e^{2 x} \sin ^2(x)+\frac {1}{4} e^{2 x} x \sin ^2(x)+\frac {1}{32} e^{2 x} \sin (2 x) \] Output:
-3/32*exp(2*x)+1/8*exp(2*x)*x+1/2*x^2+exp(x)*cos(x)-exp(x)*x*cos(x)-1/32*e xp(2*x)*cos(2*x)+exp(x)*x*sin(x)+1/16*exp(2*x)*cos(x)*sin(x)-1/4*exp(2*x)* x*cos(x)*sin(x)-1/16*exp(2*x)*sin(x)^2+1/4*exp(2*x)*x*sin(x)^2+1/32*exp(2* x)*sin(2*x)
Time = 0.11 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.52 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=\frac {1}{8} \left (4 x^2+e^{2 x} (-1+2 x)-8 e^x (-1+x) \cos (x)-e^{2 x} x \cos (2 x)+8 e^x x \sin (x)-e^{2 x} (-1+2 x) \cos (x) \sin (x)\right ) \] Input:
Integrate[x*(1 + E^x*Sin[x])^2,x]
Output:
(4*x^2 + E^(2*x)*(-1 + 2*x) - 8*E^x*(-1 + x)*Cos[x] - E^(2*x)*x*Cos[2*x] + 8*E^x*x*Sin[x] - E^(2*x)*(-1 + 2*x)*Cos[x]*Sin[x])/8
Time = 0.34 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {7293, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x \left (e^x \sin (x)+1\right )^2 \, dx\) |
\(\Big \downarrow \) 7293 |
\(\displaystyle \int \left (x+e^{2 x} x \sin ^2(x)+2 e^x x \sin (x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {x^2}{2}+\frac {1}{8} e^{2 x} x-\frac {3 e^{2 x}}{32}+\frac {1}{4} e^{2 x} x \sin ^2(x)-\frac {1}{16} e^{2 x} \sin ^2(x)+e^x x \sin (x)+\frac {1}{32} e^{2 x} \sin (2 x)-e^x x \cos (x)+e^x \cos (x)-\frac {1}{32} e^{2 x} \cos (2 x)-\frac {1}{4} e^{2 x} x \sin (x) \cos (x)+\frac {1}{16} e^{2 x} \sin (x) \cos (x)\) |
Input:
Int[x*(1 + E^x*Sin[x])^2,x]
Output:
(-3*E^(2*x))/32 + (E^(2*x)*x)/8 + x^2/2 + E^x*Cos[x] - E^x*x*Cos[x] - (E^( 2*x)*Cos[2*x])/32 + E^x*x*Sin[x] + (E^(2*x)*Cos[x]*Sin[x])/16 - (E^(2*x)*x *Cos[x]*Sin[x])/4 - (E^(2*x)*Sin[x]^2)/16 + (E^(2*x)*x*Sin[x]^2)/4 + (E^(2 *x)*Sin[2*x])/32
Time = 0.77 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.49
method | result | size |
default | \(\frac {{\mathrm e}^{2 x} x}{4}-\frac {{\mathrm e}^{2 x}}{8}-\frac {x \,{\mathrm e}^{2 x} \cos \left (2 x \right )}{8}+\frac {\left (-\frac {x}{4}+\frac {1}{8}\right ) {\mathrm e}^{2 x} \sin \left (2 x \right )}{2}+2 \left (-\frac {x}{2}+\frac {1}{2}\right ) {\mathrm e}^{x} \cos \left (x \right )+{\mathrm e}^{x} x \sin \left (x \right )+\frac {x^{2}}{2}\) | \(63\) |
parts | \(\frac {{\mathrm e}^{2 x} x}{4}-\frac {{\mathrm e}^{2 x}}{8}-\frac {x \,{\mathrm e}^{2 x} \cos \left (2 x \right )}{8}+\frac {\left (-\frac {x}{4}+\frac {1}{8}\right ) {\mathrm e}^{2 x} \sin \left (2 x \right )}{2}+2 \left (-\frac {x}{2}+\frac {1}{2}\right ) {\mathrm e}^{x} \cos \left (x \right )+{\mathrm e}^{x} x \sin \left (x \right )+\frac {x^{2}}{2}\) | \(63\) |
risch | \(\frac {x^{2}}{2}+\left (-\frac {1}{8}+\frac {x}{4}\right ) {\mathrm e}^{2 x}+\left (-\frac {1}{64}+\frac {i}{64}\right ) \left (-1+i+4 x \right ) {\mathrm e}^{\left (2+2 i\right ) x}+\left (-\frac {1}{4}-\frac {i}{4}\right ) \left (-1+i+2 x \right ) {\mathrm e}^{\left (1+i\right ) x}+\left (-\frac {1}{4}+\frac {i}{4}\right ) \left (-1-i+2 x \right ) {\mathrm e}^{\left (1-i\right ) x}+\left (-\frac {1}{64}-\frac {i}{64}\right ) \left (-1-i+4 x \right ) {\mathrm e}^{\left (2-2 i\right ) x}\) | \(85\) |
orering | \(\text {Expression too large to display}\) | \(530\) |
Input:
int(x*(1+exp(x)*sin(x))^2,x,method=_RETURNVERBOSE)
Output:
1/4*exp(x)^2*x-1/8*exp(x)^2-1/8*x*exp(2*x)*cos(2*x)+1/2*(-1/4*x+1/8)*exp(2 *x)*sin(2*x)+2*(-1/2*x+1/2)*exp(x)*cos(x)+exp(x)*x*sin(x)+1/2*x^2
Time = 0.08 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.43 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=-{\left (x - 1\right )} \cos \left (x\right ) e^{x} + \frac {1}{2} \, x^{2} - \frac {1}{8} \, {\left (2 \, x \cos \left (x\right )^{2} - 3 \, x + 1\right )} e^{\left (2 \, x\right )} - \frac {1}{8} \, {\left ({\left (2 \, x - 1\right )} \cos \left (x\right ) e^{\left (2 \, x\right )} - 8 \, x e^{x}\right )} \sin \left (x\right ) \] Input:
integrate(x*(1+exp(x)*sin(x))^2,x, algorithm="fricas")
Output:
-(x - 1)*cos(x)*e^x + 1/2*x^2 - 1/8*(2*x*cos(x)^2 - 3*x + 1)*e^(2*x) - 1/8 *((2*x - 1)*cos(x)*e^(2*x) - 8*x*e^x)*sin(x)
Time = 0.48 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.85 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=\frac {x^{2}}{2} + \frac {3 x e^{2 x} \sin ^{2}{\left (x \right )}}{8} - \frac {x e^{2 x} \sin {\left (x \right )} \cos {\left (x \right )}}{4} + \frac {x e^{2 x} \cos ^{2}{\left (x \right )}}{8} + x e^{x} \sin {\left (x \right )} - x e^{x} \cos {\left (x \right )} - \frac {e^{2 x} \sin ^{2}{\left (x \right )}}{8} + \frac {e^{2 x} \sin {\left (x \right )} \cos {\left (x \right )}}{8} - \frac {e^{2 x} \cos ^{2}{\left (x \right )}}{8} + e^{x} \cos {\left (x \right )} \] Input:
integrate(x*(1+exp(x)*sin(x))**2,x)
Output:
x**2/2 + 3*x*exp(2*x)*sin(x)**2/8 - x*exp(2*x)*sin(x)*cos(x)/4 + x*exp(2*x )*cos(x)**2/8 + x*exp(x)*sin(x) - x*exp(x)*cos(x) - exp(2*x)*sin(x)**2/8 + exp(2*x)*sin(x)*cos(x)/8 - exp(2*x)*cos(x)**2/8 + exp(x)*cos(x)
Time = 0.04 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.45 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=-\frac {1}{8} \, x \cos \left (2 \, x\right ) e^{\left (2 \, x\right )} - {\left (x - 1\right )} \cos \left (x\right ) e^{x} - \frac {1}{16} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} \sin \left (2 \, x\right ) + x e^{x} \sin \left (x\right ) + \frac {1}{2} \, x^{2} + \frac {1}{8} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} \] Input:
integrate(x*(1+exp(x)*sin(x))^2,x, algorithm="maxima")
Output:
-1/8*x*cos(2*x)*e^(2*x) - (x - 1)*cos(x)*e^x - 1/16*(2*x - 1)*e^(2*x)*sin( 2*x) + x*e^x*sin(x) + 1/2*x^2 + 1/8*(2*x - 1)*e^(2*x)
Time = 0.12 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.45 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=\frac {1}{2} \, x^{2} - \frac {1}{16} \, {\left (2 \, x \cos \left (2 \, x\right ) + {\left (2 \, x - 1\right )} \sin \left (2 \, x\right )\right )} e^{\left (2 \, x\right )} + \frac {1}{8} \, {\left (2 \, x - 1\right )} e^{\left (2 \, x\right )} - {\left ({\left (x - 1\right )} \cos \left (x\right ) - x \sin \left (x\right )\right )} e^{x} \] Input:
integrate(x*(1+exp(x)*sin(x))^2,x, algorithm="giac")
Output:
1/2*x^2 - 1/16*(2*x*cos(2*x) + (2*x - 1)*sin(2*x))*e^(2*x) + 1/8*(2*x - 1) *e^(2*x) - ((x - 1)*cos(x) - x*sin(x))*e^x
Time = 0.16 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.54 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=\frac {3\,x\,{\mathrm {e}}^{2\,x}}{8}-\frac {{\mathrm {e}}^{2\,x}}{8}+{\mathrm {e}}^x\,\cos \left (x\right )+\frac {x^2}{2}-\frac {x\,{\mathrm {e}}^{2\,x}\,{\cos \left (x\right )}^2}{4}+\frac {{\mathrm {e}}^{2\,x}\,\cos \left (x\right )\,\sin \left (x\right )}{8}-x\,{\mathrm {e}}^x\,\cos \left (x\right )+x\,{\mathrm {e}}^x\,\sin \left (x\right )-\frac {x\,{\mathrm {e}}^{2\,x}\,\cos \left (x\right )\,\sin \left (x\right )}{4} \] Input:
int(x*(exp(x)*sin(x) + 1)^2,x)
Output:
(3*x*exp(2*x))/8 - exp(2*x)/8 + exp(x)*cos(x) + x^2/2 - (x*exp(2*x)*cos(x) ^2)/4 + (exp(2*x)*cos(x)*sin(x))/8 - x*exp(x)*cos(x) + x*exp(x)*sin(x) - ( x*exp(2*x)*cos(x)*sin(x))/4
Time = 0.15 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.60 \[ \int x \left (1+e^x \sin (x)\right )^2 \, dx=-\frac {e^{2 x} \cos \left (x \right ) \sin \left (x \right ) x}{4}+\frac {e^{2 x} \cos \left (x \right ) \sin \left (x \right )}{8}-e^{x} \cos \left (x \right ) x +e^{x} \cos \left (x \right )+\frac {e^{2 x} \sin \left (x \right )^{2} x}{4}+\frac {e^{2 x} x}{8}-\frac {e^{2 x}}{8}+e^{x} \sin \left (x \right ) x +\frac {x^{2}}{2} \] Input:
int(x*(1+exp(x)*sin(x))^2,x)
Output:
( - 2*e**(2*x)*cos(x)*sin(x)*x + e**(2*x)*cos(x)*sin(x) - 8*e**x*cos(x)*x + 8*e**x*cos(x) + 2*e**(2*x)*sin(x)**2*x + e**(2*x)*x - e**(2*x) + 8*e**x* sin(x)*x + 4*x**2)/8