Integrand size = 29, antiderivative size = 105 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {1}{8} (3 a A+4 b B) x+\frac {(A b+a B) \sin (c+d x)}{d}+\frac {(3 a A+4 b B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {(A b+a B) \sin ^3(c+d x)}{3 d} \] Output:
1/8*(3*A*a+4*B*b)*x+(A*b+B*a)*sin(d*x+c)/d+1/8*(3*A*a+4*B*b)*cos(d*x+c)*si n(d*x+c)/d+1/4*a*A*cos(d*x+c)^3*sin(d*x+c)/d-1/3*(A*b+B*a)*sin(d*x+c)^3/d
Time = 0.22 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.87 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {36 a A c+48 b B c+36 a A d x+48 b B d x+96 (A b+a B) \sin (c+d x)-32 (A b+a B) \sin ^3(c+d x)+24 (a A+b B) \sin (2 (c+d x))+3 a A \sin (4 (c+d x))}{96 d} \] Input:
Integrate[Cos[c + d*x]^4*(a + b*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]
Output:
(36*a*A*c + 48*b*B*c + 36*a*A*d*x + 48*b*B*d*x + 96*(A*b + a*B)*Sin[c + d* x] - 32*(A*b + a*B)*Sin[c + d*x]^3 + 24*(a*A + b*B)*Sin[2*(c + d*x)] + 3*a *A*Sin[4*(c + d*x)])/(96*d)
Time = 0.51 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.92, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {3042, 4484, 25, 3042, 4274, 3042, 3113, 2009, 3115, 24}
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 ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx\) |
\(\Big \downarrow \) 4484 |
\(\displaystyle \frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}-\frac {1}{4} \int -\cos ^3(c+d x) (4 (A b+a B)+(3 a A+4 b B) \sec (c+d x))dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{4} \int \cos ^3(c+d x) (4 (A b+a B)+(3 a A+4 b B) \sec (c+d x))dx+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \frac {4 (A b+a B)+(3 a A+4 b B) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {1}{4} \left (4 (a B+A b) \int \cos ^3(c+d x)dx+(3 a A+4 b B) \int \cos ^2(c+d x)dx\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left ((3 a A+4 b B) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx+4 (a B+A b) \int \sin \left (c+d x+\frac {\pi }{2}\right )^3dx\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3113 |
\(\displaystyle \frac {1}{4} \left ((3 a A+4 b B) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {4 (a B+A b) \int \left (1-\sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{4} \left ((3 a A+4 b B) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {4 (a B+A b) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{4} \left ((3 a A+4 b B) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {4 (a B+A b) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} \left ((3 a A+4 b B) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {4 (a B+A b) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\right )+\frac {a A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
Input:
Int[Cos[c + d*x]^4*(a + b*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]
Output:
(a*A*Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + ((3*a*A + 4*b*B)*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)) - (4*(A*b + a*B)*(-Sin[c + d*x] + Sin[c + d*x]^ 3/3))/d)/4
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Simp[1/(d*n) Int[(d*Csc[e + f*x])^( n + 1)*Simp[n*(B*a + A*b) + (B*b*n + A*a*(n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && LeQ[n, -1]
Time = 0.77 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.82
method | result | size |
parallelrisch | \(\frac {\left (24 A a +24 B b \right ) \sin \left (2 d x +2 c \right )+\left (8 A b +8 B a \right ) \sin \left (3 d x +3 c \right )+3 A a \sin \left (4 d x +4 c \right )+\left (72 A b +72 B a \right ) \sin \left (d x +c \right )+36 x \left (A a +\frac {4 B b}{3}\right ) d}{96 d}\) | \(86\) |
derivativedivides | \(\frac {A a \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
default | \(\frac {A a \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {B a \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(107\) |
risch | \(\frac {3 a A x}{8}+\frac {x B b}{2}+\frac {3 \sin \left (d x +c \right ) A b}{4 d}+\frac {3 \sin \left (d x +c \right ) B a}{4 d}+\frac {A a \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A b}{12 d}+\frac {\sin \left (3 d x +3 c \right ) B a}{12 d}+\frac {A a \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}\) | \(118\) |
norman | \(\frac {\left (-\frac {3 A a}{8}-\frac {B b}{2}\right ) x +\left (-\frac {9 A a}{8}-\frac {3 B b}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-\frac {3 A a}{4}-B b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (\frac {3 A a}{4}+B b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {3 A a}{8}+\frac {B b}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (\frac {9 A a}{8}+\frac {3 B b}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}-\frac {\left (3 A a -4 B b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 d}+\frac {2 \left (3 A a -2 A b -2 B a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}+\frac {2 \left (3 A a +2 A b +2 B a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{3 d}-\frac {\left (5 A a -8 A b -8 B a +4 B b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}-\frac {\left (5 A a +8 A b +8 B a +4 B b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) | \(300\) |
Input:
int(cos(d*x+c)^4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/96*((24*A*a+24*B*b)*sin(2*d*x+2*c)+(8*A*b+8*B*a)*sin(3*d*x+3*c)+3*A*a*si n(4*d*x+4*c)+(72*A*b+72*B*a)*sin(d*x+c)+36*x*(A*a+4/3*B*b)*d)/d
Time = 0.08 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.77 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a + 4 \, B b\right )} d x + {\left (6 \, A a \cos \left (d x + c\right )^{3} + 8 \, {\left (B a + A b\right )} \cos \left (d x + c\right )^{2} + 16 \, B a + 16 \, A b + 3 \, {\left (3 \, A a + 4 \, B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d} \] Input:
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="fri cas")
Output:
1/24*(3*(3*A*a + 4*B*b)*d*x + (6*A*a*cos(d*x + c)^3 + 8*(B*a + A*b)*cos(d* x + c)^2 + 16*B*a + 16*A*b + 3*(3*A*a + 4*B*b)*cos(d*x + c))*sin(d*x + c)) /d
\[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}\, dx \] Input:
integrate(cos(d*x+c)**4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x)
Output:
Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))*cos(c + d*x)**4, x)
Time = 0.04 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.96 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b}{96 \, d} \] Input:
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="max ima")
Output:
1/96*(3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*A*a - 32*( sin(d*x + c)^3 - 3*sin(d*x + c))*B*a - 32*(sin(d*x + c)^3 - 3*sin(d*x + c) )*A*b + 24*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*b)/d
Leaf count of result is larger than twice the leaf count of optimal. 272 vs. \(2 (97) = 194\).
Time = 0.15 (sec) , antiderivative size = 272, normalized size of antiderivative = 2.59 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a + 4 \, B b\right )} {\left (d x + c\right )} - \frac {2 \, {\left (15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \] Input:
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="gia c")
Output:
1/24*(3*(3*A*a + 4*B*b)*(d*x + c) - 2*(15*A*a*tan(1/2*d*x + 1/2*c)^7 - 24* B*a*tan(1/2*d*x + 1/2*c)^7 - 24*A*b*tan(1/2*d*x + 1/2*c)^7 + 12*B*b*tan(1/ 2*d*x + 1/2*c)^7 - 9*A*a*tan(1/2*d*x + 1/2*c)^5 - 40*B*a*tan(1/2*d*x + 1/2 *c)^5 - 40*A*b*tan(1/2*d*x + 1/2*c)^5 + 12*B*b*tan(1/2*d*x + 1/2*c)^5 + 9* A*a*tan(1/2*d*x + 1/2*c)^3 - 40*B*a*tan(1/2*d*x + 1/2*c)^3 - 40*A*b*tan(1/ 2*d*x + 1/2*c)^3 - 12*B*b*tan(1/2*d*x + 1/2*c)^3 - 15*A*a*tan(1/2*d*x + 1/ 2*c) - 24*B*a*tan(1/2*d*x + 1/2*c) - 24*A*b*tan(1/2*d*x + 1/2*c) - 12*B*b* tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^4)/d
Time = 11.38 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.11 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {3\,A\,a\,x}{8}+\frac {B\,b\,x}{2}+\frac {3\,A\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,B\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {A\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \] Input:
int(cos(c + d*x)^4*(A + B/cos(c + d*x))*(a + b/cos(c + d*x)),x)
Output:
(3*A*a*x)/8 + (B*b*x)/2 + (3*A*b*sin(c + d*x))/(4*d) + (3*B*a*sin(c + d*x) )/(4*d) + (A*a*sin(2*c + 2*d*x))/(4*d) + (A*a*sin(4*c + 4*d*x))/(32*d) + ( A*b*sin(3*c + 3*d*x))/(12*d) + (B*a*sin(3*c + 3*d*x))/(12*d) + (B*b*sin(2* c + 2*d*x))/(4*d)
Time = 0.16 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.90 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx=\frac {-6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a^{2}+15 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{2}+12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{2}-16 \sin \left (d x +c \right )^{3} a b +48 \sin \left (d x +c \right ) a b +9 a^{2} d x +12 b^{2} d x}{24 d} \] Input:
int(cos(d*x+c)^4*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x)
Output:
( - 6*cos(c + d*x)*sin(c + d*x)**3*a**2 + 15*cos(c + d*x)*sin(c + d*x)*a** 2 + 12*cos(c + d*x)*sin(c + d*x)*b**2 - 16*sin(c + d*x)**3*a*b + 48*sin(c + d*x)*a*b + 9*a**2*d*x + 12*b**2*d*x)/(24*d)