\(\int \cos (c+d x) (a+b \sec (c+d x))^4 (A+B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [890]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F(-1)]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 39, antiderivative size = 273 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^3 (4 A b+a B) x+\frac {\left (32 a^3 b B+16 a b^3 B+8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {A (a+b \sec (c+d x))^4 \sin (c+d x)}{d}+\frac {b \left (34 a^2 b B+4 b^3 B-a^3 (12 A-19 C)+8 a b^2 (3 A+2 C)\right ) \tan (c+d x)}{6 d}+\frac {b^2 \left (32 a b B-a^2 (24 A-26 C)+3 b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{24 d}-\frac {b (12 a A-4 b B-7 a C) (a+b \sec (c+d x))^2 \tan (c+d x)}{12 d}-\frac {b (4 A-C) (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \] Output:

a^3*(4*A*b+B*a)*x+1/8*(32*B*a^3*b+16*B*a*b^3+8*a^4*C+24*a^2*b^2*(2*A+C)+b^ 
4*(4*A+3*C))*arctanh(sin(d*x+c))/d+A*(a+b*sec(d*x+c))^4*sin(d*x+c)/d+1/6*b 
*(34*B*a^2*b+4*B*b^3-a^3*(12*A-19*C)+8*a*b^2*(3*A+2*C))*tan(d*x+c)/d+1/24* 
b^2*(32*B*a*b-a^2*(24*A-26*C)+3*b^2*(4*A+3*C))*sec(d*x+c)*tan(d*x+c)/d-1/1 
2*b*(12*A*a-4*B*b-7*C*a)*(a+b*sec(d*x+c))^2*tan(d*x+c)/d-1/4*b*(4*A-C)*(a+ 
b*sec(d*x+c))^3*tan(d*x+c)/d
                                                                                    
                                                                                    
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(647\) vs. \(2(273)=546\).

Time = 15.21 (sec) , antiderivative size = 647, normalized size of antiderivative = 2.37 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\cos ^2(c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (144 a^3 A b (c+d x)+36 a^4 B (c+d x)+192 a^3 A b (c+d x) \cos (2 (c+d x))+48 a^4 B (c+d x) \cos (2 (c+d x))+48 a^3 A b (c+d x) \cos (4 (c+d x))+12 a^4 B (c+d x) \cos (4 (c+d x))-12 \left (32 a^3 b B+16 a b^3 B+8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \cos ^4(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 \left (32 a^3 b B+16 a b^3 B+8 a^4 C+24 a^2 b^2 (2 A+C)+b^4 (4 A+3 C)\right ) \cos ^4(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^4 A \sin (c+d x)+12 A b^4 \sin (c+d x)+48 a b^3 B \sin (c+d x)+72 a^2 b^2 C \sin (c+d x)+33 b^4 C \sin (c+d x)+96 a A b^3 \sin (2 (c+d x))+144 a^2 b^2 B \sin (2 (c+d x))+32 b^4 B \sin (2 (c+d x))+96 a^3 b C \sin (2 (c+d x))+128 a b^3 C \sin (2 (c+d x))+18 a^4 A \sin (3 (c+d x))+12 A b^4 \sin (3 (c+d x))+48 a b^3 B \sin (3 (c+d x))+72 a^2 b^2 C \sin (3 (c+d x))+9 b^4 C \sin (3 (c+d x))+48 a A b^3 \sin (4 (c+d x))+72 a^2 b^2 B \sin (4 (c+d x))+8 b^4 B \sin (4 (c+d x))+48 a^3 b C \sin (4 (c+d x))+32 a b^3 C \sin (4 (c+d x))+6 a^4 A \sin (5 (c+d x))\right )}{48 d (b+a \cos (c+d x))^4 (A+2 C+2 B \cos (c+d x)+A \cos (2 (c+d x)))} \] Input:

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^4*(A + B*Sec[c + d*x] + C*Sec[ 
c + d*x]^2),x]
 

Output:

(Cos[c + d*x]^2*(a + b*Sec[c + d*x])^4*(A + B*Sec[c + d*x] + C*Sec[c + d*x 
]^2)*(144*a^3*A*b*(c + d*x) + 36*a^4*B*(c + d*x) + 192*a^3*A*b*(c + d*x)*C 
os[2*(c + d*x)] + 48*a^4*B*(c + d*x)*Cos[2*(c + d*x)] + 48*a^3*A*b*(c + d* 
x)*Cos[4*(c + d*x)] + 12*a^4*B*(c + d*x)*Cos[4*(c + d*x)] - 12*(32*a^3*b*B 
 + 16*a*b^3*B + 8*a^4*C + 24*a^2*b^2*(2*A + C) + b^4*(4*A + 3*C))*Cos[c + 
d*x]^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 12*(32*a^3*b*B + 16*a*b^ 
3*B + 8*a^4*C + 24*a^2*b^2*(2*A + C) + b^4*(4*A + 3*C))*Cos[c + d*x]^4*Log 
[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 12*a^4*A*Sin[c + d*x] + 12*A*b^4*S 
in[c + d*x] + 48*a*b^3*B*Sin[c + d*x] + 72*a^2*b^2*C*Sin[c + d*x] + 33*b^4 
*C*Sin[c + d*x] + 96*a*A*b^3*Sin[2*(c + d*x)] + 144*a^2*b^2*B*Sin[2*(c + d 
*x)] + 32*b^4*B*Sin[2*(c + d*x)] + 96*a^3*b*C*Sin[2*(c + d*x)] + 128*a*b^3 
*C*Sin[2*(c + d*x)] + 18*a^4*A*Sin[3*(c + d*x)] + 12*A*b^4*Sin[3*(c + d*x) 
] + 48*a*b^3*B*Sin[3*(c + d*x)] + 72*a^2*b^2*C*Sin[3*(c + d*x)] + 9*b^4*C* 
Sin[3*(c + d*x)] + 48*a*A*b^3*Sin[4*(c + d*x)] + 72*a^2*b^2*B*Sin[4*(c + d 
*x)] + 8*b^4*B*Sin[4*(c + d*x)] + 48*a^3*b*C*Sin[4*(c + d*x)] + 32*a*b^3*C 
*Sin[4*(c + d*x)] + 6*a^4*A*Sin[5*(c + d*x)]))/(48*d*(b + a*Cos[c + d*x])^ 
4*(A + 2*C + 2*B*Cos[c + d*x] + A*Cos[2*(c + d*x)]))
 

Rubi [A] (verified)

Time = 1.17 (sec) , antiderivative size = 285, normalized size of antiderivative = 1.04, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3042, 4582, 3042, 4544, 3042, 4544, 3042, 4536, 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 (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^4 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 4582

\(\displaystyle \int (a+b \sec (c+d x))^3 \left (-b (4 A-C) \sec ^2(c+d x)+(b B+a C) \sec (c+d x)+4 A b+a B\right )dx+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^3 \left (-b (4 A-C) \csc \left (c+d x+\frac {\pi }{2}\right )^2+(b B+a C) \csc \left (c+d x+\frac {\pi }{2}\right )+4 A b+a B\right )dx+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 4544

\(\displaystyle \frac {1}{4} \int (a+b \sec (c+d x))^2 \left (-b (12 a A-4 b B-7 a C) \sec ^2(c+d x)+\left (4 C a^2+8 b B a+4 A b^2+3 b^2 C\right ) \sec (c+d x)+4 a (4 A b+a B)\right )dx-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (-b (12 a A-4 b B-7 a C) \csc \left (c+d x+\frac {\pi }{2}\right )^2+\left (4 C a^2+8 b B a+4 A b^2+3 b^2 C\right ) \csc \left (c+d x+\frac {\pi }{2}\right )+4 a (4 A b+a B)\right )dx-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 4544

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int (a+b \sec (c+d x)) \left (12 (4 A b+a B) a^2+b \left (-\left ((24 A-26 C) a^2\right )+32 b B a+3 b^2 (4 A+3 C)\right ) \sec ^2(c+d x)+\left (12 C a^3+36 b B a^2+b^2 (36 A+23 C) a+8 b^3 B\right ) \sec (c+d x)\right )dx-\frac {b \tan (c+d x) (12 a A-7 a C-4 b B) (a+b \sec (c+d x))^2}{3 d}\right )-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (12 (4 A b+a B) a^2+b \left (-\left ((24 A-26 C) a^2\right )+32 b B a+3 b^2 (4 A+3 C)\right ) \csc \left (c+d x+\frac {\pi }{2}\right )^2+\left (12 C a^3+36 b B a^2+b^2 (36 A+23 C) a+8 b^3 B\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx-\frac {b \tan (c+d x) (12 a A-7 a C-4 b B) (a+b \sec (c+d x))^2}{3 d}\right )-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 4536

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {1}{2} \int \left (24 (4 A b+a B) a^3+4 b \left (-\left ((12 A-19 C) a^3\right )+34 b B a^2+8 b^2 (3 A+2 C) a+4 b^3 B\right ) \sec ^2(c+d x)+3 \left (8 C a^4+32 b B a^3+24 b^2 (2 A+C) a^2+16 b^3 B a+b^4 (4 A+3 C)\right ) \sec (c+d x)\right )dx+\frac {b^2 \tan (c+d x) \sec (c+d x) \left (-\left (a^2 (24 A-26 C)\right )+32 a b B+3 b^2 (4 A+3 C)\right )}{2 d}\right )-\frac {b \tan (c+d x) (12 a A-7 a C-4 b B) (a+b \sec (c+d x))^2}{3 d}\right )-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (\frac {b^2 \tan (c+d x) \sec (c+d x) \left (-\left (a^2 (24 A-26 C)\right )+32 a b B+3 b^2 (4 A+3 C)\right )}{2 d}+\frac {1}{2} \left (24 a^3 x (a B+4 A b)+\frac {4 b \tan (c+d x) \left (-\left (a^3 (12 A-19 C)\right )+34 a^2 b B+8 a b^2 (3 A+2 C)+4 b^3 B\right )}{d}+\frac {3 \left (8 a^4 C+32 a^3 b B+24 a^2 b^2 (2 A+C)+16 a b^3 B+b^4 (4 A+3 C)\right ) \text {arctanh}(\sin (c+d x))}{d}\right )\right )-\frac {b \tan (c+d x) (12 a A-7 a C-4 b B) (a+b \sec (c+d x))^2}{3 d}\right )-\frac {b (4 A-C) \tan (c+d x) (a+b \sec (c+d x))^3}{4 d}+\frac {A \sin (c+d x) (a+b \sec (c+d x))^4}{d}\)

Input:

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^4*(A + B*Sec[c + d*x] + C*Sec[c + d* 
x]^2),x]
 

Output:

(A*(a + b*Sec[c + d*x])^4*Sin[c + d*x])/d - (b*(4*A - C)*(a + b*Sec[c + d* 
x])^3*Tan[c + d*x])/(4*d) + (-1/3*(b*(12*a*A - 4*b*B - 7*a*C)*(a + b*Sec[c 
 + d*x])^2*Tan[c + d*x])/d + ((b^2*(32*a*b*B - a^2*(24*A - 26*C) + 3*b^2*( 
4*A + 3*C))*Sec[c + d*x]*Tan[c + d*x])/(2*d) + (24*a^3*(4*A*b + a*B)*x + ( 
3*(32*a^3*b*B + 16*a*b^3*B + 8*a^4*C + 24*a^2*b^2*(2*A + C) + b^4*(4*A + 3 
*C))*ArcTanh[Sin[c + d*x]])/d + (4*b*(34*a^2*b*B + 4*b^3*B - a^3*(12*A - 1 
9*C) + 8*a*b^2*(3*A + 2*C))*Tan[c + d*x])/d)/2)/3)/4
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4536
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + 
 f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2   Int[Simp[2*A*a + (2*B*a + b*(2* 
A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a 
, b, e, f, A, B, C}, x]
 

rule 4544
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Simp[(-C)*Cot 
[e + f*x]*((a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(m + 1)   Int[( 
a + b*Csc[e + f*x])^(m - 1)*Simp[a*A*(m + 1) + ((A*b + a*B)*(m + 1) + b*C*m 
)*Csc[e + f*x] + (b*B*(m + 1) + a*C*m)*Csc[e + f*x]^2, x], x], x] /; FreeQ[ 
{a, b, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0] && IGtQ[2*m, 0]
 

rule 4582
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a 
_))^(m_), x_Symbol] :> Simp[A*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e 
 + f*x])^n/(f*n)), x] - Simp[1/(d*n)   Int[(a + b*Csc[e + f*x])^(m - 1)*(d* 
Csc[e + f*x])^(n + 1)*Simp[A*b*m - a*B*n - (b*B*n + a*(C*n + A*(n + 1)))*Cs 
c[e + f*x] - b*(C*n + A*(m + n + 1))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a 
, b, d, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && LeQ[n, -1]
 
Maple [A] (verified)

Time = 2.62 (sec) , antiderivative size = 355, normalized size of antiderivative = 1.30

method result size
derivativedivides \(\frac {a^{4} A \sin \left (d x +c \right )+B \,a^{4} \left (d x +c \right )+a^{4} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 A \,a^{3} b \left (d x +c \right )+4 B \,a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 C \,a^{3} b \tan \left (d x +c \right )+6 A \,a^{2} b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 B \tan \left (d x +c \right ) a^{2} b^{2}+6 C \,a^{2} b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A a \,b^{3} \tan \left (d x +c \right )+4 B a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 C a \,b^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+A \,b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B \,b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+C \,b^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(355\)
default \(\frac {a^{4} A \sin \left (d x +c \right )+B \,a^{4} \left (d x +c \right )+a^{4} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 A \,a^{3} b \left (d x +c \right )+4 B \,a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 C \,a^{3} b \tan \left (d x +c \right )+6 A \,a^{2} b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 B \tan \left (d x +c \right ) a^{2} b^{2}+6 C \,a^{2} b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A a \,b^{3} \tan \left (d x +c \right )+4 B a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-4 C a \,b^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+A \,b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B \,b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+C \,b^{4} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(355\)
parallelrisch \(\frac {-144 \left (\left (\frac {A}{12}+\frac {C}{16}\right ) b^{4}+\frac {B a \,b^{3}}{3}+a^{2} \left (A +\frac {C}{2}\right ) b^{2}+\frac {2 B \,a^{3} b}{3}+\frac {a^{4} C}{6}\right ) \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+144 \left (\left (\frac {A}{12}+\frac {C}{16}\right ) b^{4}+\frac {B a \,b^{3}}{3}+a^{2} \left (A +\frac {C}{2}\right ) b^{2}+\frac {2 B \,a^{3} b}{3}+\frac {a^{4} C}{6}\right ) \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+384 x \,a^{3} d \left (A b +\frac {B a}{4}\right ) \cos \left (2 d x +2 c \right )+96 x \,a^{3} d \left (A b +\frac {B a}{4}\right ) \cos \left (4 d x +4 c \right )+192 \left (\frac {B \,b^{3}}{3}+a \left (A +\frac {4 C}{3}\right ) b^{2}+\frac {3 B \,a^{2} b}{2}+a^{3} C \right ) b \sin \left (2 d x +2 c \right )+\left (\left (24 A +18 C \right ) b^{4}+96 B a \,b^{3}+144 C \,a^{2} b^{2}+36 a^{4} A \right ) \sin \left (3 d x +3 c \right )+96 b \left (\frac {B \,b^{3}}{6}+a \left (A +\frac {2 C}{3}\right ) b^{2}+\frac {3 B \,a^{2} b}{2}+a^{3} C \right ) \sin \left (4 d x +4 c \right )+12 a^{4} A \sin \left (5 d x +5 c \right )+\left (\left (24 A +66 C \right ) b^{4}+96 B a \,b^{3}+144 C \,a^{2} b^{2}+24 a^{4} A \right ) \sin \left (d x +c \right )+288 x \,a^{3} d \left (A b +\frac {B a}{4}\right )}{24 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) \(436\)
norman \(\frac {\left (-4 A \,a^{3} b -B \,a^{4}\right ) x +\left (-20 A \,a^{3} b -5 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-16 A \,a^{3} b -4 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (4 A \,a^{3} b +B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (16 A \,a^{3} b +4 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (20 A \,a^{3} b +5 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\frac {\left (8 a^{4} A -32 a A \,b^{3}+4 A \,b^{4}-48 B \,a^{2} b^{2}+16 B a \,b^{3}-8 B \,b^{4}-32 a^{3} b C +24 C \,a^{2} b^{2}-32 C a \,b^{3}+5 C \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}-\frac {\left (8 a^{4} A +32 a A \,b^{3}+4 A \,b^{4}+48 B \,a^{2} b^{2}+16 B a \,b^{3}+8 B \,b^{4}+32 a^{3} b C +24 C \,a^{2} b^{2}+32 C a \,b^{3}+5 C \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (120 a^{4} A -288 a A \,b^{3}+12 A \,b^{4}-432 B \,a^{2} b^{2}+48 B a \,b^{3}-40 B \,b^{4}-288 a^{3} b C +72 C \,a^{2} b^{2}-160 C a \,b^{3}-9 C \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{12 d}+\frac {\left (120 a^{4} A -96 a A \,b^{3}-12 A \,b^{4}-144 B \,a^{2} b^{2}-48 B a \,b^{3}-8 B \,b^{4}-96 a^{3} b C -72 C \,a^{2} b^{2}-32 C a \,b^{3}-3 C \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 d}-\frac {\left (120 a^{4} A +96 a A \,b^{3}-12 A \,b^{4}+144 B \,a^{2} b^{2}-48 B a \,b^{3}+8 B \,b^{4}+96 a^{3} b C -72 C \,a^{2} b^{2}+32 C a \,b^{3}-3 C \,b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 d}+\frac {\left (120 a^{4} A +288 a A \,b^{3}+12 A \,b^{4}+432 B \,a^{2} b^{2}+48 B a \,b^{3}+40 B \,b^{4}+288 a^{3} b C +72 C \,a^{2} b^{2}+160 C a \,b^{3}-9 C \,b^{4}\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 ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{5}}-\frac {\left (48 A \,a^{2} b^{2}+4 A \,b^{4}+32 B \,a^{3} b +16 B a \,b^{3}+8 a^{4} C +24 C \,a^{2} b^{2}+3 C \,b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (48 A \,a^{2} b^{2}+4 A \,b^{4}+32 B \,a^{3} b +16 B a \,b^{3}+8 a^{4} C +24 C \,a^{2} b^{2}+3 C \,b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(840\)
risch \(4 a^{3} A b x +B \,a^{4} x -\frac {i a^{4} A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{4} A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {i b \left (96 a A \,b^{2}+16 B \,b^{3}+96 a^{3} C +144 B \,a^{2} b +64 C a \,b^{2}+144 B \,a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}-48 B a \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+432 B \,a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-72 C \,a^{2} b \,{\mathrm e}^{7 i \left (d x +c \right )}+96 A a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+48 B a \,b^{2} {\mathrm e}^{i \left (d x +c \right )}+72 C \,a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+288 A a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+192 C a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+72 C \,a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}+288 A a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+256 C a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-72 C \,a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}-48 B a \,b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+48 B a \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+432 B \,a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+48 B \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-9 C \,b^{3} {\mathrm e}^{7 i \left (d x +c \right )}+9 C \,b^{3} {\mathrm e}^{i \left (d x +c \right )}+12 A \,b^{3} {\mathrm e}^{i \left (d x +c \right )}+33 C \,b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+12 A \,b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+64 B \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+288 C \,a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-12 A \,b^{3} {\mathrm e}^{5 i \left (d x +c \right )}+288 C \,a^{3} {\mathrm e}^{2 i \left (d x +c \right )}-12 A \,b^{3} {\mathrm e}^{7 i \left (d x +c \right )}+96 C \,a^{3} {\mathrm e}^{6 i \left (d x +c \right )}-33 C \,b^{3} {\mathrm e}^{5 i \left (d x +c \right )}\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,a^{2} b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{4}}{2 d}-\frac {4 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,a^{3} b}{d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a \,b^{3}}{d}-\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C \,a^{2} b^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C \,b^{4}}{8 d}+\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,a^{2} b^{2}}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{4}}{2 d}+\frac {4 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,a^{3} b}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a \,b^{3}}{d}+\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C \,a^{2} b^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C \,b^{4}}{8 d}\) \(882\)

Input:

int(cos(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x,method 
=_RETURNVERBOSE)
 

Output:

1/d*(a^4*A*sin(d*x+c)+B*a^4*(d*x+c)+a^4*C*ln(sec(d*x+c)+tan(d*x+c))+4*A*a^ 
3*b*(d*x+c)+4*B*a^3*b*ln(sec(d*x+c)+tan(d*x+c))+4*C*a^3*b*tan(d*x+c)+6*A*a 
^2*b^2*ln(sec(d*x+c)+tan(d*x+c))+6*B*tan(d*x+c)*a^2*b^2+6*C*a^2*b^2*(1/2*s 
ec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+4*A*a*b^3*tan(d*x+c)+4 
*B*a*b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))-4*C*a*b 
^3*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+A*b^4*(1/2*sec(d*x+c)*tan(d*x+c)+1/2 
*ln(sec(d*x+c)+tan(d*x+c)))-B*b^4*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+C*b^4 
*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x 
+c))))
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 302, normalized size of antiderivative = 1.11 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {48 \, {\left (B a^{4} + 4 \, A a^{3} b\right )} d x \cos \left (d x + c\right )^{4} + 3 \, {\left (8 \, C a^{4} + 32 \, B a^{3} b + 24 \, {\left (2 \, A + C\right )} a^{2} b^{2} + 16 \, B a b^{3} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, C a^{4} + 32 \, B a^{3} b + 24 \, {\left (2 \, A + C\right )} a^{2} b^{2} + 16 \, B a b^{3} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (24 \, A a^{4} \cos \left (d x + c\right )^{4} + 6 \, C b^{4} + 16 \, {\left (6 \, C a^{3} b + 9 \, B a^{2} b^{2} + 2 \, {\left (3 \, A + 2 \, C\right )} a b^{3} + B b^{4}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (24 \, C a^{2} b^{2} + 16 \, B a b^{3} + {\left (4 \, A + 3 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{2} + 8 \, {\left (4 \, C a b^{3} + B b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \] Input:

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, 
 algorithm="fricas")
 

Output:

1/48*(48*(B*a^4 + 4*A*a^3*b)*d*x*cos(d*x + c)^4 + 3*(8*C*a^4 + 32*B*a^3*b 
+ 24*(2*A + C)*a^2*b^2 + 16*B*a*b^3 + (4*A + 3*C)*b^4)*cos(d*x + c)^4*log( 
sin(d*x + c) + 1) - 3*(8*C*a^4 + 32*B*a^3*b + 24*(2*A + C)*a^2*b^2 + 16*B* 
a*b^3 + (4*A + 3*C)*b^4)*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(24*A*a 
^4*cos(d*x + c)^4 + 6*C*b^4 + 16*(6*C*a^3*b + 9*B*a^2*b^2 + 2*(3*A + 2*C)* 
a*b^3 + B*b^4)*cos(d*x + c)^3 + 3*(24*C*a^2*b^2 + 16*B*a*b^3 + (4*A + 3*C) 
*b^4)*cos(d*x + c)^2 + 8*(4*C*a*b^3 + B*b^4)*cos(d*x + c))*sin(d*x + c))/( 
d*cos(d*x + c)^4)
 

Sympy [F(-1)]

Timed out. \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Timed out} \] Input:

integrate(cos(d*x+c)*(a+b*sec(d*x+c))**4*(A+B*sec(d*x+c)+C*sec(d*x+c)**2), 
x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 431, normalized size of antiderivative = 1.58 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {48 \, {\left (d x + c\right )} B a^{4} + 192 \, {\left (d x + c\right )} A a^{3} b + 64 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b^{3} + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b^{4} - 3 \, C b^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 72 \, C a^{2} b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 48 \, B a b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, C a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 96 \, B a^{3} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 144 \, A a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{4} \sin \left (d x + c\right ) + 192 \, C a^{3} b \tan \left (d x + c\right ) + 288 \, B a^{2} b^{2} \tan \left (d x + c\right ) + 192 \, A a b^{3} \tan \left (d x + c\right )}{48 \, d} \] Input:

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, 
 algorithm="maxima")
 

Output:

1/48*(48*(d*x + c)*B*a^4 + 192*(d*x + c)*A*a^3*b + 64*(tan(d*x + c)^3 + 3* 
tan(d*x + c))*C*a*b^3 + 16*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*b^4 - 3*C*b 
^4*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c) 
^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) - 72*C*a^2*b^ 
2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d 
*x + c) - 1)) - 48*B*a*b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin( 
d*x + c) + 1) + log(sin(d*x + c) - 1)) - 12*A*b^4*(2*sin(d*x + c)/(sin(d*x 
 + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 24*C*a^4*( 
log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 96*B*a^3*b*(log(sin(d*x + 
 c) + 1) - log(sin(d*x + c) - 1)) + 144*A*a^2*b^2*(log(sin(d*x + c) + 1) - 
 log(sin(d*x + c) - 1)) + 48*A*a^4*sin(d*x + c) + 192*C*a^3*b*tan(d*x + c) 
 + 288*B*a^2*b^2*tan(d*x + c) + 192*A*a*b^3*tan(d*x + c))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 840 vs. \(2 (262) = 524\).

Time = 0.36 (sec) , antiderivative size = 840, normalized size of antiderivative = 3.08 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Too large to display} \] Input:

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, 
 algorithm="giac")
 

Output:

1/24*(48*A*a^4*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 24*(B*a 
^4 + 4*A*a^3*b)*(d*x + c) + 3*(8*C*a^4 + 32*B*a^3*b + 48*A*a^2*b^2 + 24*C* 
a^2*b^2 + 16*B*a*b^3 + 4*A*b^4 + 3*C*b^4)*log(abs(tan(1/2*d*x + 1/2*c) + 1 
)) - 3*(8*C*a^4 + 32*B*a^3*b + 48*A*a^2*b^2 + 24*C*a^2*b^2 + 16*B*a*b^3 + 
4*A*b^4 + 3*C*b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(96*C*a^3*b*tan( 
1/2*d*x + 1/2*c)^7 + 144*B*a^2*b^2*tan(1/2*d*x + 1/2*c)^7 - 72*C*a^2*b^2*t 
an(1/2*d*x + 1/2*c)^7 + 96*A*a*b^3*tan(1/2*d*x + 1/2*c)^7 - 48*B*a*b^3*tan 
(1/2*d*x + 1/2*c)^7 + 96*C*a*b^3*tan(1/2*d*x + 1/2*c)^7 - 12*A*b^4*tan(1/2 
*d*x + 1/2*c)^7 + 24*B*b^4*tan(1/2*d*x + 1/2*c)^7 - 15*C*b^4*tan(1/2*d*x + 
 1/2*c)^7 - 288*C*a^3*b*tan(1/2*d*x + 1/2*c)^5 - 432*B*a^2*b^2*tan(1/2*d*x 
 + 1/2*c)^5 + 72*C*a^2*b^2*tan(1/2*d*x + 1/2*c)^5 - 288*A*a*b^3*tan(1/2*d* 
x + 1/2*c)^5 + 48*B*a*b^3*tan(1/2*d*x + 1/2*c)^5 - 160*C*a*b^3*tan(1/2*d*x 
 + 1/2*c)^5 + 12*A*b^4*tan(1/2*d*x + 1/2*c)^5 - 40*B*b^4*tan(1/2*d*x + 1/2 
*c)^5 - 9*C*b^4*tan(1/2*d*x + 1/2*c)^5 + 288*C*a^3*b*tan(1/2*d*x + 1/2*c)^ 
3 + 432*B*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 + 72*C*a^2*b^2*tan(1/2*d*x + 1/2* 
c)^3 + 288*A*a*b^3*tan(1/2*d*x + 1/2*c)^3 + 48*B*a*b^3*tan(1/2*d*x + 1/2*c 
)^3 + 160*C*a*b^3*tan(1/2*d*x + 1/2*c)^3 + 12*A*b^4*tan(1/2*d*x + 1/2*c)^3 
 + 40*B*b^4*tan(1/2*d*x + 1/2*c)^3 - 9*C*b^4*tan(1/2*d*x + 1/2*c)^3 - 96*C 
*a^3*b*tan(1/2*d*x + 1/2*c) - 144*B*a^2*b^2*tan(1/2*d*x + 1/2*c) - 72*C*a^ 
2*b^2*tan(1/2*d*x + 1/2*c) - 96*A*a*b^3*tan(1/2*d*x + 1/2*c) - 48*B*a*b...
 

Mupad [B] (verification not implemented)

Time = 17.37 (sec) , antiderivative size = 4710, normalized size of antiderivative = 17.25 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\text {Too large to display} \] Input:

int(cos(c + d*x)*(a + b/cos(c + d*x))^4*(A + B/cos(c + d*x) + C/cos(c + d* 
x)^2),x)
 

Output:

(tan(c/2 + (d*x)/2)*(2*A*a^4 + A*b^4 + 2*B*b^4 + (5*C*b^4)/4 + 12*B*a^2*b^ 
2 + 6*C*a^2*b^2 + 8*A*a*b^3 + 4*B*a*b^3 + 8*C*a*b^3 + 8*C*a^3*b) - tan(c/2 
 + (d*x)/2)^3*(8*A*a^4 + (4*B*b^4)/3 - 2*C*b^4 + 24*B*a^2*b^2 + 16*A*a*b^3 
 + (16*C*a*b^3)/3 + 16*C*a^3*b) + tan(c/2 + (d*x)/2)^7*((4*B*b^4)/3 - 8*A* 
a^4 + 2*C*b^4 + 24*B*a^2*b^2 + 16*A*a*b^3 + (16*C*a*b^3)/3 + 16*C*a^3*b) + 
 tan(c/2 + (d*x)/2)^9*(2*A*a^4 + A*b^4 - 2*B*b^4 + (5*C*b^4)/4 - 12*B*a^2* 
b^2 + 6*C*a^2*b^2 - 8*A*a*b^3 + 4*B*a*b^3 - 8*C*a*b^3 - 8*C*a^3*b) - tan(c 
/2 + (d*x)/2)^5*(2*A*b^4 - 12*A*a^4 - (3*C*b^4)/2 + 12*C*a^2*b^2 + 8*B*a*b 
^3))/(d*(2*tan(c/2 + (d*x)/2)^4 - 3*tan(c/2 + (d*x)/2)^2 + 2*tan(c/2 + (d* 
x)/2)^6 - 3*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 + 1)) + (atan(((( 
(A*b^4)/2 + C*a^4 + (3*C*b^4)/8 + 6*A*a^2*b^2 + 3*C*a^2*b^2 + 2*B*a*b^3 + 
4*B*a^3*b)*(16*A*b^4 + 32*B*a^4 + 32*C*a^4 + 12*C*b^4 + 192*A*a^2*b^2 + 96 
*C*a^2*b^2 + 128*A*a^3*b + 64*B*a*b^3 + 128*B*a^3*b) + tan(c/2 + (d*x)/2)* 
(8*A^2*b^8 + 32*B^2*a^8 + 32*C^2*a^8 + (9*C^2*b^8)/2 + 192*A^2*a^2*b^6 + 1 
152*A^2*a^4*b^4 + 512*A^2*a^6*b^2 + 128*B^2*a^2*b^6 + 512*B^2*a^4*b^4 + 51 
2*B^2*a^6*b^2 + 72*C^2*a^2*b^6 + 312*C^2*a^4*b^4 + 192*C^2*a^6*b^2 + 12*A* 
C*b^8 + 64*A*B*a*b^7 + 256*A*B*a^7*b + 48*B*C*a*b^7 + 256*B*C*a^7*b + 896* 
A*B*a^3*b^5 + 1536*A*B*a^5*b^3 + 240*A*C*a^2*b^6 + 1184*A*C*a^4*b^4 + 384* 
A*C*a^6*b^2 + 480*B*C*a^3*b^5 + 896*B*C*a^5*b^3))*((A*b^4)/2 + C*a^4 + (3* 
C*b^4)/8 + 6*A*a^2*b^2 + 3*C*a^2*b^2 + 2*B*a*b^3 + 4*B*a^3*b)*1i - (((A...
 

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 1114, normalized size of antiderivative = 4.08 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx =\text {Too large to display} \] Input:

int(cos(d*x+c)*(a+b*sec(d*x+c))^4*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x)
 

Output:

( - 96*cos(c + d*x)*sin(c + d*x)**3*a**3*b*c - 240*cos(c + d*x)*sin(c + d* 
x)**3*a**2*b**3 - 64*cos(c + d*x)*sin(c + d*x)**3*a*b**3*c - 16*cos(c + d* 
x)*sin(c + d*x)**3*b**5 + 96*cos(c + d*x)*sin(c + d*x)*a**3*b*c + 240*cos( 
c + d*x)*sin(c + d*x)*a**2*b**3 + 96*cos(c + d*x)*sin(c + d*x)*a*b**3*c + 
24*cos(c + d*x)*sin(c + d*x)*b**5 - 24*log(tan((c + d*x)/2) - 1)*sin(c + d 
*x)**4*a**4*c - 240*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**3*b**2 - 
72*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**2*b**2*c - 60*log(tan((c + 
 d*x)/2) - 1)*sin(c + d*x)**4*a*b**4 - 9*log(tan((c + d*x)/2) - 1)*sin(c + 
 d*x)**4*b**4*c + 48*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**4*c + 48 
0*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**3*b**2 + 144*log(tan((c + d 
*x)/2) - 1)*sin(c + d*x)**2*a**2*b**2*c + 120*log(tan((c + d*x)/2) - 1)*si 
n(c + d*x)**2*a*b**4 + 18*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b**4*c 
 - 24*log(tan((c + d*x)/2) - 1)*a**4*c - 240*log(tan((c + d*x)/2) - 1)*a** 
3*b**2 - 72*log(tan((c + d*x)/2) - 1)*a**2*b**2*c - 60*log(tan((c + d*x)/2 
) - 1)*a*b**4 - 9*log(tan((c + d*x)/2) - 1)*b**4*c + 24*log(tan((c + d*x)/ 
2) + 1)*sin(c + d*x)**4*a**4*c + 240*log(tan((c + d*x)/2) + 1)*sin(c + d*x 
)**4*a**3*b**2 + 72*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**2*b**2*c 
+ 60*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a*b**4 + 9*log(tan((c + d*x 
)/2) + 1)*sin(c + d*x)**4*b**4*c - 48*log(tan((c + d*x)/2) + 1)*sin(c + d* 
x)**2*a**4*c - 480*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**3*b**2 ...