3.6 \(\int \cos ^2(c+d x) (a+a \sin (c+d x)) \, dx\)

Optimal. Leaf size=43 \[ -\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2} \]

[Out]

1/2*a*x-1/3*a*cos(d*x+c)^3/d+1/2*a*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {2669, 2635, 8} \[ -\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

(a*x)/2 - (a*Cos[c + d*x]^3)/(3*d) + (a*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 2669

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b*(g*Cos[
e + f*x])^(p + 1))/(f*g*(p + 1)), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x]
&& (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rubi steps

\begin {align*} \int \cos ^2(c+d x) (a+a \sin (c+d x)) \, dx &=-\frac {a \cos ^3(c+d x)}{3 d}+a \int \cos ^2(c+d x) \, dx\\ &=-\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} a \int 1 \, dx\\ &=\frac {a x}{2}-\frac {a \cos ^3(c+d x)}{3 d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 46, normalized size = 1.07 \[ \frac {a (c+d x)}{2 d}+\frac {a \sin (2 (c+d x))}{4 d}-\frac {a \cos ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

(a*(c + d*x))/(2*d) - (a*Cos[c + d*x]^3)/(3*d) + (a*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

fricas [A]  time = 0.56, size = 37, normalized size = 0.86 \[ -\frac {2 \, a \cos \left (d x + c\right )^{3} - 3 \, a d x - 3 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/6*(2*a*cos(d*x + c)^3 - 3*a*d*x - 3*a*cos(d*x + c)*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.80, size = 47, normalized size = 1.09 \[ \frac {1}{2} \, a x - \frac {a \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {a \cos \left (d x + c\right )}{4 \, d} + \frac {a \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/2*a*x - 1/12*a*cos(3*d*x + 3*c)/d - 1/4*a*cos(d*x + c)/d + 1/4*a*sin(2*d*x + 2*c)/d

________________________________________________________________________________________

maple [A]  time = 0.08, size = 41, normalized size = 0.95 \[ \frac {-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) a}{3}+a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+a*sin(d*x+c)),x)

[Out]

1/d*(-1/3*cos(d*x+c)^3*a+a*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 37, normalized size = 0.86 \[ -\frac {4 \, a \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/12*(4*a*cos(d*x + c)^3 - 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*a)/d

________________________________________________________________________________________

mupad [B]  time = 6.76, size = 103, normalized size = 2.40 \[ \frac {a\,x}{2}+\frac {-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {a\,\left (9\,c+9\,d\,x-12\right )}{6}-\frac {3\,a\,\left (c+d\,x\right )}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a\,\left (3\,c+3\,d\,x-4\right )}{6}-\frac {a\,\left (c+d\,x\right )}{2}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(a + a*sin(c + d*x)),x)

[Out]

(a*x)/2 + ((a*(3*c + 3*d*x - 4))/6 + a*tan(c/2 + (d*x)/2) - (a*(c + d*x))/2 + tan(c/2 + (d*x)/2)^4*((a*(9*c +
9*d*x - 12))/6 - (3*a*(c + d*x))/2) - a*tan(c/2 + (d*x)/2)^5)/(d*(tan(c/2 + (d*x)/2)^2 + 1)^3)

________________________________________________________________________________________

sympy [A]  time = 0.53, size = 71, normalized size = 1.65 \[ \begin {cases} \frac {a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} - \frac {a \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\relax (c )} + a\right ) \cos ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+a*sin(d*x+c)),x)

[Out]

Piecewise((a*x*sin(c + d*x)**2/2 + a*x*cos(c + d*x)**2/2 + a*sin(c + d*x)*cos(c + d*x)/(2*d) - a*cos(c + d*x)*
*3/(3*d), Ne(d, 0)), (x*(a*sin(c) + a)*cos(c)**2, True))

________________________________________________________________________________________