3.666 \(\int \cos (x) (a+b \sin (x))^n \, dx\)

Optimal. Leaf size=19 \[ \frac {(a+b \sin (x))^{n+1}}{b (n+1)} \]

[Out]

(a+b*sin(x))^(1+n)/b/(1+n)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {2668, 32} \[ \frac {(a+b \sin (x))^{n+1}}{b (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]*(a + b*Sin[x])^n,x]

[Out]

(a + b*Sin[x])^(1 + n)/(b*(1 + n))

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \cos (x) (a+b \sin (x))^n \, dx &=\frac {\operatorname {Subst}\left (\int (a+x)^n \, dx,x,b \sin (x)\right )}{b}\\ &=\frac {(a+b \sin (x))^{1+n}}{b (1+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 18, normalized size = 0.95 \[ \frac {(a+b \sin (x))^{n+1}}{b n+b} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]*(a + b*Sin[x])^n,x]

[Out]

(a + b*Sin[x])^(1 + n)/(b + b*n)

________________________________________________________________________________________

fricas [A]  time = 0.57, size = 22, normalized size = 1.16 \[ \frac {{\left (b \sin \relax (x) + a\right )} {\left (b \sin \relax (x) + a\right )}^{n}}{b n + b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(a+b*sin(x))^n,x, algorithm="fricas")

[Out]

(b*sin(x) + a)*(b*sin(x) + a)^n/(b*n + b)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 19, normalized size = 1.00 \[ \frac {{\left (b \sin \relax (x) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(a+b*sin(x))^n,x, algorithm="giac")

[Out]

(b*sin(x) + a)^(n + 1)/(b*(n + 1))

________________________________________________________________________________________

maple [A]  time = 0.03, size = 20, normalized size = 1.05 \[ \frac {\left (a +b \sin \relax (x )\right )^{n +1}}{b \left (n +1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)*(a+b*sin(x))^n,x)

[Out]

(a+b*sin(x))^(n+1)/b/(n+1)

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 19, normalized size = 1.00 \[ \frac {{\left (b \sin \relax (x) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(a+b*sin(x))^n,x, algorithm="maxima")

[Out]

(b*sin(x) + a)^(n + 1)/(b*(n + 1))

________________________________________________________________________________________

mupad [B]  time = 3.13, size = 19, normalized size = 1.00 \[ \frac {{\left (a+b\,\sin \relax (x)\right )}^{n+1}}{b\,\left (n+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)*(a + b*sin(x))^n,x)

[Out]

(a + b*sin(x))^(n + 1)/(b*(n + 1))

________________________________________________________________________________________

sympy [A]  time = 1.88, size = 56, normalized size = 2.95 \[ \begin {cases} \frac {\sin {\relax (x )}}{a} & \text {for}\: b = 0 \wedge n = -1 \\a^{n} \sin {\relax (x )} & \text {for}\: b = 0 \\\frac {\log {\left (\frac {a}{b} + \sin {\relax (x )} \right )}}{b} & \text {for}\: n = -1 \\\frac {a \left (a + b \sin {\relax (x )}\right )^{n}}{b n + b} + \frac {b \left (a + b \sin {\relax (x )}\right )^{n} \sin {\relax (x )}}{b n + b} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(a+b*sin(x))**n,x)

[Out]

Piecewise((sin(x)/a, Eq(b, 0) & Eq(n, -1)), (a**n*sin(x), Eq(b, 0)), (log(a/b + sin(x))/b, Eq(n, -1)), (a*(a +
 b*sin(x))**n/(b*n + b) + b*(a + b*sin(x))**n*sin(x)/(b*n + b), True))

________________________________________________________________________________________