Integrand size = 31, antiderivative size = 136 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {1}{8} \left (3 a^2 A+4 A b^2+8 a b B\right ) x+\frac {\left (2 a A b+a^2 B+b^2 B\right ) \sin (c+d x)}{d}+\frac {\left (3 a^2 A+4 A b^2+8 a b B\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 A \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {a (2 A b+a B) \sin ^3(c+d x)}{3 d} \] Output:
1/8*(3*A*a^2+4*A*b^2+8*B*a*b)*x+(2*A*a*b+B*a^2+B*b^2)*sin(d*x+c)/d+1/8*(3* A*a^2+4*A*b^2+8*B*a*b)*cos(d*x+c)*sin(d*x+c)/d+1/4*a^2*A*cos(d*x+c)^3*sin( d*x+c)/d-1/3*a*(2*A*b+B*a)*sin(d*x+c)^3/d
Time = 1.60 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.87 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {12 \left (3 a^2 A+4 A b^2+8 a b B\right ) (c+d x)+24 \left (6 a A b+3 a^2 B+4 b^2 B\right ) \sin (c+d x)+24 \left (a^2 A+A b^2+2 a b B\right ) \sin (2 (c+d x))+8 a (2 A b+a B) \sin (3 (c+d x))+3 a^2 A \sin (4 (c+d x))}{96 d} \] Input:
Integrate[Cos[c + d*x]^4*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]
Output:
(12*(3*a^2*A + 4*A*b^2 + 8*a*b*B)*(c + d*x) + 24*(6*a*A*b + 3*a^2*B + 4*b^ 2*B)*Sin[c + d*x] + 24*(a^2*A + A*b^2 + 2*a*b*B)*Sin[2*(c + d*x)] + 8*a*(2 *A*b + a*B)*Sin[3*(c + d*x)] + 3*a^2*A*Sin[4*(c + d*x)])/(96*d)
Time = 0.78 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.93, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.387, Rules used = {3042, 4512, 25, 3042, 4535, 3042, 3115, 24, 4532, 3042, 3492, 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 ^4(c+d x) (a+b \sec (c+d x))^2 (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 )^2 \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 \) 4512 |
\(\displaystyle \frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}-\frac {1}{4} \int -\cos ^3(c+d x) \left (4 b^2 B \sec ^2(c+d x)+\left (3 A a^2+8 b B a+4 A b^2\right ) \sec (c+d x)+4 a (2 A b+a B)\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{4} \int \cos ^3(c+d x) \left (4 b^2 B \sec ^2(c+d x)+\left (3 A a^2+8 b B a+4 A b^2\right ) \sec (c+d x)+4 a (2 A b+a B)\right )dx+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \frac {4 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+\left (3 A a^2+8 b B a+4 A b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )+4 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4535 |
\(\displaystyle \frac {1}{4} \left (\left (3 a^2 A+8 a b B+4 A b^2\right ) \int \cos ^2(c+d x)dx+\int \cos ^3(c+d x) \left (4 b^2 B \sec ^2(c+d x)+4 a (2 A b+a B)\right )dx\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\left (3 a^2 A+8 a b B+4 A b^2\right ) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx+\int \frac {4 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+4 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {1}{4} \left (\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )+\int \frac {4 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+4 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} \left (\int \frac {4 b^2 B \csc \left (c+d x+\frac {\pi }{2}\right )^2+4 a (2 A b+a B)}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx+\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4532 |
\(\displaystyle \frac {1}{4} \left (\int \cos (c+d x) \left (4 B b^2+4 a (2 A b+a B) \cos ^2(c+d x)\right )dx+\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (4 B b^2+4 a (2 A b+a B) \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx+\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3492 |
\(\displaystyle \frac {1}{4} \left (\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {\int \left (4 \left (B a^2+2 A b a+b^2 B\right )-4 a (2 A b+a B) \sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}\right )+\frac {a^2 A \sin (c+d x) \cos ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{4} \left (\left (3 a^2 A+8 a b B+4 A b^2\right ) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )-\frac {\frac {4}{3} a (a B+2 A b) \sin ^3(c+d x)-4 \left (a^2 B+2 a A b+b^2 B\right ) \sin (c+d x)}{d}\right )+\frac {a^2 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])^2*(A + B*Sec[c + d*x]),x]
Output:
(a^2*A*Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + ((3*a^2*A + 4*A*b^2 + 8*a*b*B) *(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)) - (-4*(2*a*A*b + a^2*B + b^2*B) *Sin[c + d*x] + (4*a*(2*A*b + a*B)*Sin[c + d*x]^3)/3)/d)/4
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[sin[(e_.) + (f_.)*(x_)]^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[-f^(-1) Subst[Int[(1 - x^2)^((m - 1)/2)*(A + C - C*x^2 ), x], x, Cos[e + f*x]], x] /; FreeQ[{e, f, A, C}, x] && IGtQ[(m + 1)/2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^2*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a^2*A*Cos[ e + f*x]*((d*Csc[e + f*x])^(n + 1)/(d*f*n)), x] + Simp[1/(d*n) Int[(d*Csc [e + f*x])^(n + 1)*(a*(2*A*b + a*B)*n + (2*a*b*B*n + A*(b^2*n + a^2*(n + 1) ))*Csc[e + f*x] + b^2*B*n*Csc[e + f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]
Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Int[(C + A*Sin[e + f*x]^2)/Sin[e + f*x]^(m + 2), x] /; FreeQ[ {e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && ILtQ[(m + 1)/2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]* (B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.)), x_Symbol] :> Simp[B/b Int[(b*Cs c[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x]^2) , x] /; FreeQ[{b, e, f, A, B, C, m}, x]
Time = 0.86 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.87
method | result | size |
parallelrisch | \(\frac {24 \left (A \,a^{2}+A \,b^{2}+2 B a b \right ) \sin \left (2 d x +2 c \right )+8 \left (2 A a b +B \,a^{2}\right ) \sin \left (3 d x +3 c \right )+3 A \,a^{2} \sin \left (4 d x +4 c \right )+24 \left (6 A a b +3 B \,a^{2}+4 b^{2} B \right ) \sin \left (d x +c \right )+36 \left (A \,a^{2}+\frac {4}{3} A \,b^{2}+\frac {8}{3} B a b \right ) x d}{96 d}\) | \(118\) |
derivativedivides | \(\frac {A \,a^{2} \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 {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {2 A a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+2 B a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} B \sin \left (d x +c \right )}{d}\) | \(152\) |
default | \(\frac {A \,a^{2} \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 {B \,a^{2} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+\frac {2 A a b \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+2 B a b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \,b^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} B \sin \left (d x +c \right )}{d}\) | \(152\) |
risch | \(\frac {3 a^{2} A x}{8}+\frac {x A \,b^{2}}{2}+x B a b +\frac {3 \sin \left (d x +c \right ) A a b}{2 d}+\frac {3 \sin \left (d x +c \right ) B \,a^{2}}{4 d}+\frac {\sin \left (d x +c \right ) b^{2} B}{d}+\frac {A \,a^{2} \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A a b}{6 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2}}{12 d}+\frac {A \,a^{2} \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) A \,b^{2}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B a b}{2 d}\) | \(170\) |
norman | \(\frac {\left (\frac {3}{8} A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) x +\left (-\frac {3}{2} A \,a^{2}-2 A \,b^{2}-4 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (-\frac {3}{8} A \,a^{2}-\frac {1}{2} A \,b^{2}-B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-\frac {3}{8} A \,a^{2}-\frac {1}{2} A \,b^{2}-B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {3}{4} A \,a^{2}+A \,b^{2}+2 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{4} A \,a^{2}+A \,b^{2}+2 B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (\frac {3}{8} A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}-\frac {\left (5 A \,a^{2}-16 A a b +4 A \,b^{2}-8 B \,a^{2}+8 B a b -8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (5 A \,a^{2}+16 A a b +4 A \,b^{2}+8 B \,a^{2}+8 B a b +8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (21 A \,a^{2}-16 A a b -12 A \,b^{2}-8 B \,a^{2}-24 B a b -24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 d}-\frac {\left (21 A \,a^{2}+16 A a b -12 A \,b^{2}+8 B \,a^{2}-24 B a b +24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 d}+\frac {\left (39 A \,a^{2}-16 A a b +12 A \,b^{2}-8 B \,a^{2}+24 B a b +24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{12 d}-\frac {\left (39 A \,a^{2}+16 A a b +12 A \,b^{2}+8 B \,a^{2}+24 B a b -24 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 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 )^{2}}\) | \(539\) |
Input:
int(cos(d*x+c)^4*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x,method=_RETURNVERBO SE)
Output:
1/96*(24*(A*a^2+A*b^2+2*B*a*b)*sin(2*d*x+2*c)+8*(2*A*a*b+B*a^2)*sin(3*d*x+ 3*c)+3*A*a^2*sin(4*d*x+4*c)+24*(6*A*a*b+3*B*a^2+4*B*b^2)*sin(d*x+c)+36*(A* a^2+4/3*A*b^2+8/3*B*a*b)*x*d)/d
Time = 0.08 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.84 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} d x + {\left (6 \, A a^{2} \cos \left (d x + c\right )^{3} + 16 \, B a^{2} + 32 \, A a b + 24 \, B b^{2} + 8 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\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))^2*(A+B*sec(d*x+c)),x, algorithm="f ricas")
Output:
1/24*(3*(3*A*a^2 + 8*B*a*b + 4*A*b^2)*d*x + (6*A*a^2*cos(d*x + c)^3 + 16*B *a^2 + 32*A*a*b + 24*B*b^2 + 8*(B*a^2 + 2*A*a*b)*cos(d*x + c)^2 + 3*(3*A*a ^2 + 8*B*a*b + 4*A*b^2)*cos(d*x + c))*sin(d*x + c))/d
Timed out. \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)**4*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)
Output:
Timed out
Time = 0.04 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.04 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (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^{2} - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 64 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a b + 48 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a b + 24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A b^{2} + 96 \, B b^{2} \sin \left (d x + c\right )}{96 \, d} \] Input:
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="m axima")
Output:
1/96*(3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*A*a^2 - 32 *(sin(d*x + c)^3 - 3*sin(d*x + c))*B*a^2 - 64*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*a*b + 48*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*a*b + 24*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*b^2 + 96*B*b^2*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 437 vs. \(2 (128) = 256\).
Time = 0.16 (sec) , antiderivative size = 437, normalized size of antiderivative = 3.21 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (3 \, A a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 80 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 48 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, B b^{2} \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))^2*(A+B*sec(d*x+c)),x, algorithm="g iac")
Output:
1/24*(3*(3*A*a^2 + 8*B*a*b + 4*A*b^2)*(d*x + c) - 2*(15*A*a^2*tan(1/2*d*x + 1/2*c)^7 - 24*B*a^2*tan(1/2*d*x + 1/2*c)^7 - 48*A*a*b*tan(1/2*d*x + 1/2* c)^7 + 24*B*a*b*tan(1/2*d*x + 1/2*c)^7 + 12*A*b^2*tan(1/2*d*x + 1/2*c)^7 - 24*B*b^2*tan(1/2*d*x + 1/2*c)^7 - 9*A*a^2*tan(1/2*d*x + 1/2*c)^5 - 40*B*a ^2*tan(1/2*d*x + 1/2*c)^5 - 80*A*a*b*tan(1/2*d*x + 1/2*c)^5 + 24*B*a*b*tan (1/2*d*x + 1/2*c)^5 + 12*A*b^2*tan(1/2*d*x + 1/2*c)^5 - 72*B*b^2*tan(1/2*d *x + 1/2*c)^5 + 9*A*a^2*tan(1/2*d*x + 1/2*c)^3 - 40*B*a^2*tan(1/2*d*x + 1/ 2*c)^3 - 80*A*a*b*tan(1/2*d*x + 1/2*c)^3 - 24*B*a*b*tan(1/2*d*x + 1/2*c)^3 - 12*A*b^2*tan(1/2*d*x + 1/2*c)^3 - 72*B*b^2*tan(1/2*d*x + 1/2*c)^3 - 15* A*a^2*tan(1/2*d*x + 1/2*c) - 24*B*a^2*tan(1/2*d*x + 1/2*c) - 48*A*a*b*tan( 1/2*d*x + 1/2*c) - 24*B*a*b*tan(1/2*d*x + 1/2*c) - 12*A*b^2*tan(1/2*d*x + 1/2*c) - 24*B*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^4)/d
Time = 11.28 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.24 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3\,A\,a^2\,x}{8}+\frac {A\,b^2\,x}{2}+\frac {3\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b^2\,\sin \left (c+d\,x\right )}{d}+B\,a\,b\,x+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {A\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {3\,A\,a\,b\,\sin \left (c+d\,x\right )}{2\,d}+\frac {A\,a\,b\,\sin \left (3\,c+3\,d\,x\right )}{6\,d}+\frac {B\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \] Input:
int(cos(c + d*x)^4*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2,x)
Output:
(3*A*a^2*x)/8 + (A*b^2*x)/2 + (3*B*a^2*sin(c + d*x))/(4*d) + (B*b^2*sin(c + d*x))/d + B*a*b*x + (A*a^2*sin(2*c + 2*d*x))/(4*d) + (A*a^2*sin(4*c + 4* d*x))/(32*d) + (A*b^2*sin(2*c + 2*d*x))/(4*d) + (B*a^2*sin(3*c + 3*d*x))/( 12*d) + (3*A*a*b*sin(c + d*x))/(2*d) + (A*a*b*sin(3*c + 3*d*x))/(6*d) + (B *a*b*sin(2*c + 2*d*x))/(2*d)
Time = 0.20 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.82 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a^{3}+5 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3}+12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a \,b^{2}-8 \sin \left (d x +c \right )^{3} a^{2} b +24 \sin \left (d x +c \right ) a^{2} b +8 \sin \left (d x +c \right ) b^{3}+3 a^{3} d x +12 a \,b^{2} d x}{8 d} \] Input:
int(cos(d*x+c)^4*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)
Output:
( - 2*cos(c + d*x)*sin(c + d*x)**3*a**3 + 5*cos(c + d*x)*sin(c + d*x)*a**3 + 12*cos(c + d*x)*sin(c + d*x)*a*b**2 - 8*sin(c + d*x)**3*a**2*b + 24*sin (c + d*x)*a**2*b + 8*sin(c + d*x)*b**3 + 3*a**3*d*x + 12*a*b**2*d*x)/(8*d)