\(\int \cos (x) (1+\sin ^2(x))^2 \, dx\) [87]

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

Optimal result

Integrand size = 11, antiderivative size = 19 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\sin (x)+\frac {2 \sin ^3(x)}{3}+\frac {\sin ^5(x)}{5} \]

[Out]

sin(x)+2/3*sin(x)^3+1/5*sin(x)^5

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3269, 200} \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {\sin ^5(x)}{5}+\frac {2 \sin ^3(x)}{3}+\sin (x) \]

[In]

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

[Out]

Sin[x] + (2*Sin[x]^3)/3 + Sin[x]^5/5

Rule 200

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n)^p, x], x] /; FreeQ[{a, b}, x]
&& IGtQ[n, 0] && IGtQ[p, 0]

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \left (1+x^2\right )^2 \, dx,x,\sin (x)\right ) \\ & = \text {Subst}\left (\int \left (1+2 x^2+x^4\right ) \, dx,x,\sin (x)\right ) \\ & = \sin (x)+\frac {2 \sin ^3(x)}{3}+\frac {\sin ^5(x)}{5} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\sin (x)+\frac {2 \sin ^3(x)}{3}+\frac {\sin ^5(x)}{5} \]

[In]

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

[Out]

Sin[x] + (2*Sin[x]^3)/3 + Sin[x]^5/5

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\sin \left (x \right )+\frac {2 \left (\sin ^{3}\left (x \right )\right )}{3}+\frac {\left (\sin ^{5}\left (x \right )\right )}{5}\) \(16\)
default \(\sin \left (x \right )+\frac {2 \left (\sin ^{3}\left (x \right )\right )}{3}+\frac {\left (\sin ^{5}\left (x \right )\right )}{5}\) \(16\)
risch \(\frac {13 \sin \left (x \right )}{8}+\frac {\sin \left (5 x \right )}{80}-\frac {11 \sin \left (3 x \right )}{48}\) \(18\)
parallelrisch \(\frac {13 \sin \left (x \right )}{8}+\frac {\sin \left (5 x \right )}{80}-\frac {11 \sin \left (3 x \right )}{48}\) \(18\)

[In]

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

[Out]

sin(x)+2/3*sin(x)^3+1/5*sin(x)^5

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.95 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {1}{15} \, {\left (3 \, \cos \left (x\right )^{4} - 16 \, \cos \left (x\right )^{2} + 28\right )} \sin \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {\sin ^{5}{\left (x \right )}}{5} + \frac {2 \sin ^{3}{\left (x \right )}}{3} + \sin {\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {1}{5} \, \sin \left (x\right )^{5} + \frac {2}{3} \, \sin \left (x\right )^{3} + \sin \left (x\right ) \]

[In]

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

[Out]

1/5*sin(x)^5 + 2/3*sin(x)^3 + sin(x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {1}{5} \, \sin \left (x\right )^{5} + \frac {2}{3} \, \sin \left (x\right )^{3} + \sin \left (x\right ) \]

[In]

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

[Out]

1/5*sin(x)^5 + 2/3*sin(x)^3 + sin(x)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79 \[ \int \cos (x) \left (1+\sin ^2(x)\right )^2 \, dx=\frac {{\sin \left (x\right )}^5}{5}+\frac {2\,{\sin \left (x\right )}^3}{3}+\sin \left (x\right ) \]

[In]

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

[Out]

sin(x) + (2*sin(x)^3)/3 + sin(x)^5/5