\[ \int \frac {(b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx \]
Optimal antiderivative \[ \frac {2 C \left (b \sec \left (d x +c \right )\right )^{n} \sin \left (d x +c \right ) \left (\sqrt {\sec }\left (d x +c \right )\right )}{d \left (1+2 n \right )}-\frac {4 \left (A -C \left (1-2 n \right )+2 A n \right ) \hypergeom \left (\left [\frac {1}{2}, \frac {3}{4}-\frac {n}{2}\right ], \left [\frac {7}{4}-\frac {n}{2}\right ], \cos ^{2}\left (d x +c \right )\right ) \left (b \sec \left (d x +c \right )\right )^{n} \sin \left (d x +c \right )}{d \left (-4 n^{2}+4 n +3\right ) \sec \left (d x +c \right )^{\frac {3}{2}} \sqrt {2-2 \cos \left (2 d x +2 c \right )}}-\frac {4 B \hypergeom \left (\left [\frac {1}{2}, \frac {1}{4}-\frac {n}{2}\right ], \left [\frac {5}{4}-\frac {n}{2}\right ], \cos ^{2}\left (d x +c \right )\right ) \left (b \sec \left (d x +c \right )\right )^{n} \sin \left (d x +c \right )}{d \left (1-2 n \right ) \sqrt {\sec \left (d x +c \right )}\, \sqrt {2-2 \cos \left (2 d x +2 c \right )}} \]
command
Integrate[((b*Sec[c + d*x])^n*(A + B*Sec[c + d*x] + C*Sec[c + d*x]^2))/Sqrt[Sec[c + d*x]],x]
Mathematica 13.1 output
\[ -\frac {i 2^{\frac {3}{2}+n} e^{-\frac {1}{2} i (2 c+d (1+2 n) x)} \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{\frac {1}{2}+n} \left (1+e^{2 i (c+d x)}\right )^{\frac {1}{2}+n} \left (A e^{\frac {1}{2} i d (-1+2 n) x} \left (105+352 n+344 n^2+128 n^3+16 n^4\right ) \, _2F_1\left (\frac {3}{2}+n,\frac {1}{4} (-1+2 n);\frac {1}{4} (3+2 n);-e^{2 i (c+d x)}\right )+e^{i c} (-1+2 n) \left (2 B e^{\frac {1}{2} i d (1+2 n) x} \left (105+142 n+60 n^2+8 n^3\right ) \, _2F_1\left (\frac {3}{2}+n,\frac {1}{4} (1+2 n);\frac {1}{4} (5+2 n);-e^{2 i (c+d x)}\right )+e^{\frac {1}{2} i (2 c+d (3+2 n) x)} (1+2 n) \left (2 (A+2 C) \left (35+24 n+4 n^2\right ) \, _2F_1\left (\frac {3}{2}+n,\frac {1}{4} (3+2 n);\frac {1}{4} (7+2 n);-e^{2 i (c+d x)}\right )+e^{i (c+d x)} (3+2 n) \left (2 B (7+2 n) \, _2F_1\left (\frac {3}{2}+n,\frac {1}{4} (5+2 n);\frac {1}{4} (9+2 n);-e^{2 i (c+d x)}\right )+A e^{i (c+d x)} (5+2 n) \, _2F_1\left (\frac {3}{2}+n,\frac {1}{4} (7+2 n);\frac {1}{4} (11+2 n);-e^{2 i (c+d x)}\right )\right )\right )\right )\right ) \sec ^{-2-n}(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{d (-1+2 n) (1+2 n) (3+2 n) (5+2 n) (7+2 n) (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))} \]
Mathematica 12.3 output
\[ \text {\$Aborted} \]________________________________________________________________________________________