\(\int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) [86]

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 [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 258 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {a^4 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {3 a^2 b^2 \text {arctanh}(\sin (c+d x))}{4 d}+\frac {b^4 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {4 a^3 b \sec ^3(c+d x)}{3 d}-\frac {4 a b^3 \sec ^3(c+d x)}{3 d}+\frac {4 a b^3 \sec ^5(c+d x)}{5 d}+\frac {a^4 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {3 a^2 b^2 \sec (c+d x) \tan (c+d x)}{4 d}+\frac {b^4 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {3 a^2 b^2 \sec ^3(c+d x) \tan (c+d x)}{2 d}-\frac {b^4 \sec ^3(c+d x) \tan (c+d x)}{8 d}+\frac {b^4 \sec ^3(c+d x) \tan ^3(c+d x)}{6 d} \] Output:

1/2*a^4*arctanh(sin(d*x+c))/d-3/4*a^2*b^2*arctanh(sin(d*x+c))/d+1/16*b^4*a 
rctanh(sin(d*x+c))/d+4/3*a^3*b*sec(d*x+c)^3/d-4/3*a*b^3*sec(d*x+c)^3/d+4/5 
*a*b^3*sec(d*x+c)^5/d+1/2*a^4*sec(d*x+c)*tan(d*x+c)/d-3/4*a^2*b^2*sec(d*x+ 
c)*tan(d*x+c)/d+1/16*b^4*sec(d*x+c)*tan(d*x+c)/d+3/2*a^2*b^2*sec(d*x+c)^3* 
tan(d*x+c)/d-1/8*b^4*sec(d*x+c)^3*tan(d*x+c)/d+1/6*b^4*sec(d*x+c)^3*tan(d* 
x+c)^3/d
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(1342\) vs. \(2(258)=516\).

Time = 7.16 (sec) , antiderivative size = 1342, normalized size of antiderivative = 5.20 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx =\text {Too large to display} \] Input:

Integrate[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 

Output:

(a*b*(20*a^2 - 11*b^2)*Cos[c + d*x]^4*(a + b*Tan[c + d*x])^4)/(30*d*(a*Cos 
[c + d*x] + b*Sin[c + d*x])^4) + ((-8*a^4 + 12*a^2*b^2 - b^4)*Cos[c + d*x] 
^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]]*(a + b*Tan[c + d*x])^4)/(16*d* 
(a*Cos[c + d*x] + b*Sin[c + d*x])^4) + ((8*a^4 - 12*a^2*b^2 + b^4)*Cos[c + 
 d*x]^4*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]*(a + b*Tan[c + d*x])^4)/( 
16*d*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) + (b^4*Cos[c + d*x]^4*(a + b*Tan 
[c + d*x])^4)/(48*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^6*(a*Cos[c + d*x 
] + b*Sin[c + d*x])^4) + ((30*a^2*b^2 + 8*a*b^3 - 5*b^4)*Cos[c + d*x]^4*(a 
 + b*Tan[c + d*x])^4)/(80*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^4*(a*Cos 
[c + d*x] + b*Sin[c + d*x])^4) + ((120*a^4 + 160*a^3*b - 180*a^2*b^2 - 88* 
a*b^3 + 15*b^4)*Cos[c + d*x]^4*(a + b*Tan[c + d*x])^4)/(480*d*(Cos[(c + d* 
x)/2] - Sin[(c + d*x)/2])^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) + (a*b^3* 
Cos[c + d*x]^4*Sin[(c + d*x)/2]*(a + b*Tan[c + d*x])^4)/(5*d*(Cos[(c + d*x 
)/2] - Sin[(c + d*x)/2])^5*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) - (b^4*Cos 
[c + d*x]^4*(a + b*Tan[c + d*x])^4)/(48*d*(Cos[(c + d*x)/2] + Sin[(c + d*x 
)/2])^6*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) - (a*b^3*Cos[c + d*x]^4*Sin[( 
c + d*x)/2]*(a + b*Tan[c + d*x])^4)/(5*d*(Cos[(c + d*x)/2] + Sin[(c + d*x) 
/2])^5*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) + ((-30*a^2*b^2 + 8*a*b^3 + 5* 
b^4)*Cos[c + d*x]^4*(a + b*Tan[c + d*x])^4)/(80*d*(Cos[(c + d*x)/2] + Sin[ 
(c + d*x)/2])^4*(a*Cos[c + d*x] + b*Sin[c + d*x])^4) + ((-120*a^4 + 160...
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 258, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3042, 3569, 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 ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \cos (c+d x)+b \sin (c+d x))^4}{\cos (c+d x)^7}dx\)

