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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0245843, antiderivative size = 20, normalized size of antiderivative = 1., 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 \cos (x))^{n+1}}{b (n+1)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]

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]

Rubi steps

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

Mathematica [A]  time = 0.0322533, size = 19, normalized size = 0.95 \[ -\frac{(a+b \cos (x))^{n+1}}{b n+b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 21, normalized size = 1.1 \begin{align*} -{\frac{ \left ( a+b\cos \left ( x \right ) \right ) ^{1+n}}{b \left ( 1+n \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(a+b*cos(x))^(1+n)/b/(1+n)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.07964, size = 59, normalized size = 2.95 \begin{align*} -\frac{{\left (b \cos \left (x\right ) + a\right )}{\left (b \cos \left (x\right ) + a\right )}^{n}}{b n + b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(b*cos(x) + a)*(b*cos(x) + a)^n/(b*n + b)

________________________________________________________________________________________

Sympy [A]  time = 2.5132, size = 63, normalized size = 3.15 \begin{align*} \begin{cases} - \frac{\cos{\left (x \right )}}{a} & \text{for}\: b = 0 \wedge n = -1 \\- a^{n} \cos{\left (x \right )} & \text{for}\: b = 0 \\- \frac{\log{\left (\frac{a}{b} + \cos{\left (x \right )} \right )}}{b} & \text{for}\: n = -1 \\- \frac{a \left (a + b \cos{\left (x \right )}\right )^{n}}{b n + b} - \frac{b \left (a + b \cos{\left (x \right )}\right )^{n} \cos{\left (x \right )}}{b n + b} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.10384, size = 27, normalized size = 1.35 \begin{align*} -\frac{{\left (b \cos \left (x\right ) + a\right )}^{n + 1}}{b{\left (n + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(b*cos(x) + a)^(n + 1)/(b*(n + 1))