Integrand size = 29, antiderivative size = 59 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {(c-d) (a+a \sin (e+f x))^{1+m}}{a f (1+m)}+\frac {d (a+a \sin (e+f x))^{2+m}}{a^2 f (2+m)} \] Output:
(c-d)*(a+a*sin(f*x+e))^(1+m)/a/f/(1+m)+d*(a+a*sin(f*x+e))^(2+m)/a^2/f/(2+m )
Time = 0.14 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.86 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {(a (1+\sin (e+f x)))^{1+m} (-d+c (2+m)+d (1+m) \sin (e+f x))}{a f (1+m) (2+m)} \] Input:
Integrate[Cos[e + f*x]*(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x]),x]
Output:
((a*(1 + Sin[e + f*x]))^(1 + m)*(-d + c*(2 + m) + d*(1 + m)*Sin[e + f*x])) /(a*f*(1 + m)*(2 + m))
Time = 0.29 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.93, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {3042, 3312, 27, 53, 2009}
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 \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a)^m (c+d \sin (e+f x))dx\) |
\(\Big \downarrow \) 3312 |
\(\displaystyle \frac {\int \frac {(\sin (e+f x) a+a)^m (a c+a d \sin (e+f x))}{a}d(a \sin (e+f x))}{a f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int (\sin (e+f x) a+a)^m (a c+a d \sin (e+f x))d(a \sin (e+f x))}{a^2 f}\) |
\(\Big \downarrow \) 53 |
\(\displaystyle \frac {\int \left (a (c-d) (\sin (e+f x) a+a)^m+d (\sin (e+f x) a+a)^{m+1}\right )d(a \sin (e+f x))}{a^2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {a (c-d) (a \sin (e+f x)+a)^{m+1}}{m+1}+\frac {d (a \sin (e+f x)+a)^{m+2}}{m+2}}{a^2 f}\) |
Input:
Int[Cos[e + f*x]*(a + a*Sin[e + f*x])^m*(c + d*Sin[e + f*x]),x]
Output:
((a*(c - d)*(a + a*Sin[e + f*x])^(1 + m))/(1 + m) + (d*(a + a*Sin[e + f*x] )^(2 + m))/(2 + m))/(a^2*f)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0] && LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])
Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*(( c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b*f) Su bst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x]
Time = 1.52 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.22
method | result | size |
parallelrisch | \(\frac {\left (-\frac {\left (1+m \right ) d \cos \left (2 f x +2 e \right )}{2}+\left (\left (c +d \right ) m +2 c \right ) \sin \left (f x +e \right )+\left (c +\frac {d}{2}\right ) m +2 c -\frac {d}{2}\right ) \left (a \left (1+\sin \left (f x +e \right )\right )\right )^{m}}{f \left (m^{2}+3 m +2\right )}\) | \(72\) |
derivativedivides | \(\frac {\left (c m +2 c -d \right ) {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (m^{2}+3 m +2\right )}+\frac {d \sin \left (f x +e \right )^{2} {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (2+m \right )}+\frac {\left (c m +d m +2 c \right ) \sin \left (f x +e \right ) {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (m^{2}+3 m +2\right )}\) | \(116\) |
default | \(\frac {\left (c m +2 c -d \right ) {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (m^{2}+3 m +2\right )}+\frac {d \sin \left (f x +e \right )^{2} {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (2+m \right )}+\frac {\left (c m +d m +2 c \right ) \sin \left (f x +e \right ) {\mathrm e}^{m \ln \left (a +a \sin \left (f x +e \right )\right )}}{f \left (m^{2}+3 m +2\right )}\) | \(116\) |
Input:
int(cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e)),x,method=_RETURNVERBOSE )
Output:
(-1/2*(1+m)*d*cos(2*f*x+2*e)+((c+d)*m+2*c)*sin(f*x+e)+(c+1/2*d)*m+2*c-1/2* d)*(a*(1+sin(f*x+e)))^m/f/(m^2+3*m+2)
Time = 0.09 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.19 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=-\frac {{\left ({\left (d m + d\right )} \cos \left (f x + e\right )^{2} - {\left (c + d\right )} m - {\left ({\left (c + d\right )} m + 2 \, c\right )} \sin \left (f x + e\right ) - 2 \, c\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{m}}{f m^{2} + 3 \, f m + 2 \, f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e)),x, algorithm="fri cas")
Output:
-((d*m + d)*cos(f*x + e)^2 - (c + d)*m - ((c + d)*m + 2*c)*sin(f*x + e) - 2*c)*(a*sin(f*x + e) + a)^m/(f*m^2 + 3*f*m + 2*f)
Leaf count of result is larger than twice the leaf count of optimal. 428 vs. \(2 (46) = 92\).
Time = 1.15 (sec) , antiderivative size = 428, normalized size of antiderivative = 7.25 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\begin {cases} x \left (c + d \sin {\left (e \right )}\right ) \left (a \sin {\left (e \right )} + a\right )^{m} \cos {\left (e \right )} & \text {for}\: f = 0 \\- \frac {c}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {d \log {\left (\sin {\left (e + f x \right )} + 1 \right )} \sin {\left (e + f x \right )}}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {d \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} + \frac {d}{a^{2} f \sin {\left (e + f x \right )} + a^{2} f} & \text {for}\: m = -2 \\\frac {c \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a f} - \frac {d \log {\left (\sin {\left (e + f x \right )} + 1 \right )}}{a f} + \frac {d \sin {\left (e + f x \right )}}{a f} & \text {for}\: m = -1 \\\frac {c m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {c m \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac {2 c \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {2 c \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} + \frac {d m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {d m \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin {\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} + \frac {d \left (a \sin {\left (e + f x \right )} + a\right )^{m} \sin ^{2}{\left (e + f x \right )}}{f m^{2} + 3 f m + 2 f} - \frac {d \left (a \sin {\left (e + f x \right )} + a\right )^{m}}{f m^{2} + 3 f m + 2 f} & \text {otherwise} \end {cases} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))**m*(c+d*sin(f*x+e)),x)
Output:
Piecewise((x*(c + d*sin(e))*(a*sin(e) + a)**m*cos(e), Eq(f, 0)), (-c/(a**2 *f*sin(e + f*x) + a**2*f) + d*log(sin(e + f*x) + 1)*sin(e + f*x)/(a**2*f*s in(e + f*x) + a**2*f) + d*log(sin(e + f*x) + 1)/(a**2*f*sin(e + f*x) + a** 2*f) + d/(a**2*f*sin(e + f*x) + a**2*f), Eq(m, -2)), (c*log(sin(e + f*x) + 1)/(a*f) - d*log(sin(e + f*x) + 1)/(a*f) + d*sin(e + f*x)/(a*f), Eq(m, -1 )), (c*m*(a*sin(e + f*x) + a)**m*sin(e + f*x)/(f*m**2 + 3*f*m + 2*f) + c*m *(a*sin(e + f*x) + a)**m/(f*m**2 + 3*f*m + 2*f) + 2*c*(a*sin(e + f*x) + a) **m*sin(e + f*x)/(f*m**2 + 3*f*m + 2*f) + 2*c*(a*sin(e + f*x) + a)**m/(f*m **2 + 3*f*m + 2*f) + d*m*(a*sin(e + f*x) + a)**m*sin(e + f*x)**2/(f*m**2 + 3*f*m + 2*f) + d*m*(a*sin(e + f*x) + a)**m*sin(e + f*x)/(f*m**2 + 3*f*m + 2*f) + d*(a*sin(e + f*x) + a)**m*sin(e + f*x)**2/(f*m**2 + 3*f*m + 2*f) - d*(a*sin(e + f*x) + a)**m/(f*m**2 + 3*f*m + 2*f), True))
Time = 0.03 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.41 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {\frac {{\left (a^{m} {\left (m + 1\right )} \sin \left (f x + e\right )^{2} + a^{m} m \sin \left (f x + e\right ) - a^{m}\right )} d {\left (\sin \left (f x + e\right ) + 1\right )}^{m}}{m^{2} + 3 \, m + 2} + \frac {{\left (a \sin \left (f x + e\right ) + a\right )}^{m + 1} c}{a {\left (m + 1\right )}}}{f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e)),x, algorithm="max ima")
Output:
((a^m*(m + 1)*sin(f*x + e)^2 + a^m*m*sin(f*x + e) - a^m)*d*(sin(f*x + e) + 1)^m/(m^2 + 3*m + 2) + (a*sin(f*x + e) + a)^(m + 1)*c/(a*(m + 1)))/f
Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (59) = 118\).
Time = 0.14 (sec) , antiderivative size = 119, normalized size of antiderivative = 2.02 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {\frac {{\left ({\left (a \sin \left (f x + e\right ) + a\right )}^{m} m \sin \left (f x + e\right )^{2} + {\left (a \sin \left (f x + e\right ) + a\right )}^{m} m \sin \left (f x + e\right ) + {\left (a \sin \left (f x + e\right ) + a\right )}^{m} \sin \left (f x + e\right )^{2} - {\left (a \sin \left (f x + e\right ) + a\right )}^{m}\right )} d}{m^{2} + 3 \, m + 2} + \frac {{\left (a \sin \left (f x + e\right ) + a\right )}^{m + 1} c}{a {\left (m + 1\right )}}}{f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e)),x, algorithm="gia c")
Output:
(((a*sin(f*x + e) + a)^m*m*sin(f*x + e)^2 + (a*sin(f*x + e) + a)^m*m*sin(f *x + e) + (a*sin(f*x + e) + a)^m*sin(f*x + e)^2 - (a*sin(f*x + e) + a)^m)* d/(m^2 + 3*m + 2) + (a*sin(f*x + e) + a)^(m + 1)*c/(a*(m + 1)))/f
Time = 33.02 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.68 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {{\left (a\,\left (\sin \left (e+f\,x\right )+1\right )\right )}^m\,\left (4\,c-d+2\,c\,m+d\,m+4\,c\,\sin \left (e+f\,x\right )+d\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )+2\,c\,m\,\sin \left (e+f\,x\right )+2\,d\,m\,\sin \left (e+f\,x\right )+d\,m\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )\right )}{2\,f\,\left (m^2+3\,m+2\right )} \] Input:
int(cos(e + f*x)*(a + a*sin(e + f*x))^m*(c + d*sin(e + f*x)),x)
Output:
((a*(sin(e + f*x) + 1))^m*(4*c - d + 2*c*m + d*m + 4*c*sin(e + f*x) + d*(2 *sin(e + f*x)^2 - 1) + 2*c*m*sin(e + f*x) + 2*d*m*sin(e + f*x) + d*m*(2*si n(e + f*x)^2 - 1)))/(2*f*(3*m + m^2 + 2))
Time = 0.17 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.42 \[ \int \cos (e+f x) (a+a \sin (e+f x))^m (c+d \sin (e+f x)) \, dx=\frac {\left (a +a \sin \left (f x +e \right )\right )^{m} \left (\sin \left (f x +e \right )^{2} d m +\sin \left (f x +e \right )^{2} d +\sin \left (f x +e \right ) c m +2 \sin \left (f x +e \right ) c +\sin \left (f x +e \right ) d m +c m +2 c -d \right )}{f \left (m^{2}+3 m +2\right )} \] Input:
int(cos(f*x+e)*(a+a*sin(f*x+e))^m*(c+d*sin(f*x+e)),x)
Output:
((sin(e + f*x)*a + a)**m*(sin(e + f*x)**2*d*m + sin(e + f*x)**2*d + sin(e + f*x)*c*m + 2*sin(e + f*x)*c + sin(e + f*x)*d*m + c*m + 2*c - d))/(f*(m** 2 + 3*m + 2))