\(\Big \downarrow \) 3569

\(\displaystyle \int \left (a^4 \sec ^3(c+d x)+4 a^3 b \tan (c+d x) \sec ^3(c+d x)+6 a^2 b^2 \tan ^2(c+d x) \sec ^3(c+d x)+4 a b^3 \tan ^3(c+d x) \sec ^3(c+d x)+b^4 \tan ^4(c+d x) \sec ^3(c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^4 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^4 \tan (c+d x) \sec (c+d x)}{2 d}+\frac {4 a^3 b \sec ^3(c+d x)}{3 d}-\frac {3 a^2 b^2 \text {arctanh}(\sin (c+d x))}{4 d}+\frac {3 a^2 b^2 \tan (c+d x) \sec ^3(c+d x)}{2 d}-\frac {3 a^2 b^2 \tan (c+d x) \sec (c+d x)}{4 d}+\frac {4 a b^3 \sec ^5(c+d x)}{5 d}-\frac {4 a b^3 \sec ^3(c+d x)}{3 d}+\frac {b^4 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {b^4 \tan ^3(c+d x) \sec ^3(c+d x)}{6 d}-\frac {b^4 \tan (c+d x) \sec ^3(c+d x)}{8 d}+\frac {b^4 \tan (c+d x) \sec (c+d x)}{16 d}\)

Input:

Int[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]
 

Output:

(a^4*ArcTanh[Sin[c + d*x]])/(2*d) - (3*a^2*b^2*ArcTanh[Sin[c + d*x]])/(4*d 
) + (b^4*ArcTanh[Sin[c + d*x]])/(16*d) + (4*a^3*b*Sec[c + d*x]^3)/(3*d) - 
(4*a*b^3*Sec[c + d*x]^3)/(3*d) + (4*a*b^3*Sec[c + d*x]^5)/(5*d) + (a^4*Sec 
[c + d*x]*Tan[c + d*x])/(2*d) - (3*a^2*b^2*Sec[c + d*x]*Tan[c + d*x])/(4*d 
) + (b^4*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (3*a^2*b^2*Sec[c + d*x]^3*Tan 
[c + d*x])/(2*d) - (b^4*Sec[c + d*x]^3*Tan[c + d*x])/(8*d) + (b^4*Sec[c + 
d*x]^3*Tan[c + d*x]^3)/(6*d)
 

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 3569
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*(a 
*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] && Inte 
gerQ[m] && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 1.30 (sec) , antiderivative size = 255, normalized size of antiderivative = 0.99

method result size
parts \(\frac {a^{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 )}{d}+\frac {b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{5}}{24 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{48 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{48}-\frac {\sin \left (d x +c \right )}{16}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}+\frac {4 a^{3} b \sec \left (d x +c \right )^{3}}{3 d}+\frac {6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {4 b^{3} a \left (\frac {\sec \left (d x +c \right )^{5}}{5}-\frac {\sec \left (d x +c \right )^{3}}{3}\right )}{d}\) \(255\)
derivativedivides \(\frac {a^{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 )+\frac {4 a^{3} b}{3 \cos \left (d x +c \right )^{3}}+6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 b^{3} a \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{5}}{24 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{48 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{48}-\frac {\sin \left (d x +c \right )}{16}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(296\)
default \(\frac {a^{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 )+\frac {4 a^{3} b}{3 \cos \left (d x +c \right )^{3}}+6 a^{2} b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 b^{3} a \left (\frac {\sin \left (d x +c \right )^{4}}{5 \cos \left (d x +c \right )^{5}}+\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{15 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{15}\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{5}}{24 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{48 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{48}-\frac {\sin \left (d x +c \right )}{16}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(296\)
parallelrisch \(\frac {-120 \left (a^{4}-\frac {3}{2} a^{2} b^{2}+\frac {1}{8} b^{4}\right ) \left (\cos \left (6 d x +6 c \right )+6 \cos \left (4 d x +4 c \right )+15 \cos \left (2 d x +2 c \right )+10\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+120 \left (a^{4}-\frac {3}{2} a^{2} b^{2}+\frac {1}{8} b^{4}\right ) \left (\cos \left (6 d x +6 c \right )+6 \cos \left (4 d x +4 c \right )+15 \cos \left (2 d x +2 c \right )+10\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (4800 a^{3} b -1920 b^{3} a \right ) \cos \left (2 d x +2 c \right )+\left (1920 a^{3} b -768 b^{3} a \right ) \cos \left (4 d x +4 c \right )+\left (320 a^{3} b -128 b^{3} a \right ) \cos \left (6 d x +6 c \right )+\left (720 a^{4}+1800 a^{2} b^{2}-470 b^{4}\right ) \sin \left (3 d x +3 c \right )+\left (240 a^{4}-360 a^{2} b^{2}+30 b^{4}\right ) \sin \left (5 d x +5 c \right )+\left (2560 a^{3} b -2560 b^{3} a \right ) \cos \left (3 d x +3 c \right )+\left (480 a^{4}+2160 a^{2} b^{2}+780 b^{4}\right ) \sin \left (d x +c \right )+7680 \left (\left (a^{2}-\frac {b^{2}}{5}\right ) \cos \left (d x +c \right )+\frac {5 a^{2}}{12}-\frac {b^{2}}{6}\right ) a b}{240 d \left (\cos \left (6 d x +6 c \right )+6 \cos \left (4 d x +4 c \right )+15 \cos \left (2 d x +2 c \right )+10\right )}\) \(377\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (-120 a^{4}-15 b^{4}+3840 i a^{3} b \,{\mathrm e}^{6 i \left (d x +c \right )}-1280 i a \,b^{3} {\mathrm e}^{8 i \left (d x +c \right )}+1280 i a^{3} b \,{\mathrm e}^{8 i \left (d x +c \right )}-768 i a \,b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-1280 i a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+3840 i a^{3} b \,{\mathrm e}^{4 i \left (d x +c \right )}-768 i a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+1280 i a^{3} b \,{\mathrm e}^{2 i \left (d x +c \right )}+180 a^{2} b^{2}+900 a^{2} b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+1080 a^{2} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-1080 a^{2} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-900 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+390 b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+15 b^{4} {\mathrm e}^{10 i \left (d x +c \right )}+120 a^{4} {\mathrm e}^{10 i \left (d x +c \right )}+235 b^{4} {\mathrm e}^{2 i \left (d x +c \right )}+360 a^{4} {\mathrm e}^{8 i \left (d x +c \right )}-235 b^{4} {\mathrm e}^{8 i \left (d x +c \right )}+240 a^{4} {\mathrm e}^{6 i \left (d x +c \right )}-240 a^{4} {\mathrm e}^{4 i \left (d x +c \right )}-390 b^{4} {\mathrm e}^{4 i \left (d x +c \right )}-360 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}-180 a^{2} b^{2} {\mathrm e}^{10 i \left (d x +c \right )}\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{4}}{2 d}-\frac {3 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{4 d}+\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{16 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{4}}{2 d}+\frac {3 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{4 d}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{16 d}\) \(582\)

Input:

int(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)
 

Output:

a^4/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+b^4/d*(1/6 
*sin(d*x+c)^5/cos(d*x+c)^6+1/24*sin(d*x+c)^5/cos(d*x+c)^4-1/48*sin(d*x+c)^ 
5/cos(d*x+c)^2-1/48*sin(d*x+c)^3-1/16*sin(d*x+c)+1/16*ln(sec(d*x+c)+tan(d* 
x+c)))+4/3*a^3*b*sec(d*x+c)^3/d+6*a^2*b^2/d*(1/4*sin(d*x+c)^3/cos(d*x+c)^4 
+1/8*sin(d*x+c)^3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8*ln(sec(d*x+c)+tan(d*x+c) 
))+4*b^3*a/d*(1/5*sec(d*x+c)^5-1/3*sec(d*x+c)^3)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 187, normalized size of antiderivative = 0.72 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {15 \, {\left (8 \, a^{4} - 12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (8 \, a^{4} - 12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 384 \, a b^{3} \cos \left (d x + c\right ) + 640 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} + 10 \, {\left (3 \, {\left (8 \, a^{4} - 12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{4} + 8 \, b^{4} + 2 \, {\left (36 \, a^{2} b^{2} - 7 \, b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \] Input:

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas" 
)
 

Output:

1/480*(15*(8*a^4 - 12*a^2*b^2 + b^4)*cos(d*x + c)^6*log(sin(d*x + c) + 1) 
- 15*(8*a^4 - 12*a^2*b^2 + b^4)*cos(d*x + c)^6*log(-sin(d*x + c) + 1) + 38 
4*a*b^3*cos(d*x + c) + 640*(a^3*b - a*b^3)*cos(d*x + c)^3 + 10*(3*(8*a^4 - 
 12*a^2*b^2 + b^4)*cos(d*x + c)^4 + 8*b^4 + 2*(36*a^2*b^2 - 7*b^4)*cos(d*x 
 + c)^2)*sin(d*x + c))/(d*cos(d*x + c)^6)
 

Sympy [F(-1)]

Timed out. \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\text {Timed out} \] Input:

integrate(sec(d*x+c)**7*(a*cos(d*x+c)+b*sin(d*x+c))**4,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 251, normalized size of antiderivative = 0.97 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {5 \, b^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{5} + 8 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \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 )} - 180 \, a^{2} b^{2} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \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 )} + 120 \, a^{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 )} - \frac {640 \, a^{3} b}{\cos \left (d x + c\right )^{3}} + \frac {128 \, {\left (5 \, \cos \left (d x + c\right )^{2} - 3\right )} a b^{3}}{\cos \left (d x + c\right )^{5}}}{480 \, d} \] Input:

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima" 
)
 

Output:

-1/480*(5*b^4*(2*(3*sin(d*x + c)^5 + 8*sin(d*x + c)^3 - 3*sin(d*x + c))/(s 
in(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) - 3*log(sin(d*x + 
 c) + 1) + 3*log(sin(d*x + c) - 1)) - 180*a^2*b^2*(2*(sin(d*x + c)^3 + sin 
(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - log(sin(d*x + c) + 1) 
 + log(sin(d*x + c) - 1)) + 120*a^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - 
 log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 640*a^3*b/cos(d*x + c)^3 
 + 128*(5*cos(d*x + c)^2 - 3)*a*b^3/cos(d*x + c)^5)/d
 

Giac [B] (verification not implemented)

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

Time = 0.24 (sec) , antiderivative size = 536, normalized size of antiderivative = 2.08 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx =\text {Too large to display} \] Input:

integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")
 

Output:

1/240*(15*(8*a^4 - 12*a^2*b^2 + b^4)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 
15*(8*a^4 - 12*a^2*b^2 + b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(120* 
a^4*tan(1/2*d*x + 1/2*c)^11 + 180*a^2*b^2*tan(1/2*d*x + 1/2*c)^11 - 15*b^4 
*tan(1/2*d*x + 1/2*c)^11 - 960*a^3*b*tan(1/2*d*x + 1/2*c)^10 - 360*a^4*tan 
(1/2*d*x + 1/2*c)^9 + 900*a^2*b^2*tan(1/2*d*x + 1/2*c)^9 + 85*b^4*tan(1/2* 
d*x + 1/2*c)^9 + 2880*a^3*b*tan(1/2*d*x + 1/2*c)^8 - 1920*a*b^3*tan(1/2*d* 
x + 1/2*c)^8 + 240*a^4*tan(1/2*d*x + 1/2*c)^7 - 1080*a^2*b^2*tan(1/2*d*x + 
 1/2*c)^7 + 570*b^4*tan(1/2*d*x + 1/2*c)^7 - 3200*a^3*b*tan(1/2*d*x + 1/2* 
c)^6 + 1280*a*b^3*tan(1/2*d*x + 1/2*c)^6 + 240*a^4*tan(1/2*d*x + 1/2*c)^5 
- 1080*a^2*b^2*tan(1/2*d*x + 1/2*c)^5 + 570*b^4*tan(1/2*d*x + 1/2*c)^5 + 1 
920*a^3*b*tan(1/2*d*x + 1/2*c)^4 - 360*a^4*tan(1/2*d*x + 1/2*c)^3 + 900*a^ 
2*b^2*tan(1/2*d*x + 1/2*c)^3 + 85*b^4*tan(1/2*d*x + 1/2*c)^3 - 960*a^3*b*t 
an(1/2*d*x + 1/2*c)^2 + 768*a*b^3*tan(1/2*d*x + 1/2*c)^2 + 120*a^4*tan(1/2 
*d*x + 1/2*c) + 180*a^2*b^2*tan(1/2*d*x + 1/2*c) - 15*b^4*tan(1/2*d*x + 1/ 
2*c) + 320*a^3*b - 128*a*b^3)/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d
 

Mupad [B] (verification not implemented)

Time = 20.11 (sec) , antiderivative size = 419, normalized size of antiderivative = 1.62 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^4-\frac {3\,a^2\,b^2}{2}+\frac {b^4}{8}\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^4-9\,a^2\,b^2+\frac {19\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (2\,a^4-9\,a^2\,b^2+\frac {19\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (-3\,a^4+\frac {15\,a^2\,b^2}{2}+\frac {17\,b^4}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (-3\,a^4+\frac {15\,a^2\,b^2}{2}+\frac {17\,b^4}{24}\right )+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+\frac {3\,a^2\,b^2}{2}-\frac {b^4}{8}\right )-\frac {16\,a\,b^3}{15}+\frac {8\,a^3\,b}{3}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (a^4+\frac {3\,a^2\,b^2}{2}-\frac {b^4}{8}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {32\,a\,b^3}{5}-8\,a^3\,b\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (16\,a\,b^3-24\,a^3\,b\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {32\,a\,b^3}{3}-\frac {80\,a^3\,b}{3}\right )+16\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \] Input:

int((a*cos(c + d*x) + b*sin(c + d*x))^4/cos(c + d*x)^7,x)
 

Output:

(atanh(tan(c/2 + (d*x)/2))*(a^4 + b^4/8 - (3*a^2*b^2)/2))/d + (tan(c/2 + ( 
d*x)/2)^5*(2*a^4 + (19*b^4)/4 - 9*a^2*b^2) + tan(c/2 + (d*x)/2)^7*(2*a^4 + 
 (19*b^4)/4 - 9*a^2*b^2) + tan(c/2 + (d*x)/2)^3*((17*b^4)/24 - 3*a^4 + (15 
*a^2*b^2)/2) + tan(c/2 + (d*x)/2)^9*((17*b^4)/24 - 3*a^4 + (15*a^2*b^2)/2) 
 + tan(c/2 + (d*x)/2)*(a^4 - b^4/8 + (3*a^2*b^2)/2) - (16*a*b^3)/15 + (8*a 
^3*b)/3 + tan(c/2 + (d*x)/2)^11*(a^4 - b^4/8 + (3*a^2*b^2)/2) + tan(c/2 + 
(d*x)/2)^2*((32*a*b^3)/5 - 8*a^3*b) - tan(c/2 + (d*x)/2)^8*(16*a*b^3 - 24* 
a^3*b) + tan(c/2 + (d*x)/2)^6*((32*a*b^3)/3 - (80*a^3*b)/3) + 16*a^3*b*tan 
(c/2 + (d*x)/2)^4 - 8*a^3*b*tan(c/2 + (d*x)/2)^10)/(d*(15*tan(c/2 + (d*x)/ 
2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*tan(c/2 + (d* 
x)/2)^8 - 6*tan(c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 878, normalized size of antiderivative = 3.40 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx =\text {Too large to display} \] Input:

int(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^4,x)
 

Output:

(320*cos(c + d*x)*sin(c + d*x)**2*a**3*b - 320*cos(c + d*x)*sin(c + d*x)** 
2*a*b**3 - 320*cos(c + d*x)*a**3*b + 128*cos(c + d*x)*a*b**3 - 120*log(tan 
((c + d*x)/2) - 1)*sin(c + d*x)**6*a**4 + 180*log(tan((c + d*x)/2) - 1)*si 
n(c + d*x)**6*a**2*b**2 - 15*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**6*b** 
4 + 360*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4*a**4 - 540*log(tan((c + 
d*x)/2) - 1)*sin(c + d*x)**4*a**2*b**2 + 45*log(tan((c + d*x)/2) - 1)*sin( 
c + d*x)**4*b**4 - 360*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**4 + 54 
0*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**2*b**2 - 45*log(tan((c + d* 
x)/2) - 1)*sin(c + d*x)**2*b**4 + 120*log(tan((c + d*x)/2) - 1)*a**4 - 180 
*log(tan((c + d*x)/2) - 1)*a**2*b**2 + 15*log(tan((c + d*x)/2) - 1)*b**4 + 
 120*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**6*a**4 - 180*log(tan((c + d*x 
)/2) + 1)*sin(c + d*x)**6*a**2*b**2 + 15*log(tan((c + d*x)/2) + 1)*sin(c + 
 d*x)**6*b**4 - 360*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**4 + 540*l 
og(tan((c + d*x)/2) + 1)*sin(c + d*x)**4*a**2*b**2 - 45*log(tan((c + d*x)/ 
2) + 1)*sin(c + d*x)**4*b**4 + 360*log(tan((c + d*x)/2) + 1)*sin(c + d*x)* 
*2*a**4 - 540*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**2*b**2 + 45*log 
(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**4 - 120*log(tan((c + d*x)/2) + 1 
)*a**4 + 180*log(tan((c + d*x)/2) + 1)*a**2*b**2 - 15*log(tan((c + d*x)/2) 
 + 1)*b**4 - 320*sin(c + d*x)**6*a**3*b + 128*sin(c + d*x)**6*a*b**3 - 120 
*sin(c + d*x)**5*a**4 + 180*sin(c + d*x)**5*a**2*b**2 - 15*sin(c + d*x)...