\(\int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx\) [64]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 125 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {5 a^3 (4 A+3 B) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a^3 (4 A+3 B) \tan (c+d x)}{d}+\frac {3 a^3 (4 A+3 B) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {B (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {a^3 (4 A+3 B) \tan ^3(c+d x)}{12 d} \] Output:

5/8*a^3*(4*A+3*B)*arctanh(sin(d*x+c))/d+a^3*(4*A+3*B)*tan(d*x+c)/d+3/8*a^3 
*(4*A+3*B)*sec(d*x+c)*tan(d*x+c)/d+1/4*B*(a+a*sec(d*x+c))^3*tan(d*x+c)/d+1 
/12*a^3*(4*A+3*B)*tan(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 1.37 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.73 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^3 \left (24 A \coth ^{-1}(\sin (c+d x))+9 (4 A+5 B) \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (96 (A+B)+9 (4 A+5 B) \sec (c+d x)+6 B \sec ^3(c+d x)+8 (A+3 B) \tan ^2(c+d x)\right )\right )}{24 d} \] Input:

Integrate[Sec[c + d*x]*(a + a*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]
 

Output:

(a^3*(24*A*ArcCoth[Sin[c + d*x]] + 9*(4*A + 5*B)*ArcTanh[Sin[c + d*x]] + T 
an[c + d*x]*(96*(A + B) + 9*(4*A + 5*B)*Sec[c + d*x] + 6*B*Sec[c + d*x]^3 
+ 8*(A + 3*B)*Tan[c + d*x]^2)))/(24*d)
 

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.88, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {3042, 4489, 3042, 4278, 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 \sec (c+d x) (a \sec (c+d x)+a)^3 (A+B \sec (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4489

\(\displaystyle \frac {1}{4} (4 A+3 B) \int \sec (c+d x) (\sec (c+d x) a+a)^3dx+\frac {B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4278

\(\displaystyle \frac {1}{4} (4 A+3 B) \int \left (a^3 \sec ^4(c+d x)+3 a^3 \sec ^3(c+d x)+3 a^3 \sec ^2(c+d x)+a^3 \sec (c+d x)\right )dx+\frac {B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{4} (4 A+3 B) \left (\frac {5 a^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^3 \tan ^3(c+d x)}{3 d}+\frac {4 a^3 \tan (c+d x)}{d}+\frac {3 a^3 \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}\)

Input:

Int[Sec[c + d*x]*(a + a*Sec[c + d*x])^3*(A + B*Sec[c + d*x]),x]
 

Output:

(B*(a + a*Sec[c + d*x])^3*Tan[c + d*x])/(4*d) + ((4*A + 3*B)*((5*a^3*ArcTa 
nh[Sin[c + d*x]])/(2*d) + (4*a^3*Tan[c + d*x])/d + (3*a^3*Sec[c + d*x]*Tan 
[c + d*x])/(2*d) + (a^3*Tan[c + d*x]^3)/(3*d)))/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 4278
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_), x_Symbol] :> Int[ExpandTrig[(a + b*csc[e + f*x])^m*(d*csc[e + f 
*x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] && I 
GtQ[m, 0] && RationalQ[n]
 

rule 4489
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( 
a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[(a*B*m + A*b*(m + 1))/(b*(m + 
 1))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x], x] /; FreeQ[{a, b, A, B 
, e, f, m}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[a*B*m + A*b 
*(m + 1), 0] &&  !LtQ[m, -2^(-1)]
 
Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.40

method result size
norman \(\frac {-\frac {73 a^{3} \left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}+\frac {55 a^{3} \left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}-\frac {5 a^{3} \left (4 A +3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {a^{3} \left (44 A +49 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4}}-\frac {5 a^{3} \left (4 A +3 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {5 a^{3} \left (4 A +3 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(175\)
parallelrisch \(\frac {26 a^{3} \left (-\frac {15 \left (A +\frac {3 B}{4}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{13}+\frac {15 \left (A +\frac {3 B}{4}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{13}+\left (A +\frac {15 B}{13}\right ) \sin \left (2 d x +2 c \right )+\frac {9 \left (A +\frac {5 B}{4}\right ) \sin \left (3 d x +3 c \right )}{26}+\frac {\left (11 A +9 B \right ) \sin \left (4 d x +4 c \right )}{26}+\frac {9 \sin \left (d x +c \right ) \left (A +\frac {23 B}{12}\right )}{26}\right )}{3 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) \(178\)
parts \(-\frac {\left (a^{3} A +3 B \,a^{3}\right ) \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (3 a^{3} A +B \,a^{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (3 a^{3} A +3 B \,a^{3}\right ) \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 )}{d}+\frac {B \,a^{3} \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}+\frac {A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right ) a^{3}}{d}\) \(181\)
derivativedivides \(\frac {a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \tan \left (d x +c \right )+3 B \,a^{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 )+3 a^{3} A \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 )-3 B \,a^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-a^{3} A \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+B \,a^{3} \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}\) \(219\)
default \(\frac {a^{3} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{3} \tan \left (d x +c \right )+3 a^{3} A \tan \left (d x +c \right )+3 B \,a^{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 )+3 a^{3} A \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 )-3 B \,a^{3} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-a^{3} A \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+B \,a^{3} \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}\) \(219\)
risch \(-\frac {i a^{3} \left (36 A \,{\mathrm e}^{7 i \left (d x +c \right )}+45 B \,{\mathrm e}^{7 i \left (d x +c \right )}-72 A \,{\mathrm e}^{6 i \left (d x +c \right )}-24 B \,{\mathrm e}^{6 i \left (d x +c \right )}+36 A \,{\mathrm e}^{5 i \left (d x +c \right )}+69 B \,{\mathrm e}^{5 i \left (d x +c \right )}-264 A \,{\mathrm e}^{4 i \left (d x +c \right )}-216 B \,{\mathrm e}^{4 i \left (d x +c \right )}-36 A \,{\mathrm e}^{3 i \left (d x +c \right )}-69 B \,{\mathrm e}^{3 i \left (d x +c \right )}-280 A \,{\mathrm e}^{2 i \left (d x +c \right )}-264 B \,{\mathrm e}^{2 i \left (d x +c \right )}-36 \,{\mathrm e}^{i \left (d x +c \right )} A -45 B \,{\mathrm e}^{i \left (d x +c \right )}-88 A -72 B \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {5 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}+\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{8 d}-\frac {5 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}-\frac {15 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{8 d}\) \(287\)

Input:

int(sec(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE 
)
 

Output:

(-73/12*a^3*(4*A+3*B)/d*tan(1/2*d*x+1/2*c)^3+55/12*a^3*(4*A+3*B)/d*tan(1/2 
*d*x+1/2*c)^5-5/4*a^3*(4*A+3*B)/d*tan(1/2*d*x+1/2*c)^7+1/4*a^3*(44*A+49*B) 
/d*tan(1/2*d*x+1/2*c))/(tan(1/2*d*x+1/2*c)^2-1)^4-5/8*a^3*(4*A+3*B)/d*ln(t 
an(1/2*d*x+1/2*c)-1)+5/8*a^3*(4*A+3*B)/d*ln(tan(1/2*d*x+1/2*c)+1)
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.16 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (4 \, A + 3 \, B\right )} a^{3} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, A + 3 \, B\right )} a^{3} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (11 \, A + 9 \, B\right )} a^{3} \cos \left (d x + c\right )^{3} + 9 \, {\left (4 \, A + 5 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} + 8 \, {\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right ) + 6 \, B a^{3}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \] Input:

integrate(sec(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="fri 
cas")
 

Output:

1/48*(15*(4*A + 3*B)*a^3*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 15*(4*A + 
3*B)*a^3*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(8*(11*A + 9*B)*a^3*cos 
(d*x + c)^3 + 9*(4*A + 5*B)*a^3*cos(d*x + c)^2 + 8*(A + 3*B)*a^3*cos(d*x + 
 c) + 6*B*a^3)*sin(d*x + c))/(d*cos(d*x + c)^4)
 

Sympy [F]

\[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=a^{3} \left (\int A \sec {\left (c + d x \right )}\, dx + \int 3 A \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 A \sec ^{3}{\left (c + d x \right )}\, dx + \int A \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 B \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 B \sec ^{4}{\left (c + d x \right )}\, dx + \int B \sec ^{5}{\left (c + d x \right )}\, dx\right ) \] Input:

integrate(sec(d*x+c)*(a+a*sec(d*x+c))**3*(A+B*sec(d*x+c)),x)
 

Output:

a**3*(Integral(A*sec(c + d*x), x) + Integral(3*A*sec(c + d*x)**2, x) + Int 
egral(3*A*sec(c + d*x)**3, x) + Integral(A*sec(c + d*x)**4, x) + Integral( 
B*sec(c + d*x)**2, x) + Integral(3*B*sec(c + d*x)**3, x) + Integral(3*B*se 
c(c + d*x)**4, x) + Integral(B*sec(c + d*x)**5, x))
 

Maxima [B] (verification not implemented)

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

Time = 0.04 (sec) , antiderivative size = 262, normalized size of antiderivative = 2.10 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a^{3} + 48 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{3} - 3 \, B a^{3} {\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 )} - 36 \, A a^{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 )} - 36 \, B a^{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 )} + 48 \, A a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 144 \, A a^{3} \tan \left (d x + c\right ) + 48 \, B a^{3} \tan \left (d x + c\right )}{48 \, d} \] Input:

integrate(sec(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="max 
ima")
 

Output:

1/48*(16*(tan(d*x + c)^3 + 3*tan(d*x + c))*A*a^3 + 48*(tan(d*x + c)^3 + 3* 
tan(d*x + c))*B*a^3 - 3*B*a^3*(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)) - 36*A*a^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d* 
x + c) + 1) + log(sin(d*x + c) - 1)) - 36*B*a^3*(2*sin(d*x + c)/(sin(d*x + 
 c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 48*A*a^3*log 
(sec(d*x + c) + tan(d*x + c)) + 144*A*a^3*tan(d*x + c) + 48*B*a^3*tan(d*x 
+ c))/d
 

Giac [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.70 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (4 \, A a^{3} + 3 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, A a^{3} + 3 \, B a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (60 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 45 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 220 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 165 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 292 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 219 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 132 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 147 \, B a^{3} \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(sec(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x, algorithm="gia 
c")
 

Output:

1/24*(15*(4*A*a^3 + 3*B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(4*A* 
a^3 + 3*B*a^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(60*A*a^3*tan(1/2*d* 
x + 1/2*c)^7 + 45*B*a^3*tan(1/2*d*x + 1/2*c)^7 - 220*A*a^3*tan(1/2*d*x + 1 
/2*c)^5 - 165*B*a^3*tan(1/2*d*x + 1/2*c)^5 + 292*A*a^3*tan(1/2*d*x + 1/2*c 
)^3 + 219*B*a^3*tan(1/2*d*x + 1/2*c)^3 - 132*A*a^3*tan(1/2*d*x + 1/2*c) - 
147*B*a^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d
 

Mupad [B] (verification not implemented)

Time = 13.68 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.48 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {\left (-5\,A\,a^3-\frac {15\,B\,a^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {55\,A\,a^3}{3}+\frac {55\,B\,a^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {73\,A\,a^3}{3}-\frac {73\,B\,a^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (11\,A\,a^3+\frac {49\,B\,a^3}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {5\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,A+3\,B\right )}{4\,d} \] Input:

int(((A + B/cos(c + d*x))*(a + a/cos(c + d*x))^3)/cos(c + d*x),x)
 

Output:

(tan(c/2 + (d*x)/2)*(11*A*a^3 + (49*B*a^3)/4) - tan(c/2 + (d*x)/2)^7*(5*A* 
a^3 + (15*B*a^3)/4) + tan(c/2 + (d*x)/2)^5*((55*A*a^3)/3 + (55*B*a^3)/4) - 
 tan(c/2 + (d*x)/2)^3*((73*A*a^3)/3 + (73*B*a^3)/4))/(d*(6*tan(c/2 + (d*x) 
/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/ 
2)^8 + 1)) + (5*a^3*atanh(tan(c/2 + (d*x)/2))*(4*A + 3*B))/(4*d)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 379, normalized size of antiderivative = 3.03 \[ \int \sec (c+d x) (a+a \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx=\frac {a^{3} \left (-88 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a -72 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b +96 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a +96 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4} a -45 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4} b +120 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a +90 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b -60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a -45 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b +60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4} a +45 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4} b -120 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a -90 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b +60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a +45 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b -36 \sin \left (d x +c \right )^{3} a -45 \sin \left (d x +c \right )^{3} b +36 \sin \left (d x +c \right ) a +51 \sin \left (d x +c \right ) b \right )}{24 d \left (\sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{2}+1\right )} \] Input:

int(sec(d*x+c)*(a+a*sec(d*x+c))^3*(A+B*sec(d*x+c)),x)
 

Output:

(a**3*( - 88*cos(c + d*x)*sin(c + d*x)**3*a - 72*cos(c + d*x)*sin(c + d*x) 
**3*b + 96*cos(c + d*x)*sin(c + d*x)*a + 96*cos(c + d*x)*sin(c + d*x)*b - 
60*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a - 45*log(tan((c + d*x)/2) - 
 1)*sin(c + d*x)**4*b + 120*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a + 
90*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b - 60*log(tan((c + d*x)/2) - 
 1)*a - 45*log(tan((c + d*x)/2) - 1)*b + 60*log(tan((c + d*x)/2) + 1)*sin( 
c + d*x)**4*a + 45*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*b - 120*log(t 
an((c + d*x)/2) + 1)*sin(c + d*x)**2*a - 90*log(tan((c + d*x)/2) + 1)*sin( 
c + d*x)**2*b + 60*log(tan((c + d*x)/2) + 1)*a + 45*log(tan((c + d*x)/2) + 
 1)*b - 36*sin(c + d*x)**3*a - 45*sin(c + d*x)**3*b + 36*sin(c + d*x)*a + 
51*sin(c + d*x)*b))/(24*d*(sin(c + d*x)**4 - 2*sin(c + d*x)**2 + 1))