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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 2.29 (sec) , antiderivative size = 268, normalized size of antiderivative = 1.77 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {16 a b^3-16 a b \left (a^2-b^2\right ) \cos (c+d x)-24 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+24 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b^4}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+32 a b^3 \sec (c+d x) \sin ^2\left (\frac {1}{2} (c+d x)\right )-\frac {b^4}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+4 a^4 \sin (c+d x)-24 a^2 b^2 \sin (c+d x)+4 b^4 \sin (c+d x)}{4 d} \] Input:

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

Output:

(16*a*b^3 - 16*a*b*(a^2 - b^2)*Cos[c + d*x] - 24*a^2*b^2*Log[Cos[(c + d*x) 
/2] - Sin[(c + d*x)/2]] + 6*b^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 
 24*a^2*b^2*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] - 6*b^4*Log[Cos[(c + 
d*x)/2] + Sin[(c + d*x)/2]] + b^4/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2 
+ 32*a*b^3*Sec[c + d*x]*Sin[(c + d*x)/2]^2 - b^4/(Cos[(c + d*x)/2] + Sin[( 
c + d*x)/2])^2 + 4*a^4*Sin[c + d*x] - 24*a^2*b^2*Sin[c + d*x] + 4*b^4*Sin[ 
c + d*x])/(4*d)
 

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 151, 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 ^3(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)^3}dx\)

