\(\int (1+\cos (x)) (x+\sin (x))^3 \, dx\) [793]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 10 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} (x+\sin (x))^4 \]

[Out]

1/4*(x+sin(x))^4

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {6818} \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} (x+\sin (x))^4 \]

[In]

Int[(1 + Cos[x])*(x + Sin[x])^3,x]

[Out]

(x + Sin[x])^4/4

Rule 6818

Int[(u_)*(y_)^(m_.), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*(y^(m + 1)/(m + 1)), x] /;  !F
alseQ[q]] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} (x+\sin (x))^4 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} (x+\sin (x))^4 \]

[In]

Integrate[(1 + Cos[x])*(x + Sin[x])^3,x]

[Out]

(x + Sin[x])^4/4

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(50\) vs. \(2(8)=16\).

Time = 3.20 (sec) , antiderivative size = 51, normalized size of antiderivative = 5.10

method result size
risch \(\frac {x^{4}}{4}+\frac {3 x^{2}}{4}+\frac {9}{16}+\frac {x \left (4 x^{2}+3\right ) \sin \left (x \right )}{4}+\frac {\cos \left (4 x \right )}{32}-\frac {x \sin \left (3 x \right )}{4}+2 \left (-\frac {1}{16}-\frac {3 x^{2}}{8}\right ) \cos \left (2 x \right )\) \(51\)
default \(\frac {\sin \left (x \right )^{4}}{4}+\sin \left (x \right )^{3} x -\frac {3 x^{2} \cos \left (x \right )^{2}}{2}+3 x \left (\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )-\frac {3 x^{2}}{2}+\sin \left (x \right ) x^{3}+3 x \left (-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )+\frac {x^{4}}{4}\) \(65\)
parts \(\frac {\sin \left (x \right )^{4}}{4}+\sin \left (x \right )^{3} x -\frac {3 x^{2} \cos \left (x \right )^{2}}{2}+3 x \left (\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )-\frac {3 x^{2}}{2}+\sin \left (x \right ) x^{3}+3 x \left (-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )+\frac {x^{4}}{4}\) \(65\)

[In]

int((cos(x)+1)*(x+sin(x))^3,x,method=_RETURNVERBOSE)

[Out]

1/4*x^4+3/4*x^2+9/16+1/4*x*(4*x^2+3)*sin(x)+1/32*cos(4*x)-1/4*x*sin(3*x)+2*(-1/16-3/8*x^2)*cos(2*x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (8) = 16\).

Time = 0.25 (sec) , antiderivative size = 45, normalized size of antiderivative = 4.50 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} \, x^{4} + \frac {1}{4} \, \cos \left (x\right )^{4} - \frac {1}{2} \, {\left (3 \, x^{2} + 1\right )} \cos \left (x\right )^{2} + \frac {3}{2} \, x^{2} + {\left (x^{3} - x \cos \left (x\right )^{2} + x\right )} \sin \left (x\right ) \]

[In]

integrate((1+cos(x))*(x+sin(x))^3,x, algorithm="fricas")

[Out]

1/4*x^4 + 1/4*cos(x)^4 - 1/2*(3*x^2 + 1)*cos(x)^2 + 3/2*x^2 + (x^3 - x*cos(x)^2 + x)*sin(x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (7) = 14\).

Time = 0.13 (sec) , antiderivative size = 36, normalized size of antiderivative = 3.60 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {x^{4}}{4} + x^{3} \sin {\left (x \right )} + \frac {3 x^{2} \sin ^{2}{\left (x \right )}}{2} + x \sin ^{3}{\left (x \right )} + \frac {\sin ^{4}{\left (x \right )}}{4} \]

[In]

integrate((1+cos(x))*(x+sin(x))**3,x)

[Out]

x**4/4 + x**3*sin(x) + 3*x**2*sin(x)**2/2 + x*sin(x)**3 + sin(x)**4/4

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.80 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} \, {\left (x + \sin \left (x\right )\right )}^{4} \]

[In]

integrate((1+cos(x))*(x+sin(x))^3,x, algorithm="maxima")

[Out]

1/4*(x + sin(x))^4

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (8) = 16\).

Time = 0.26 (sec) , antiderivative size = 61, normalized size of antiderivative = 6.10 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {1}{4} \, x^{4} + \frac {3}{4} \, x^{2} - \frac {1}{4} \, {\left (3 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) - \frac {1}{4} \, x \sin \left (3 \, x\right ) + \frac {1}{4} \, {\left (4 \, x^{3} - 21 \, x\right )} \sin \left (x\right ) + 6 \, x \sin \left (x\right ) + \frac {1}{32} \, \cos \left (4 \, x\right ) - \frac {3}{8} \, \cos \left (2 \, x\right ) \]

[In]

integrate((1+cos(x))*(x+sin(x))^3,x, algorithm="giac")

[Out]

1/4*x^4 + 3/4*x^2 - 1/4*(3*x^2 - 1)*cos(2*x) - 1/4*x*sin(3*x) + 1/4*(4*x^3 - 21*x)*sin(x) + 6*x*sin(x) + 1/32*
cos(4*x) - 3/8*cos(2*x)

Mupad [B] (verification not implemented)

Time = 26.61 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.80 \[ \int (1+\cos (x)) (x+\sin (x))^3 \, dx=\frac {{\left (x+\sin \left (x\right )\right )}^4}{4} \]

[In]

int((cos(x) + 1)*(x + sin(x))^3,x)

[Out]

(x + sin(x))^4/4