Integrand size = 31, antiderivative size = 28 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\frac {B (a+a \cos (c+d x))^n \sin (c+d x)}{d (1+n)} \] Output:
B*(a+a*cos(d*x+c))^n*sin(d*x+c)/d/(1+n)
Time = 0.87 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\frac {B (a (1+\cos (c+d x)))^n \sin (c+d x)}{d (1+n)} \] Input:
Integrate[(a + a*Cos[c + d*x])^n*(-((B*n)/(1 + n)) + B*Cos[c + d*x]),x]
Output:
(B*(a*(1 + Cos[c + d*x]))^n*Sin[c + d*x])/(d*(1 + n))
Time = 0.23 (sec) , antiderivative size = 28, 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.065, Rules used = {3042, 3228}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \cos (c+d x)+a)^n \left (B \cos (c+d x)-\frac {B n}{n+1}\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )^n \left (B \sin \left (c+d x+\frac {\pi }{2}\right )-\frac {B n}{n+1}\right )dx\) |
\(\Big \downarrow \) 3228 |
\(\displaystyle \frac {B \sin (c+d x) (a \cos (c+d x)+a)^n}{d (n+1)}\) |
Input:
Int[(a + a*Cos[c + d*x])^n*(-((B*n)/(1 + n)) + B*Cos[c + d*x]),x]
Output:
(B*(a + a*Cos[c + d*x])^n*Sin[c + d*x])/(d*(1 + n))
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + ( f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f *(m + 1))), x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && E qQ[a^2 - b^2, 0] && EqQ[a*d*m + b*c*(m + 1), 0]
Time = 13.17 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04
method | result | size |
parallelrisch | \(\frac {B \left (a \left (\cos \left (d x +c \right )+1\right )\right )^{n} \sin \left (d x +c \right )}{d \left (1+n \right )}\) | \(29\) |
norman | \(\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) {\mathrm e}^{n \ln \left (a +\frac {a \left (1-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\right )}}{\left (1+n \right ) d \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}\) | \(74\) |
risch | \(\frac {B \left ({\mathrm e}^{i \left (d x +c \right )}\right )^{-n} \left (\sin \left (c \right ) \cos \left (d x \right )+\cos \left (c \right ) \sin \left (d x \right )\right ) \left (\frac {1}{2}\right )^{n} a^{n} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{2 n} {\mathrm e}^{-\frac {i \pi n \left (-\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{-i \left (d x +c \right )}\right )+\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right ) \operatorname {csgn}\left (i {\mathrm e}^{-i \left (d x +c \right )}\right ) \operatorname {csgn}\left (i \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )}+1\right )\right )+\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right )^{3}-\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right )^{2} \operatorname {csgn}\left (i \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )}+1\right )\right )+\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right ) \operatorname {csgn}\left (i a \left (\cos \left (d x +c \right )+1\right )\right ) \operatorname {csgn}\left (i a \right )-\operatorname {csgn}\left (i \left (\cos \left (d x +c \right )+1\right )\right ) \operatorname {csgn}\left (i a \left (\cos \left (d x +c \right )+1\right )\right )^{2}-\operatorname {csgn}\left (i a \left (\cos \left (d x +c \right )+1\right )\right )^{2} \operatorname {csgn}\left (i a \right )+\operatorname {csgn}\left (i a \left (\cos \left (d x +c \right )+1\right )\right )^{3}+\operatorname {csgn}\left (i \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )}+1\right )\right ) {\operatorname {csgn}\left (i \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )\right )}^{2}-2 {\operatorname {csgn}\left (i \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )}+1\right )\right )}^{2} \operatorname {csgn}\left (i \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )\right )+{\operatorname {csgn}\left (i \left ({\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )}+1\right )\right )}^{3}\right )}{2}}}{\left (1+n \right ) d}\) | \(418\) |
Input:
int((a+a*cos(d*x+c))^n*(-B*n/(1+n)+B*cos(d*x+c)),x,method=_RETURNVERBOSE)
Output:
B/d/(1+n)*(a*(cos(d*x+c)+1))^n*sin(d*x+c)
Time = 0.08 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.96 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\frac {{\left (a \cos \left (d x + c\right ) + a\right )}^{n} B \sin \left (d x + c\right )}{d n + d} \] Input:
integrate((a+a*cos(d*x+c))^n*(-B*n/(1+n)+B*cos(d*x+c)),x, algorithm="frica s")
Output:
(a*cos(d*x + c) + a)^n*B*sin(d*x + c)/(d*n + d)
Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (24) = 48\).
Time = 1.83 (sec) , antiderivative size = 114, normalized size of antiderivative = 4.07 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\begin {cases} \frac {2 B \left (a - \frac {a \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1} + \frac {a}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1}\right )^{n} \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d n \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d n + d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + a\right )^{n} \left (- \frac {B n}{n + 1} + B \cos {\left (c \right )}\right ) & \text {otherwise} \end {cases} \] Input:
integrate((a+a*cos(d*x+c))**n*(-B*n/(1+n)+B*cos(d*x+c)),x)
Output:
Piecewise((2*B*(a - a*tan(c/2 + d*x/2)**2/(tan(c/2 + d*x/2)**2 + 1) + a/(t an(c/2 + d*x/2)**2 + 1))**n*tan(c/2 + d*x/2)/(d*n*tan(c/2 + d*x/2)**2 + d* n + d*tan(c/2 + d*x/2)**2 + d), Ne(d, 0)), (x*(a*cos(c) + a)**n*(-B*n/(n + 1) + B*cos(c)), True))
Leaf count of result is larger than twice the leaf count of optimal. 143 vs. \(2 (28) = 56\).
Time = 0.25 (sec) , antiderivative size = 143, normalized size of antiderivative = 5.11 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=-\frac {{\left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )}^{n} B a^{n} \sin \left (-{\left (d x + c\right )} {\left (n + 1\right )} + 2 \, n \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right ) + 1\right )\right ) - {\left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )}^{n} B a^{n} \sin \left (-{\left (d x + c\right )} {\left (n - 1\right )} + 2 \, n \arctan \left (\sin \left (d x + c\right ), \cos \left (d x + c\right ) + 1\right )\right )}{2 \cdot 2^{n} d {\left (n + 1\right )}} \] Input:
integrate((a+a*cos(d*x+c))^n*(-B*n/(1+n)+B*cos(d*x+c)),x, algorithm="maxim a")
Output:
-1/2*((cos(d*x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) + 1)^n*B*a^n*sin(- (d*x + c)*(n + 1) + 2*n*arctan2(sin(d*x + c), cos(d*x + c) + 1)) - (cos(d* x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) + 1)^n*B*a^n*sin(-(d*x + c)*(n - 1) + 2*n*arctan2(sin(d*x + c), cos(d*x + c) + 1)))/(2^n*d*(n + 1))
Leaf count of result is larger than twice the leaf count of optimal. 795 vs. \(2 (28) = 56\).
Time = 1.90 (sec) , antiderivative size = 795, normalized size of antiderivative = 28.39 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\text {Too large to display} \] Input:
integrate((a+a*cos(d*x+c))^n*(-B*n/(1+n)+B*cos(d*x+c)),x, algorithm="giac" )
Output:
-2*(B*(sqrt(-tan(d*x + c)^4*tan(1/2*d*x + 1/2*c)^4 + 2*tan(d*x + c)^4*tan( 1/2*d*x + 1/2*c)^2 - tan(d*x + c)^2*tan(1/2*d*x + 1/2*c)^4 + 3*tan(d*x + c )^4 + 6*tan(d*x + c)^2*tan(1/2*d*x + 1/2*c)^2 + 7*tan(d*x + c)^2 + 4*tan(1 /2*d*x + 1/2*c)^2 + 4)*abs(a)/(tan(d*x + c)^2*tan(1/2*d*x + 1/2*c)^2 + tan (d*x + c)^2 + tan(1/2*d*x + 1/2*c)^2 + 1))^n*tan(-1/4*pi*n*sgn(4*a*tan(1/2 *d*x + 1/2*c)^2 - 4*a)*sgn(a)*sgn(tan(1/2*d*x + 1/2*c)) - 1/4*pi*n*sgn(a)* sgn(tan(1/2*d*x + 1/2*c)) + 1/2*pi*n*floor(d*x/pi + c/pi + 1/2))^2*tan(1/2 *d*x + 1/2*c) - B*(sqrt(-tan(d*x + c)^4*tan(1/2*d*x + 1/2*c)^4 + 2*tan(d*x + c)^4*tan(1/2*d*x + 1/2*c)^2 - tan(d*x + c)^2*tan(1/2*d*x + 1/2*c)^4 + 3 *tan(d*x + c)^4 + 6*tan(d*x + c)^2*tan(1/2*d*x + 1/2*c)^2 + 7*tan(d*x + c) ^2 + 4*tan(1/2*d*x + 1/2*c)^2 + 4)*abs(a)/(tan(d*x + c)^2*tan(1/2*d*x + 1/ 2*c)^2 + tan(d*x + c)^2 + tan(1/2*d*x + 1/2*c)^2 + 1))^n*tan(1/2*d*x + 1/2 *c))/(d*n*tan(-1/4*pi*n*sgn(4*a*tan(1/2*d*x + 1/2*c)^2 - 4*a)*sgn(a)*sgn(t an(1/2*d*x + 1/2*c)) - 1/4*pi*n*sgn(a)*sgn(tan(1/2*d*x + 1/2*c)) + 1/2*pi* n*floor(d*x/pi + c/pi + 1/2))^2*tan(1/2*d*x + 1/2*c)^2 + d*tan(-1/4*pi*n*s gn(4*a*tan(1/2*d*x + 1/2*c)^2 - 4*a)*sgn(a)*sgn(tan(1/2*d*x + 1/2*c)) - 1/ 4*pi*n*sgn(a)*sgn(tan(1/2*d*x + 1/2*c)) + 1/2*pi*n*floor(d*x/pi + c/pi + 1 /2))^2*tan(1/2*d*x + 1/2*c)^2 + d*n*tan(-1/4*pi*n*sgn(4*a*tan(1/2*d*x + 1/ 2*c)^2 - 4*a)*sgn(a)*sgn(tan(1/2*d*x + 1/2*c)) - 1/4*pi*n*sgn(a)*sgn(tan(1 /2*d*x + 1/2*c)) + 1/2*pi*n*floor(d*x/pi + c/pi + 1/2))^2 + d*n*tan(1/2...
Time = 42.66 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00 \[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\frac {B\,\sin \left (c+d\,x\right )\,{\left (a\,\left (\cos \left (c+d\,x\right )+1\right )\right )}^n}{d\,\left (n+1\right )} \] Input:
int((B*cos(c + d*x) - (B*n)/(n + 1))*(a + a*cos(c + d*x))^n,x)
Output:
(B*sin(c + d*x)*(a*(cos(c + d*x) + 1))^n)/(d*(n + 1))
\[ \int (a+a \cos (c+d x))^n \left (-\frac {B n}{1+n}+B \cos (c+d x)\right ) \, dx=\frac {b \left (-\left (\int \left (\cos \left (d x +c \right ) a +a \right )^{n}d x \right ) n +\left (\int \left (\cos \left (d x +c \right ) a +a \right )^{n} \cos \left (d x +c \right )d x \right ) n +\int \left (\cos \left (d x +c \right ) a +a \right )^{n} \cos \left (d x +c \right )d x \right )}{n +1} \] Input:
int((a+a*cos(d*x+c))^n*(-B*n/(1+n)+B*cos(d*x+c)),x)
Output:
(b*( - int((cos(c + d*x)*a + a)**n,x)*n + int((cos(c + d*x)*a + a)**n*cos( c + d*x),x)*n + int((cos(c + d*x)*a + a)**n*cos(c + d*x),x)))/(n + 1)