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

   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 = 20 \[ \int (a+b \cos (x))^n \sin (x) \, dx=-\frac {(a+b \cos (x))^{1+n}}{b (1+n)} \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 20, 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 (a+b \cos (x))^n \sin (x) \, dx=-\frac {(a+b \cos (x))^{n+1}}{b (n+1)} \]

[In]

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

[Out]

-((a + b*Cos[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 \cos (x)\right )}{b} \\ & = -\frac {(a+b \cos (x))^{1+n}}{b (1+n)} \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 2.42 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05

method result size
derivativedivides \(-\frac {\left (a +b \cos \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(21\)
default \(-\frac {\left (a +b \cos \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(21\)
parallelrisch \(-\frac {\left (a +b \cos \left (x \right )\right )^{n +1}}{b \left (n +1\right )}\) \(21\)
norman \(\frac {-\frac {\left (a +b \right ) {\mathrm e}^{n \ln \left (a +\frac {b \left (1-\tan \left (\frac {x}{2}\right )^{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )}}{\left (n +1\right ) b}-\frac {\left (a -b \right ) \tan \left (\frac {x}{2}\right )^{2} {\mathrm e}^{n \ln \left (a +\frac {b \left (1-\tan \left (\frac {x}{2}\right )^{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}\right )}}{\left (n +1\right ) b}}{1+\tan \left (\frac {x}{2}\right )^{2}}\) \(103\)
risch \(-\frac {\left (a \,{\mathrm e}^{i x}+\frac {b \,{\mathrm e}^{2 i x}}{2}+\frac {b}{2}\right )^{n} \left (b \,{\mathrm e}^{\frac {i \left (\pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{2} n \,\operatorname {csgn}\left (i {\mathrm e}^{-i x}\right )-\pi \,\operatorname {csgn}\left (i a +i b \cos \left (x \right )\right ) n \,\operatorname {csgn}\left (\frac {i b \,{\mathrm e}^{2 i x}}{2}+i a \,{\mathrm e}^{i x}+\frac {i b}{2}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right )-n \pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{3}+\pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{2} n \,\operatorname {csgn}\left (\frac {i b \,{\mathrm e}^{2 i x}}{2}+i a \,{\mathrm e}^{i x}+\frac {i b}{2}\right )+2 x \right )}{2}}+b \,{\mathrm e}^{\frac {i \left (\pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{2} n \,\operatorname {csgn}\left (i {\mathrm e}^{-i x}\right )-\pi \,\operatorname {csgn}\left (i a +i b \cos \left (x \right )\right ) n \,\operatorname {csgn}\left (\frac {i b \,{\mathrm e}^{2 i x}}{2}+i a \,{\mathrm e}^{i x}+\frac {i b}{2}\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i x}\right )-n \pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{3}+\pi \operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )^{2} n \,\operatorname {csgn}\left (\frac {i b \,{\mathrm e}^{2 i x}}{2}+i a \,{\mathrm e}^{i x}+\frac {i b}{2}\right )-2 x \right )}{2}}+2 \,{\mathrm e}^{-\frac {i \pi n \,\operatorname {csgn}\left (i a +i b \cos \left (x \right )\right ) \left (\operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )-\operatorname {csgn}\left (\frac {i b \,{\mathrm e}^{2 i x}}{2}+i a \,{\mathrm e}^{i x}+\frac {i b}{2}\right )\right ) \left (\operatorname {csgn}\left (i a +i b \cos \left (x \right )\right )-\operatorname {csgn}\left (i {\mathrm e}^{-i x}\right )\right )}{2}} a \right ) \left ({\mathrm e}^{i x}\right )^{-n}}{2 b \left (n +1\right )}\) \(414\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (15) = 30\).

Time = 0.52 (sec) , antiderivative size = 63, normalized size of antiderivative = 3.15 \[ \int (a+b \cos (x))^n \sin (x) \, dx=\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} \]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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