\(\int \cos ^3(c+d x) (a+a \sec (c+d x))^3 (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [327]

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

Optimal result

Integrand size = 40, antiderivative size = 117 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} a^3 (7 B+6 C) x+\frac {a^3 (B+3 C) \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^3 B \sin (c+d x)}{2 d}+\frac {a B \cos (c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {(B-2 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \] Output:

1/2*a^3*(7*B+6*C)*x+a^3*(B+3*C)*arctanh(sin(d*x+c))/d+5/2*a^3*B*sin(d*x+c) 
/d+1/2*a*B*cos(d*x+c)*(a+a*sec(d*x+c))^2*sin(d*x+c)/d-1/2*(B-2*C)*(a^3+a^3 
*sec(d*x+c))*sin(d*x+c)/d
                                                                                    
                                                                                    
 

Mathematica [B] (verified)

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

Time = 1.95 (sec) , antiderivative size = 272, normalized size of antiderivative = 2.32 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{32} a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (2 (7 B+6 C) x-\frac {4 (B+3 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 (B+3 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 (3 B+C) \cos (d x) \sin (c)}{d}+\frac {B \cos (2 d x) \sin (2 c)}{d}+\frac {4 (3 B+C) \cos (c) \sin (d x)}{d}+\frac {B \cos (2 c) \sin (2 d x)}{d}+\frac {4 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {4 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right ) \] Input:

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

Output:

(a^3*(1 + Cos[c + d*x])^3*Sec[(c + d*x)/2]^6*(2*(7*B + 6*C)*x - (4*(B + 3* 
C)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])/d + (4*(B + 3*C)*Log[Cos[(c + 
 d*x)/2] + Sin[(c + d*x)/2]])/d + (4*(3*B + C)*Cos[d*x]*Sin[c])/d + (B*Cos 
[2*d*x]*Sin[2*c])/d + (4*(3*B + C)*Cos[c]*Sin[d*x])/d + (B*Cos[2*c]*Sin[2* 
d*x])/d + (4*C*Sin[(d*x)/2])/(d*(Cos[c/2] - Sin[c/2])*(Cos[(c + d*x)/2] - 
Sin[(c + d*x)/2])) + (4*C*Sin[(d*x)/2])/(d*(Cos[c/2] + Sin[c/2])*(Cos[(c + 
 d*x)/2] + Sin[(c + d*x)/2]))))/32
 

Rubi [A] (verified)

Time = 0.80 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.99, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.225, Rules used = {3042, 4560, 3042, 4505, 3042, 4506, 3042, 4484, 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 ^3(c+d x) (a \sec (c+d x)+a)^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^3 \left (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 )^3}dx\)

\(\Big \downarrow \) 4560

\(\displaystyle \int \cos ^2(c+d x) (a \sec (c+d x)+a)^3 (B+C \sec (c+d x))dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4505

\(\displaystyle \frac {1}{2} \int \cos (c+d x) (\sec (c+d x) a+a)^2 (2 a (2 B+C)-a (B-2 C) \sec (c+d x))dx+\frac {a B \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^2}{2 d}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4506

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4484

\(\displaystyle \frac {1}{2} \left (-\int \left (-\left ((7 B+6 C) a^3\right )-2 (B+3 C) \sec (c+d x) a^3\right )dx-\frac {(B-2 C) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}+\frac {5 a^3 B \sin (c+d x)}{d}\right )+\frac {a B \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^2}{2 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {2 a^3 (B+3 C) \text {arctanh}(\sin (c+d x))}{d}-\frac {(B-2 C) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{d}+\frac {5 a^3 B \sin (c+d x)}{d}+a^3 x (7 B+6 C)\right )+\frac {a B \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^2}{2 d}\)

Input:

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

Output:

(a*B*Cos[c + d*x]*(a + a*Sec[c + d*x])^2*Sin[c + d*x])/(2*d) + (a^3*(7*B + 
 6*C)*x + (2*a^3*(B + 3*C)*ArcTanh[Sin[c + d*x]])/d + (5*a^3*B*Sin[c + d*x 
])/d - ((B - 2*C)*(a^3 + a^3*Sec[c + d*x])*Sin[c + d*x])/d)/2
 

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 4484
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]
 

rule 4505
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a*A*Cot 
[e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*n)), x] - Sim 
p[b/(a*d*n)   Int[(a + b*Csc[e + f*x])^(m - 1)*(d*Csc[e + f*x])^(n + 1)*Sim 
p[a*A*(m - n - 1) - b*B*n - (a*B*n + A*b*(m + n))*Csc[e + f*x], x], x], x] 
/; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0 
] && GtQ[m, 1/2] && LtQ[n, -1]
 

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

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

Time = 0.52 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.04

method result size
parallelrisch \(\frac {\left (-8 \cos \left (d x +c \right ) \left (B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+8 \cos \left (d x +c \right ) \left (B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+4 \left (3 B +C \right ) \sin \left (2 d x +2 c \right )+B \sin \left (3 d x +3 c \right )+28 d \left (B +\frac {6 C}{7}\right ) x \cos \left (d x +c \right )+\sin \left (d x +c \right ) \left (B +8 C \right )\right ) a^{3}}{8 d \cos \left (d x +c \right )}\) \(122\)
derivativedivides \(\frac {B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} C \tan \left (d x +c \right )+3 B \,a^{3} \left (d x +c \right )+3 a^{3} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \sin \left (d x +c \right )+3 a^{3} C \left (d x +c \right )+B \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{3} C \sin \left (d x +c \right )}{d}\) \(128\)
default \(\frac {B \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} C \tan \left (d x +c \right )+3 B \,a^{3} \left (d x +c \right )+3 a^{3} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{3} \sin \left (d x +c \right )+3 a^{3} C \left (d x +c \right )+B \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{3} C \sin \left (d x +c \right )}{d}\) \(128\)
risch \(\frac {7 a^{3} B x}{2}+3 a^{3} x C -\frac {i B \,a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {3 i B \,a^{3} {\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{3} C}{2 d}+\frac {3 i B \,a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{3} C}{2 d}+\frac {i B \,a^{3} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i a^{3} C}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) \(240\)
norman \(\frac {\left (\frac {7}{2} B \,a^{3}+3 a^{3} C \right ) x +\left (-\frac {21}{2} B \,a^{3}-9 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-\frac {21}{2} B \,a^{3}-9 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-\frac {7}{2} B \,a^{3}-3 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-\frac {7}{2} B \,a^{3}-3 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (\frac {7}{2} B \,a^{3}+3 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}+\left (\frac {21}{2} B \,a^{3}+9 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {21}{2} B \,a^{3}+9 a^{3} C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\frac {a^{3} \left (7 B +4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {5 B \,a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{d}-\frac {a^{3} \left (B +8 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {4 a^{3} \left (2 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {8 a^{3} \left (3 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {4 a^{3} \left (4 B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {a^{3} \left (11 B -4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4}}+\frac {a^{3} \left (B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{3} \left (B +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(445\)

Input:

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

Output:

1/8*(-8*cos(d*x+c)*(B+3*C)*ln(tan(1/2*d*x+1/2*c)-1)+8*cos(d*x+c)*(B+3*C)*l 
n(tan(1/2*d*x+1/2*c)+1)+4*(3*B+C)*sin(2*d*x+2*c)+B*sin(3*d*x+3*c)+28*d*(B+ 
6/7*C)*x*cos(d*x+c)+sin(d*x+c)*(B+8*C))*a^3/d/cos(d*x+c)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.09 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (7 \, B + 6 \, C\right )} a^{3} d x \cos \left (d x + c\right ) + {\left (B + 3 \, C\right )} a^{3} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B + 3 \, C\right )} a^{3} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (B a^{3} \cos \left (d x + c\right )^{2} + 2 \, {\left (3 \, B + C\right )} a^{3} \cos \left (d x + c\right ) + 2 \, C a^{3}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:

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

Output:

1/2*((7*B + 6*C)*a^3*d*x*cos(d*x + c) + (B + 3*C)*a^3*cos(d*x + c)*log(sin 
(d*x + c) + 1) - (B + 3*C)*a^3*cos(d*x + c)*log(-sin(d*x + c) + 1) + (B*a^ 
3*cos(d*x + c)^2 + 2*(3*B + C)*a^3*cos(d*x + c) + 2*C*a^3)*sin(d*x + c))/( 
d*cos(d*x + c))
 

Sympy [F(-1)]

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

integrate(cos(d*x+c)**3*(a+a*sec(d*x+c))**3*(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 = 140, normalized size of antiderivative = 1.20 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{3} + 12 \, {\left (d x + c\right )} B a^{3} + 12 \, {\left (d x + c\right )} C a^{3} + 2 \, B a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, C a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, B a^{3} \sin \left (d x + c\right ) + 4 \, C a^{3} \sin \left (d x + c\right ) + 4 \, C a^{3} \tan \left (d x + c\right )}{4 \, d} \] Input:

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

Output:

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*B*a^3 + 12*(d*x + c)*B*a^3 + 12*(d*x 
 + c)*C*a^3 + 2*B*a^3*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 6* 
C*a^3*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 12*B*a^3*sin(d*x + 
 c) + 4*C*a^3*sin(d*x + c) + 4*C*a^3*tan(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.64 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {\frac {4 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - {\left (7 \, B a^{3} + 6 \, C a^{3}\right )} {\left (d x + c\right )} - 2 \, {\left (B a^{3} + 3 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + 2 \, {\left (B a^{3} + 3 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (5 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 7 \, B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, C 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 )}^{2}}}{2 \, d} \] Input:

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

Output:

-1/2*(4*C*a^3*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 1) - (7*B*a^3 
 + 6*C*a^3)*(d*x + c) - 2*(B*a^3 + 3*C*a^3)*log(abs(tan(1/2*d*x + 1/2*c) + 
 1)) + 2*(B*a^3 + 3*C*a^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(5*B*a^3 
*tan(1/2*d*x + 1/2*c)^3 + 2*C*a^3*tan(1/2*d*x + 1/2*c)^3 + 7*B*a^3*tan(1/2 
*d*x + 1/2*c) + 2*C*a^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1) 
^2)/d
 

Mupad [B] (verification not implemented)

Time = 11.75 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.68 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3\,B\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {7\,B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,C\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,C\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {C\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {B\,a^3\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d} \] Input:

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

Output:

(3*B*a^3*sin(c + d*x))/d + (C*a^3*sin(c + d*x))/d + (7*B*a^3*atan(sin(c/2 
+ (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*a^3*atanh(sin(c/2 + (d*x)/2)/cos( 
c/2 + (d*x)/2)))/d + (6*C*a^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))) 
/d + (6*C*a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (C*a^3*sin 
(c + d*x))/(d*cos(c + d*x)) + (B*a^3*cos(c + d*x)*sin(c + d*x))/(2*d)
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.73 \[ \int \cos ^3(c+d x) (a+a \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a^{3} \left (-2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b -6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) c +2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b +6 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) c +6 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b +2 \cos \left (d x +c \right ) \sin \left (d x +c \right ) c +7 \cos \left (d x +c \right ) b c +7 \cos \left (d x +c \right ) b d x +6 \cos \left (d x +c \right ) c^{2}+6 \cos \left (d x +c \right ) c d x -\sin \left (d x +c \right )^{3} b +\sin \left (d x +c \right ) b +2 \sin \left (d x +c \right ) c \right )}{2 \cos \left (d x +c \right ) d} \] Input:

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

Output:

(a**3*( - 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b - 6*cos(c + d*x)*log( 
tan((c + d*x)/2) - 1)*c + 2*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*b + 6*c 
os(c + d*x)*log(tan((c + d*x)/2) + 1)*c + 6*cos(c + d*x)*sin(c + d*x)*b + 
2*cos(c + d*x)*sin(c + d*x)*c + 7*cos(c + d*x)*b*c + 7*cos(c + d*x)*b*d*x 
+ 6*cos(c + d*x)*c**2 + 6*cos(c + d*x)*c*d*x - sin(c + d*x)**3*b + sin(c + 
 d*x)*b + 2*sin(c + d*x)*c))/(2*cos(c + d*x)*d)