\(\int \cos (x) (a+b \sin (x))^n \, dx\) [666]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (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) (a+b \sin (x))^n \, dx=\frac {(a+b \sin (x))^{1+n}}{b (1+n)} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 19, 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.182, Rules used = {2747, 32} \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {(a+b \sin (x))^{n+1}}{b (n+1)} \]

[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 2747

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*} \text {integral}& = \frac {\text {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] (verified)

Time = 0.02 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {(a+b \sin (x))^{1+n}}{b (1+n)} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.96 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05

method result size
derivativedivides \(\frac {\left (a +b \sin \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(20\)
default \(\frac {\left (a +b \sin \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(20\)
parallelrisch \(\frac {\left (a +b \sin \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(20\)
norman \(\frac {\frac {a \,{\mathrm e}^{n \ln \left (a +\frac {2 b \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )}}{b \left (n +1\right )}+\frac {a \tan \left (\frac {x}{2}\right )^{2} {\mathrm e}^{n \ln \left (a +\frac {2 b \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )}}{b \left (n +1\right )}+\frac {2 \tan \left (\frac {x}{2}\right ) {\mathrm e}^{n \ln \left (a +\frac {2 b \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )}}{n +1}}{1+\tan \left (\frac {x}{2}\right )^{2}}\) \(119\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.16 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {{\left (b \sin \left (x\right ) + a\right )} {\left (b \sin \left (x\right ) + a\right )}^{n}}{b n + b} \]

[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)

Sympy [B] (verification not implemented)

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

Time = 0.50 (sec) , antiderivative size = 56, normalized size of antiderivative = 2.95 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\begin {cases} \frac {\sin {\left (x \right )}}{a} & \text {for}\: b = 0 \wedge n = -1 \\a^{n} \sin {\left (x \right )} & \text {for}\: b = 0 \\\frac {\log {\left (\frac {a}{b} + \sin {\left (x \right )} \right )}}{b} & \text {for}\: n = -1 \\\frac {a \left (a + b \sin {\left (x \right )}\right )^{n}}{b n + b} + \frac {b \left (a + b \sin {\left (x \right )}\right )^{n} \sin {\left (x \right )}}{b n + b} & \text {otherwise} \end {cases} \]

[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))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {{\left (b \sin \left (x\right ) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {{\left (b \sin \left (x\right ) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 26.72 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \cos (x) (a+b \sin (x))^n \, dx=\frac {{\left (a+b\,\sin \left (x\right )\right )}^{n+1}}{b\,\left (n+1\right )} \]

[In]

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

[Out]

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