\(\Big \downarrow \) 3569

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(6*a^2*b^2*ArcTanh[Sin[c + d*x]])/d - (3*b^4*ArcTanh[Sin[c + d*x]])/(2*d) 
- (4*a^3*b*Cos[c + d*x])/d + (4*a*b^3*Cos[c + d*x])/d + (4*a*b^3*Sec[c + d 
*x])/d + (a^4*Sin[c + d*x])/d - (6*a^2*b^2*Sin[c + d*x])/d + (3*b^4*Sin[c 
+ d*x])/(2*d) + (b^4*Sin[c + d*x]*Tan[c + d*x]^2)/(2*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 = 0.70 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {a^{4} \sin \left (d x +c \right )-4 a^{3} b \cos \left (d x +c \right )+6 a^{2} b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+4 b^{3} a \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(157\)
default \(\frac {a^{4} \sin \left (d x +c \right )-4 a^{3} b \cos \left (d x +c \right )+6 a^{2} b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+4 b^{3} a \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )+b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(157\)
parts \(\frac {a^{4} \sin \left (d x +c \right )}{d}+\frac {b^{4} \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {4 b^{3} a \left (\frac {\sin \left (d x +c \right )^{4}}{\cos \left (d x +c \right )}+\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )\right )}{d}-\frac {4 a^{3} b \cos \left (d x +c \right )}{d}+\frac {6 a^{2} b^{2} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(168\)
parallelrisch \(\frac {-12 \left (a +\frac {b}{2}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+12 \left (a +\frac {b}{2}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (-8 a^{3} b +16 b^{3} a \right ) \cos \left (2 d x +2 c \right )+\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \sin \left (3 d x +3 c \right )+\left (-4 a^{3} b +4 b^{3} a \right ) \cos \left (3 d x +3 c \right )+\left (a^{4}-6 a^{2} b^{2}+3 b^{4}\right ) \sin \left (d x +c \right )-12 a^{3} b \cos \left (d x +c \right )+28 b^{3} a \cos \left (d x +c \right )-8 a^{3} b +16 b^{3} a}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(227\)
risch \(-\frac {2 \,{\mathrm e}^{i \left (d x +c \right )} a^{3} b}{d}+\frac {2 \,{\mathrm e}^{i \left (d x +c \right )} b^{3} a}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{4}}{2 d}+\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b^{2}}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} b^{4}}{2 d}-\frac {2 \,{\mathrm e}^{-i \left (d x +c \right )} a^{3} b}{d}+\frac {2 \,{\mathrm e}^{-i \left (d x +c \right )} b^{3} a}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{4}}{2 d}-\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b^{2}}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} b^{4}}{2 d}+\frac {b^{3} {\mathrm e}^{i \left (d x +c \right )} \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+8 a \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +8 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {6 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {3 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {6 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {3 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) \(356\)
norman \(\frac {\frac {8 a^{3} b +16 b^{3} a}{d}+\frac {16 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{d}+\frac {\left (2 a^{4}-12 a^{2} b^{2}+3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (2 a^{4}-12 a^{2} b^{2}+3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {\left (2 a^{4}-12 a^{2} b^{2}+7 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}+\frac {\left (2 a^{4}-12 a^{2} b^{2}+7 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}+\frac {24 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}-\frac {2 \left (2 a^{4}-12 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {2 \left (2 a^{4}-12 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {4 \left (12 a^{3} b +8 b^{3} a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {2 \left (12 a^{3} b +16 b^{3} a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}-\frac {\left (24 a^{3} b +16 b^{3} a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}-\frac {3 b^{2} \left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {3 b^{2} \left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(444\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.01 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {16 \, a b^{3} \cos \left (d x + c\right ) - 16 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (b^{4} + 2 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:

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

Output:

1/4*(16*a*b^3*cos(d*x + c) - 16*(a^3*b - a*b^3)*cos(d*x + c)^3 + 3*(4*a^2* 
b^2 - b^4)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - 3*(4*a^2*b^2 - b^4)*cos( 
d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(b^4 + 2*(a^4 - 6*a^2*b^2 + b^4)*cos 
(d*x + c)^2)*sin(d*x + c))/(d*cos(d*x + c)^2)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.94 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\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 ) - 4 \, \sin \left (d x + c\right )\right )} - 16 \, a b^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - 12 \, a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 16 \, a^{3} b \cos \left (d x + c\right ) - 4 \, a^{4} \sin \left (d x + c\right )}{4 \, d} \] Input:

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

Output:

-1/4*(b^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + 3*log(sin(d*x + c) + 1) - 
 3*log(sin(d*x + c) - 1) - 4*sin(d*x + c)) - 16*a*b^3*(1/cos(d*x + c) + co 
s(d*x + c)) - 12*a^2*b^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 
2*sin(d*x + c)) + 16*a^3*b*cos(d*x + c) - 4*a^4*sin(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.36 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {4 \, {\left (a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a^{3} b + 4 \, a b^{3}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + \frac {2 \, {\left (b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, a b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \] Input:

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

Output:

1/2*(3*(4*a^2*b^2 - b^4)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(4*a^2*b^2 
 - b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 4*(a^4*tan(1/2*d*x + 1/2*c) - 
 6*a^2*b^2*tan(1/2*d*x + 1/2*c) + b^4*tan(1/2*d*x + 1/2*c) - 4*a^3*b + 4*a 
*b^3)/(tan(1/2*d*x + 1/2*c)^2 + 1) + 2*(b^4*tan(1/2*d*x + 1/2*c)^3 - 8*a*b 
^3*tan(1/2*d*x + 1/2*c)^2 + b^4*tan(1/2*d*x + 1/2*c) + 8*a*b^3)/(tan(1/2*d 
*x + 1/2*c)^2 - 1)^2)/d
 

Mupad [B] (verification not implemented)

Time = 19.05 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.46 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (4\,a^4-24\,a^2\,b^2+2\,b^4\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^4-12\,a^2\,b^2+3\,b^4\right )-16\,a\,b^3+8\,a^3\,b-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^4-12\,a^2\,b^2+3\,b^4\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (16\,a\,b^3-16\,a^3\,b\right )+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (3\,b^4-12\,a^2\,b^2\right )}{d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)^3*(4*a^4 + 2*b^4 - 24*a^2*b^2) - tan(c/2 + (d*x)/2)^5* 
(2*a^4 + 3*b^4 - 12*a^2*b^2) - 16*a*b^3 + 8*a^3*b - tan(c/2 + (d*x)/2)*(2* 
a^4 + 3*b^4 - 12*a^2*b^2) + tan(c/2 + (d*x)/2)^2*(16*a*b^3 - 16*a^3*b) + 8 
*a^3*b*tan(c/2 + (d*x)/2)^4)/(d*(tan(c/2 + (d*x)/2)^2 + tan(c/2 + (d*x)/2) 
^4 - tan(c/2 + (d*x)/2)^6 - 1)) - (atanh(tan(c/2 + (d*x)/2))*(3*b^4 - 12*a 
^2*b^2))/d
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 380, normalized size of antiderivative = 2.52 \[ \int \sec ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {-8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{3} b +8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a \,b^{3}+8 \cos \left (d x +c \right ) a^{3} b -16 \cos \left (d x +c \right ) a \,b^{3}-12 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a^{2} b^{2}+3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{4}+12 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a^{2} b^{2}-3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{4}+12 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a^{2} b^{2}-3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{4}-12 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a^{2} b^{2}+3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{4}+2 \sin \left (d x +c \right )^{3} a^{4}-12 \sin \left (d x +c \right )^{3} a^{2} b^{2}+2 \sin \left (d x +c \right )^{3} b^{4}+8 \sin \left (d x +c \right )^{2} a^{3} b -16 \sin \left (d x +c \right )^{2} a \,b^{3}-2 \sin \left (d x +c \right ) a^{4}+12 \sin \left (d x +c \right ) a^{2} b^{2}-3 \sin \left (d x +c \right ) b^{4}-8 a^{3} b +16 a \,b^{3}}{2 d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:

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

Output:

( - 8*cos(c + d*x)*sin(c + d*x)**2*a**3*b + 8*cos(c + d*x)*sin(c + d*x)**2 
*a*b**3 + 8*cos(c + d*x)*a**3*b - 16*cos(c + d*x)*a*b**3 - 12*log(tan((c + 
 d*x)/2) - 1)*sin(c + d*x)**2*a**2*b**2 + 3*log(tan((c + d*x)/2) - 1)*sin( 
c + d*x)**2*b**4 + 12*log(tan((c + d*x)/2) - 1)*a**2*b**2 - 3*log(tan((c + 
 d*x)/2) - 1)*b**4 + 12*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a**2*b** 
2 - 3*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**4 - 12*log(tan((c + d*x 
)/2) + 1)*a**2*b**2 + 3*log(tan((c + d*x)/2) + 1)*b**4 + 2*sin(c + d*x)**3 
*a**4 - 12*sin(c + d*x)**3*a**2*b**2 + 2*sin(c + d*x)**3*b**4 + 8*sin(c + 
d*x)**2*a**3*b - 16*sin(c + d*x)**2*a*b**3 - 2*sin(c + d*x)*a**4 + 12*sin( 
c + d*x)*a**2*b**2 - 3*sin(c + d*x)*b**4 - 8*a**3*b + 16*a*b**3)/(2*d*(sin 
(c + d*x)**2 - 1))