Integrand size = 29, antiderivative size = 61 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=-\frac {a (c-d) (c+d \sin (e+f x))^{1+n}}{d^2 f (1+n)}+\frac {a (c+d \sin (e+f x))^{2+n}}{d^2 f (2+n)} \] Output:
-a*(c-d)*(c+d*sin(f*x+e))^(1+n)/d^2/f/(1+n)+a*(c+d*sin(f*x+e))^(2+n)/d^2/f /(2+n)
Time = 0.76 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.85 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\frac {a (c+d \sin (e+f x))^{1+n} (-c+d (2+n)+d (1+n) \sin (e+f x))}{d^2 f (1+n) (2+n)} \] Input:
Integrate[Cos[e + f*x]*(a + a*Sin[e + f*x])*(c + d*Sin[e + f*x])^n,x]
Output:
(a*(c + d*Sin[e + f*x])^(1 + n)*(-c + d*(2 + n) + d*(1 + n)*Sin[e + f*x])) /(d^2*f*(1 + n)*(2 + n))
Time = 0.30 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3042, 3312, 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) (c+d \sin (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a) (c+d \sin (e+f x))^ndx\) |
\(\Big \downarrow \) 3312 |
\(\displaystyle \frac {\int (\sin (e+f x) a+a) (c+d \sin (e+f x))^nd(a \sin (e+f x))}{a f}\) |
\(\Big \downarrow \) 53 |
\(\displaystyle \frac {\int \left (\frac {a (c+d \sin (e+f x))^{n+1}}{d}-\frac {a (c-d) (c+d \sin (e+f x))^n}{d}\right )d(a \sin (e+f x))}{a f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {a^2 (c+d \sin (e+f x))^{n+2}}{d^2 (n+2)}-\frac {a^2 (c-d) (c+d \sin (e+f x))^{n+1}}{d^2 (n+1)}}{a f}\) |
Input:
Int[Cos[e + f*x]*(a + a*Sin[e + f*x])*(c + d*Sin[e + f*x])^n,x]
Output:
(-((a^2*(c - d)*(c + d*Sin[e + f*x])^(1 + n))/(d^2*(1 + n))) + (a^2*(c + d *Sin[e + f*x])^(2 + n))/(d^2*(2 + n)))/(a*f)
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 = 0.81 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.90
method | result | size |
parallelrisch | \(-\frac {\left (-d \sin \left (f x +e \right ) \left (1+n \right )+\left (-n -2\right ) d +c \right ) \left (c +d \sin \left (f x +e \right )\right )^{1+n} a}{d^{2} f \left (n^{2}+3 n +2\right )}\) | \(55\) |
derivativedivides | \(\frac {a \sin \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (2+n \right )}+\frac {a \left (c n +n d +2 d \right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d \left (n^{2}+3 n +2\right ) f}-\frac {a c \left (-n d +c -2 d \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} f \left (n^{2}+3 n +2\right )}\) | \(125\) |
default | \(\frac {a \sin \left (f x +e \right )^{2} {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (2+n \right )}+\frac {a \left (c n +n d +2 d \right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d \left (n^{2}+3 n +2\right ) f}-\frac {a c \left (-n d +c -2 d \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} f \left (n^{2}+3 n +2\right )}\) | \(125\) |
Input:
int(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))^n,x,method=_RETURNVERBOSE )
Output:
-(-d*sin(f*x+e)*(1+n)+(-n-2)*d+c)*(c+d*sin(f*x+e))^(1+n)*a/d^2/f/(n^2+3*n+ 2)
Time = 0.10 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.90 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=-\frac {{\left (a c^{2} - 2 \, a c d - a d^{2} + {\left (a d^{2} n + a d^{2}\right )} \cos \left (f x + e\right )^{2} - {\left (a c d + a d^{2}\right )} n - {\left (2 \, a d^{2} + {\left (a c d + a d^{2}\right )} n\right )} \sin \left (f x + e\right )\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}}{d^{2} f n^{2} + 3 \, d^{2} f n + 2 \, d^{2} f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))^n,x, algorithm="fri cas")
Output:
-(a*c^2 - 2*a*c*d - a*d^2 + (a*d^2*n + a*d^2)*cos(f*x + e)^2 - (a*c*d + a* d^2)*n - (2*a*d^2 + (a*c*d + a*d^2)*n)*sin(f*x + e))*(d*sin(f*x + e) + c)^ n/(d^2*f*n^2 + 3*d^2*f*n + 2*d^2*f)
Leaf count of result is larger than twice the leaf count of optimal. 586 vs. \(2 (49) = 98\).
Time = 1.44 (sec) , antiderivative size = 586, normalized size of antiderivative = 9.61 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\begin {cases} c^{n} \left (\frac {a \sin ^{2}{\left (e + f x \right )}}{2 f} + \frac {a \sin {\left (e + f x \right )}}{f}\right ) & \text {for}\: d = 0 \\x \left (c + d \sin {\left (e \right )}\right )^{n} \left (a \sin {\left (e \right )} + a\right ) \cos {\left (e \right )} & \text {for}\: f = 0 \\\frac {a c \log {\left (\frac {c}{d} + \sin {\left (e + f x \right )} \right )}}{c d^{2} f + d^{3} f \sin {\left (e + f x \right )}} + \frac {a c}{c d^{2} f + d^{3} f \sin {\left (e + f x \right )}} + \frac {a d \log {\left (\frac {c}{d} + \sin {\left (e + f x \right )} \right )} \sin {\left (e + f x \right )}}{c d^{2} f + d^{3} f \sin {\left (e + f x \right )}} - \frac {a d}{c d^{2} f + d^{3} f \sin {\left (e + f x \right )}} & \text {for}\: n = -2 \\- \frac {a c \log {\left (\frac {c}{d} + \sin {\left (e + f x \right )} \right )}}{d^{2} f} + \frac {a \log {\left (\frac {c}{d} + \sin {\left (e + f x \right )} \right )}}{d f} + \frac {a \sin {\left (e + f x \right )}}{d f} & \text {for}\: n = -1 \\- \frac {a c^{2} \left (c + d \sin {\left (e + f x \right )}\right )^{n}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {a c d n \left (c + d \sin {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {a c d n \left (c + d \sin {\left (e + f x \right )}\right )^{n}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {2 a c d \left (c + d \sin {\left (e + f x \right )}\right )^{n}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {a d^{2} n \left (c + d \sin {\left (e + f x \right )}\right )^{n} \sin ^{2}{\left (e + f x \right )}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {a d^{2} n \left (c + d \sin {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {a d^{2} \left (c + d \sin {\left (e + f x \right )}\right )^{n} \sin ^{2}{\left (e + f x \right )}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} + \frac {2 a d^{2} \left (c + d \sin {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}}{d^{2} f n^{2} + 3 d^{2} f n + 2 d^{2} f} & \text {otherwise} \end {cases} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))**n,x)
Output:
Piecewise((c**n*(a*sin(e + f*x)**2/(2*f) + a*sin(e + f*x)/f), Eq(d, 0)), ( x*(c + d*sin(e))**n*(a*sin(e) + a)*cos(e), Eq(f, 0)), (a*c*log(c/d + sin(e + f*x))/(c*d**2*f + d**3*f*sin(e + f*x)) + a*c/(c*d**2*f + d**3*f*sin(e + f*x)) + a*d*log(c/d + sin(e + f*x))*sin(e + f*x)/(c*d**2*f + d**3*f*sin(e + f*x)) - a*d/(c*d**2*f + d**3*f*sin(e + f*x)), Eq(n, -2)), (-a*c*log(c/d + sin(e + f*x))/(d**2*f) + a*log(c/d + sin(e + f*x))/(d*f) + a*sin(e + f* x)/(d*f), Eq(n, -1)), (-a*c**2*(c + d*sin(e + f*x))**n/(d**2*f*n**2 + 3*d* *2*f*n + 2*d**2*f) + a*c*d*n*(c + d*sin(e + f*x))**n*sin(e + f*x)/(d**2*f* n**2 + 3*d**2*f*n + 2*d**2*f) + a*c*d*n*(c + d*sin(e + f*x))**n/(d**2*f*n* *2 + 3*d**2*f*n + 2*d**2*f) + 2*a*c*d*(c + d*sin(e + f*x))**n/(d**2*f*n**2 + 3*d**2*f*n + 2*d**2*f) + a*d**2*n*(c + d*sin(e + f*x))**n*sin(e + f*x)* *2/(d**2*f*n**2 + 3*d**2*f*n + 2*d**2*f) + a*d**2*n*(c + d*sin(e + f*x))** n*sin(e + f*x)/(d**2*f*n**2 + 3*d**2*f*n + 2*d**2*f) + a*d**2*(c + d*sin(e + f*x))**n*sin(e + f*x)**2/(d**2*f*n**2 + 3*d**2*f*n + 2*d**2*f) + 2*a*d* *2*(c + d*sin(e + f*x))**n*sin(e + f*x)/(d**2*f*n**2 + 3*d**2*f*n + 2*d**2 *f), True))
Time = 0.04 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.43 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\frac {\frac {{\left (d^{2} {\left (n + 1\right )} \sin \left (f x + e\right )^{2} + c d n \sin \left (f x + e\right ) - c^{2}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a}{{\left (n^{2} + 3 \, n + 2\right )} d^{2}} + \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{n + 1} a}{d {\left (n + 1\right )}}}{f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))^n,x, algorithm="max ima")
Output:
((d^2*(n + 1)*sin(f*x + e)^2 + c*d*n*sin(f*x + e) - c^2)*(d*sin(f*x + e) + c)^n*a/((n^2 + 3*n + 2)*d^2) + (d*sin(f*x + e) + c)^(n + 1)*a/(d*(n + 1)) )/f
Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (61) = 122\).
Time = 0.11 (sec) , antiderivative size = 141, normalized size of antiderivative = 2.31 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\frac {\frac {{\left ({\left (d \sin \left (f x + e\right ) + c\right )}^{n} d^{2} n \sin \left (f x + e\right )^{2} + {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c d n \sin \left (f x + e\right ) + {\left (d \sin \left (f x + e\right ) + c\right )}^{n} d^{2} \sin \left (f x + e\right )^{2} - {\left (d \sin \left (f x + e\right ) + c\right )}^{n} c^{2}\right )} a}{d^{2} n^{2} + 3 \, d^{2} n + 2 \, d^{2}} + \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{n + 1} a}{d {\left (n + 1\right )}}}{f} \] Input:
integrate(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))^n,x, algorithm="gia c")
Output:
(((d*sin(f*x + e) + c)^n*d^2*n*sin(f*x + e)^2 + (d*sin(f*x + e) + c)^n*c*d *n*sin(f*x + e) + (d*sin(f*x + e) + c)^n*d^2*sin(f*x + e)^2 - (d*sin(f*x + e) + c)^n*c^2)*a/(d^2*n^2 + 3*d^2*n + 2*d^2) + (d*sin(f*x + e) + c)^(n + 1)*a/(d*(n + 1)))/f
Time = 33.57 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.98 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\frac {a\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n\,\left (4\,c\,d+d^2\,n+4\,d^2\,\sin \left (e+f\,x\right )+d^2\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )-2\,c^2+d^2+2\,d^2\,n\,\sin \left (e+f\,x\right )+d^2\,n\,\left (2\,{\sin \left (e+f\,x\right )}^2-1\right )+2\,c\,d\,n+2\,c\,d\,n\,\sin \left (e+f\,x\right )\right )}{2\,d^2\,f\,\left (n^2+3\,n+2\right )} \] Input:
int(cos(e + f*x)*(a + a*sin(e + f*x))*(c + d*sin(e + f*x))^n,x)
Output:
(a*(c + d*sin(e + f*x))^n*(4*c*d + d^2*n + 4*d^2*sin(e + f*x) + d^2*(2*sin (e + f*x)^2 - 1) - 2*c^2 + d^2 + 2*d^2*n*sin(e + f*x) + d^2*n*(2*sin(e + f *x)^2 - 1) + 2*c*d*n + 2*c*d*n*sin(e + f*x)))/(2*d^2*f*(3*n + n^2 + 2))
Time = 0.19 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.66 \[ \int \cos (e+f x) (a+a \sin (e+f x)) (c+d \sin (e+f x))^n \, dx=\frac {\left (\sin \left (f x +e \right ) d +c \right )^{n} a \left (\sin \left (f x +e \right )^{2} d^{2} n +\sin \left (f x +e \right )^{2} d^{2}+\sin \left (f x +e \right ) c d n +\sin \left (f x +e \right ) d^{2} n +2 \sin \left (f x +e \right ) d^{2}-c^{2}+c d n +2 c d \right )}{d^{2} f \left (n^{2}+3 n +2\right )} \] Input:
int(cos(f*x+e)*(a+a*sin(f*x+e))*(c+d*sin(f*x+e))^n,x)
Output:
((sin(e + f*x)*d + c)**n*a*(sin(e + f*x)**2*d**2*n + sin(e + f*x)**2*d**2 + sin(e + f*x)*c*d*n + sin(e + f*x)*d**2*n + 2*sin(e + f*x)*d**2 - c**2 + c*d*n + 2*c*d))/(d**2*f*(n**2 + 3*n + 2))