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

Optimal result
Mathematica [A] (verified)
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 = 41, antiderivative size = 184 \[ \int (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {\left (8 a b B+4 b^2 (A+2 C)+a^2 (3 A+4 C)\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {\left (4 a A b+2 a^2 B+3 b^2 B+6 a b C\right ) \tan (c+d x)}{3 d}+\frac {\left (2 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (A b+2 a B) \sec ^2(c+d x) \tan (c+d x)}{6 d}+\frac {A (a+b \cos (c+d x))^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \] Output:

1/8*(8*B*a*b+4*b^2*(A+2*C)+a^2*(3*A+4*C))*arctanh(sin(d*x+c))/d+1/3*(4*A*a 
*b+2*B*a^2+3*B*b^2+6*C*a*b)*tan(d*x+c)/d+1/8*(2*A*b^2+8*B*a*b+a^2*(3*A+4*C 
))*sec(d*x+c)*tan(d*x+c)/d+1/6*a*(A*b+2*B*a)*sec(d*x+c)^2*tan(d*x+c)/d+1/4 
*A*(a+b*cos(d*x+c))^2*sec(d*x+c)^3*tan(d*x+c)/d
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

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

Integrate[(a + b*Cos[c + d*x])^2*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*S 
ec[c + d*x]^5,x]
 

Output:

(24*b^2*C*ArcCoth[Sin[c + d*x]] + 3*(4*A*b^2 + 8*a*b*B + a^2*(3*A + 4*C))* 
ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(3*(4*A*b^2 + 8*a*b*B + a^2*(3*A + 4* 
C))*Sec[c + d*x] + 6*a^2*A*Sec[c + d*x]^3 + 8*(3*a^2*B + 3*b^2*B + 6*a*b*( 
A + C) + a*(2*A*b + a*B)*Tan[c + d*x]^2)))/(24*d)
 

Rubi [A] (verified)

Time = 1.22 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.06, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.317, Rules used = {3042, 3526, 3042, 3510, 25, 3042, 3500, 3042, 3227, 3042, 4254, 24, 4257}

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 ^5(c+d x) (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3526

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3510

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3500

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3227

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4254

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

\(\Big \downarrow \) 24

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

(A*(a + b*Cos[c + d*x])^2*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + ((2*a*(A*b 
+ 2*a*B)*Sec[c + d*x]^2*Tan[c + d*x])/(3*d) + ((3*(2*A*b^2 + 8*a*b*B + a^2 
*(3*A + 4*C))*Sec[c + d*x]*Tan[c + d*x])/(2*d) + ((3*(8*a*b*B + 4*b^2*(A + 
 2*C) + a^2*(3*A + 4*C))*ArcTanh[Sin[c + d*x]])/d + (8*(4*a*A*b + 2*a^2*B 
+ 3*b^2*B + 6*a*b*C)*Tan[c + d*x])/d)/2)/3)/4
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 

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

rule 3510
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f 
_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)*Cos[ 
e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - S 
imp[1/(b^2*(m + 1)*(a^2 - b^2))   Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*( 
m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d + b^2*d*(m 
 + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1)) 
))*Sin[e + f*x] - b*C*d*(m + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; F 
reeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 
 0] && LtQ[m, -1]
 

rule 3526
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) 
 + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(c^2*C - B*c*d + A*d^2))*Cos[e + f*x 
]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - 
d^2))), x] + Simp[1/(d*(n + 1)*(c^2 - d^2))   Int[(a + b*Sin[e + f*x])^(m - 
 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A*d*(b*d*m + a*c*(n + 1)) + (c*C - B* 
d)*(b*c*m + a*d*(n + 1)) - (d*(A*(a*d*(n + 2) - b*c*(n + 1)) + B*(b*d*(n + 
1) - a*c*(n + 2))) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x 
] + b*(d*(B*c - A*d)*(m + n + 2) - C*(c^2*(m + 1) + d^2*(n + 1)))*Sin[e + f 
*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d 
, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 1.01 (sec) , antiderivative size = 182, normalized size of antiderivative = 0.99

method result size
parts \(\frac {A \,a^{2} \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 {\left (2 a A b +B \,a^{2}\right ) \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (B \,b^{2}+2 a b C \right ) \tan \left (d x +c \right )}{d}+\frac {\left (A \,b^{2}+2 B a b +a^{2} C \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 {C \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(182\)
derivativedivides \(\frac {A \,a^{2} \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 )-B \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+a^{2} C \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 )-2 a A b \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 B a b \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 )+2 C \tan \left (d x +c \right ) a b +A \,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 )+B \tan \left (d x +c \right ) b^{2}+C \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(251\)
default \(\frac {A \,a^{2} \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 )-B \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+a^{2} C \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 )-2 a A b \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 B a b \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 )+2 C \tan \left (d x +c \right ) a b +A \,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 )+B \tan \left (d x +c \right ) b^{2}+C \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(251\)
parallelrisch \(\frac {-9 \left (\left (A +\frac {4 C}{3}\right ) a^{2}+\frac {8 B a b}{3}+\frac {4 b^{2} \left (A +2 C \right )}{3}\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 )+9 \left (\left (A +\frac {4 C}{3}\right ) a^{2}+\frac {8 B a b}{3}+\frac {4 b^{2} \left (A +2 C \right )}{3}\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 )+\left (64 B \,a^{2}+128 a \left (A +\frac {3 C}{4}\right ) b +48 B \,b^{2}\right ) \sin \left (2 d x +2 c \right )+\left (\left (18 A +24 C \right ) a^{2}+48 B a b +24 A \,b^{2}\right ) \sin \left (3 d x +3 c \right )+\left (16 B \,a^{2}+32 b \left (A +\frac {3 C}{2}\right ) a +24 B \,b^{2}\right ) \sin \left (4 d x +4 c \right )+66 \sin \left (d x +c \right ) \left (\left (A +\frac {4 C}{11}\right ) a^{2}+\frac {8 B a b}{11}+\frac {4 A \,b^{2}}{11}\right )}{24 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) \(279\)
norman \(\frac {\frac {\left (5 A \,a^{2}-16 a A b +4 A \,b^{2}-8 B \,a^{2}+8 B a b -8 B \,b^{2}+4 a^{2} C -16 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{15}}{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 \,b^{2}+4 a^{2} C +16 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (45 A \,a^{2}-16 a A b +4 A \,b^{2}-8 B \,a^{2}+8 B a b +24 B \,b^{2}+4 a^{2} C +48 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (45 A \,a^{2}+16 a A b +4 A \,b^{2}+8 B \,a^{2}+8 B a b -24 B \,b^{2}+4 a^{2} C -48 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}+\frac {\left (69 A \,a^{2}-112 a A b +36 A \,b^{2}-56 B \,a^{2}+72 B a b -24 B \,b^{2}+36 a^{2} C -48 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{12 d}+\frac {\left (69 A \,a^{2}+112 a A b +36 A \,b^{2}+56 B \,a^{2}+72 B a b +24 B \,b^{2}+36 a^{2} C +48 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}+\frac {\left (165 A \,a^{2}-16 a A b -60 A \,b^{2}-8 B \,a^{2}-120 B a b -72 B \,b^{2}-60 a^{2} C -144 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{12 d}+\frac {\left (165 A \,a^{2}+16 a A b -60 A \,b^{2}+8 B \,a^{2}-120 B a b +72 B \,b^{2}-60 a^{2} C +144 a b C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{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 )^{4}}-\frac {\left (3 A \,a^{2}+4 A \,b^{2}+8 B a b +4 a^{2} C +8 C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (3 A \,a^{2}+4 A \,b^{2}+8 B a b +4 a^{2} C +8 C \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(622\)
risch \(-\frac {i \left (-48 a b C -32 a A b -16 B \,a^{2}-24 B \,b^{2}-96 A a b \,{\mathrm e}^{4 i \left (d x +c \right )}-144 C a b \,{\mathrm e}^{4 i \left (d x +c \right )}-24 B a b \,{\mathrm e}^{3 i \left (d x +c \right )}-128 A a b \,{\mathrm e}^{2 i \left (d x +c \right )}-144 C a b \,{\mathrm e}^{2 i \left (d x +c \right )}-24 B a b \,{\mathrm e}^{i \left (d x +c \right )}+24 B a b \,{\mathrm e}^{7 i \left (d x +c \right )}-48 C a b \,{\mathrm e}^{6 i \left (d x +c \right )}+24 B a b \,{\mathrm e}^{5 i \left (d x +c \right )}-24 B \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+33 A \,a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-72 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+12 A \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-64 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+9 A \,a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+12 A \,b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-72 B \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 C \,a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-48 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-12 A \,b^{2} {\mathrm e}^{i \left (d x +c \right )}-12 C \,a^{2} {\mathrm e}^{i \left (d x +c \right )}+12 C \,a^{2} {\mathrm e}^{7 i \left (d x +c \right )}-12 A \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-33 A \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-9 A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}-12 C \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {3 A \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{2}}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2} C}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C \,b^{2}}{d}+\frac {3 A \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2} C}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C \,b^{2}}{d}\) \(641\)

Input:

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

Output:

A*a^2/d*(-(-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)))-(2*A*a*b+B*a^2)/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+(B*b^2+2 
*C*a*b)/d*tan(d*x+c)+(A*b^2+2*B*a*b+C*a^2)/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/ 
2*ln(sec(d*x+c)+tan(d*x+c)))+C*b^2/d*ln(sec(d*x+c)+tan(d*x+c))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 209, normalized size of antiderivative = 1.14 \[ \int (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {3 \, {\left ({\left (3 \, A + 4 \, C\right )} a^{2} + 8 \, B a b + 4 \, {\left (A + 2 \, C\right )} b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left ({\left (3 \, A + 4 \, C\right )} a^{2} + 8 \, B a b + 4 \, {\left (A + 2 \, C\right )} b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (2 \, B a^{2} + 2 \, {\left (2 \, A + 3 \, C\right )} a b + 3 \, B b^{2}\right )} \cos \left (d x + c\right )^{3} + 6 \, A a^{2} + 3 \, {\left ({\left (3 \, A + 4 \, C\right )} a^{2} + 8 \, B a b + 4 \, A b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, {\left (B a^{2} + 2 \, A a b\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((a+b*cos(d*x+c))^2*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^5, 
x, algorithm="fricas")
 

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 313, normalized size of antiderivative = 1.70 \[ \int (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} + 32 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a b - 3 \, A a^{2} {\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 )} - 12 \, C a^{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 )} - 24 \, B a b {\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^{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 )} + 24 \, C b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 96 \, C a b \tan \left (d x + c\right ) + 48 \, B b^{2} \tan \left (d x + c\right )}{48 \, d} \] Input:

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

Output:

1/48*(16*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a^2 + 32*(tan(d*x + c)^3 + 3* 
tan(d*x + c))*A*a*b - 3*A*a^2*(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)) - 12*C*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d* 
x + c) + 1) + log(sin(d*x + c) - 1)) - 24*B*a*b*(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^2*(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*b^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 96*C 
*a*b*tan(d*x + c) + 48*B*b^2*tan(d*x + c))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 630 vs. \(2 (174) = 348\).

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

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

Output:

1/24*(3*(3*A*a^2 + 4*C*a^2 + 8*B*a*b + 4*A*b^2 + 8*C*b^2)*log(abs(tan(1/2* 
d*x + 1/2*c) + 1)) - 3*(3*A*a^2 + 4*C*a^2 + 8*B*a*b + 4*A*b^2 + 8*C*b^2)*l 
og(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(15*A*a^2*tan(1/2*d*x + 1/2*c)^7 - 2 
4*B*a^2*tan(1/2*d*x + 1/2*c)^7 + 12*C*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 - 48*C*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 - 12*C*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 + 144*C*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*t 
an(1/2*d*x + 1/2*c)^3 - 40*B*a^2*tan(1/2*d*x + 1/2*c)^3 - 12*C*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 - 144*C*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) + 2 
4*B*a^2*tan(1/2*d*x + 1/2*c) + 12*C*a^2*tan(1/2*d*x + 1/2*c) + 48*A*a*b*ta 
n(1/2*d*x + 1/2*c) + 24*B*a*b*tan(1/2*d*x + 1/2*c) + 48*C*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
 

Mupad [B] (verification not implemented)

Time = 2.87 (sec) , antiderivative size = 389, normalized size of antiderivative = 2.11 \[ \int (a+b \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {\left (\frac {5\,A\,a^2}{4}+A\,b^2-2\,B\,a^2-2\,B\,b^2+C\,a^2-4\,A\,a\,b+2\,B\,a\,b-4\,C\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {3\,A\,a^2}{4}-A\,b^2+\frac {10\,B\,a^2}{3}+6\,B\,b^2-C\,a^2+\frac {20\,A\,a\,b}{3}-2\,B\,a\,b+12\,C\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {3\,A\,a^2}{4}-A\,b^2-\frac {10\,B\,a^2}{3}-6\,B\,b^2-C\,a^2-\frac {20\,A\,a\,b}{3}-2\,B\,a\,b-12\,C\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {5\,A\,a^2}{4}+A\,b^2+2\,B\,a^2+2\,B\,b^2+C\,a^2+4\,A\,a\,b+2\,B\,a\,b+4\,C\,a\,b\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 {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,A\,a^2}{8}+\frac {A\,b^2}{2}+\frac {C\,a^2}{2}+C\,b^2+B\,a\,b\right )}{\frac {3\,A\,a^2}{2}+2\,A\,b^2+2\,C\,a^2+4\,C\,b^2+4\,B\,a\,b}\right )\,\left (\frac {3\,A\,a^2}{4}+A\,b^2+C\,a^2+2\,C\,b^2+2\,B\,a\,b\right )}{d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)^7*((5*A*a^2)/4 + A*b^2 - 2*B*a^2 - 2*B*b^2 + C*a^2 - 4 
*A*a*b + 2*B*a*b - 4*C*a*b) - tan(c/2 + (d*x)/2)^3*(A*b^2 - (3*A*a^2)/4 + 
(10*B*a^2)/3 + 6*B*b^2 + C*a^2 + (20*A*a*b)/3 + 2*B*a*b + 12*C*a*b) + tan( 
c/2 + (d*x)/2)^5*((3*A*a^2)/4 - A*b^2 + (10*B*a^2)/3 + 6*B*b^2 - C*a^2 + ( 
20*A*a*b)/3 - 2*B*a*b + 12*C*a*b) + tan(c/2 + (d*x)/2)*((5*A*a^2)/4 + A*b^ 
2 + 2*B*a^2 + 2*B*b^2 + C*a^2 + 4*A*a*b + 2*B*a*b + 4*C*a*b))/(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)) + (atanh((4*tan(c/2 + (d*x)/2)*((3*A*a^2)/8 + (A*b^2)/ 
2 + (C*a^2)/2 + C*b^2 + B*a*b))/((3*A*a^2)/2 + 2*A*b^2 + 2*C*a^2 + 4*C*b^2 
 + 4*B*a*b))*((3*A*a^2)/4 + A*b^2 + C*a^2 + 2*C*b^2 + 2*B*a*b))/d
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**3 - 4*cos( 
c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**2*c - 12*cos(c + d*x 
)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a*b**2 - 8*cos(c + d*x)*log(ta 
n((c + d*x)/2) - 1)*sin(c + d*x)**4*b**2*c + 6*cos(c + d*x)*log(tan((c + d 
*x)/2) - 1)*sin(c + d*x)**2*a**3 + 8*cos(c + d*x)*log(tan((c + d*x)/2) - 1 
)*sin(c + d*x)**2*a**2*c + 24*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c 
 + d*x)**2*a*b**2 + 16*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x) 
**2*b**2*c - 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a**3 - 4*cos(c + d*x 
)*log(tan((c + d*x)/2) - 1)*a**2*c - 12*cos(c + d*x)*log(tan((c + d*x)/2) 
- 1)*a*b**2 - 8*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b**2*c + 3*cos(c + 
d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**3 + 4*cos(c + d*x)*log(t 
an((c + d*x)/2) + 1)*sin(c + d*x)**4*a**2*c + 12*cos(c + d*x)*log(tan((c + 
 d*x)/2) + 1)*sin(c + d*x)**4*a*b**2 + 8*cos(c + d*x)*log(tan((c + d*x)/2) 
 + 1)*sin(c + d*x)**4*b**2*c - 6*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*si 
n(c + d*x)**2*a**3 - 8*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x) 
**2*a**2*c - 24*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a*b 
**2 - 16*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**2*c + 3 
*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**3 + 4*cos(c + d*x)*log(tan((c + 
 d*x)/2) + 1)*a**2*c + 12*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a*b**2 + 
8*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*b**2*c - 3*cos(c + d*x)*sin(c ...