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

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

Optimal result

Integrand size = 19, antiderivative size = 73 \[ \int (a+b \cos (c+d x))^3 \sec (c+d x) \, dx=\frac {1}{2} b \left (6 a^2+b^2\right ) x+\frac {a^3 \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a b^2 \sin (c+d x)}{2 d}+\frac {b^2 (a+b \cos (c+d x)) \sin (c+d x)}{2 d} \] Output:

1/2*b*(6*a^2+b^2)*x+a^3*arctanh(sin(d*x+c))/d+5/2*a*b^2*sin(d*x+c)/d+1/2*b 
^2*(a+b*cos(d*x+c))*sin(d*x+c)/d
 

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.01, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.421, Rules used = {3042, 3272, 3042, 3502, 3042, 3214, 3042, 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 (c+d x) (a+b \cos (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3272

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int \frac {2 a^3+5 b^2 \sin \left (c+d x+\frac {\pi }{2}\right )^2 a+b \left (6 a^2+b^2\right ) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {b^2 \sin (c+d x) (a+b \cos (c+d x))}{2 d}\)

\(\Big \downarrow \) 3502

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \left (\int \frac {2 a^3+b \left (6 a^2+b^2\right ) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {5 a b^2 \sin (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \cos (c+d x))}{2 d}\)

\(\Big \downarrow \) 3214

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

(b^2*(a + b*Cos[c + d*x])*Sin[c + d*x])/(2*d) + (b*(6*a^2 + b^2)*x + (2*a^ 
3*ArcTanh[Sin[c + d*x]])/d + (5*a*b^2*Sin[c + d*x])/d)/2
 

Defintions of rubi rules used

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

rule 3214
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d   Int[1/(c + d 
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
 

rule 3272
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b^2)*Cos[e + f*x]*(a + b*Sin[e + f* 
x])^(m - 2)*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n))), x] + Simp[1/(d*(m 
 + n))   Int[(a + b*Sin[e + f*x])^(m - 3)*(c + d*Sin[e + f*x])^n*Simp[a^3*d 
*(m + n) + b^2*(b*c*(m - 2) + a*d*(n + 1)) - b*(a*b*c - b^2*d*(m + n - 1) - 
 3*a^2*d*(m + n))*Sin[e + f*x] - b^2*(b*c*(m - 1) - a*d*(3*m + 2*n - 2))*Si 
n[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a* 
d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 2] && (IntegerQ[m 
] || IntegersQ[2*m, 2*n]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[a, 0] 
&& NeQ[c, 0])))
 

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

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 = 3.07 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00

method result size
derivativedivides \(\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{2} b \left (d x +c \right )+3 \sin \left (d x +c \right ) a \,b^{2}+b^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(73\)
default \(\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 a^{2} b \left (d x +c \right )+3 \sin \left (d x +c \right ) a \,b^{2}+b^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(73\)
parallelrisch \(\frac {12 a^{2} b d x +2 b^{3} d x +4 a^{3} \left (-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )\right )+\sin \left (2 d x +2 c \right ) b^{3}+12 \sin \left (d x +c \right ) a \,b^{2}}{4 d}\) \(79\)
parts \(\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {b^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {3 a^{2} b \left (d x +c \right )}{d}+\frac {3 a \,b^{2} \sin \left (d x +c \right )}{d}\) \(81\)
risch \(3 a^{2} b x +\frac {b^{3} x}{2}-\frac {3 i b^{2} a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {3 i b^{2} a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {\sin \left (2 d x +2 c \right ) b^{3}}{4 d}\) \(111\)
norman \(\frac {\left (3 a^{2} b +\frac {1}{2} b^{3}\right ) x +\left (3 a^{2} b +\frac {1}{2} b^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (9 a^{2} b +\frac {3}{2} b^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (9 a^{2} b +\frac {3}{2} b^{3}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {b^{2} \left (6 a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {b^{2} \left (6 a +b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {12 b^{2} a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(213\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

\[ \int (a+b \cos (c+d x))^3 \sec (c+d x) \, dx=\int \left (a + b \cos {\left (c + d x \right )}\right )^{3} \sec {\left (c + d x \right )}\, dx \] Input:

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

Output:

Integral((a + b*cos(c + d*x))**3*sec(c + d*x), x)
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.95 \[ \int (a+b \cos (c+d x))^3 \sec (c+d x) \, dx=\frac {12 \, {\left (d x + c\right )} a^{2} b + {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3} + 4 \, a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 12 \, a b^{2} \sin \left (d x + c\right )}{4 \, d} \] Input:

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

Output:

1/4*(12*(d*x + c)*a^2*b + (2*d*x + 2*c + sin(2*d*x + 2*c))*b^3 + 4*a^3*log 
(sec(d*x + c) + tan(d*x + c)) + 12*a*b^2*sin(d*x + c))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 137 vs. \(2 (67) = 134\).

Time = 0.52 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.88 \[ \int (a+b \cos (c+d x))^3 \sec (c+d x) \, dx=\frac {2 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (6 \, a^{2} b + b^{3}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{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((a+b*cos(d*x+c))^3*sec(d*x+c),x, algorithm="giac")
 

Output:

1/2*(2*a^3*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*a^3*log(abs(tan(1/2*d*x 
+ 1/2*c) - 1)) + (6*a^2*b + b^3)*(d*x + c) + 2*(6*a*b^2*tan(1/2*d*x + 1/2* 
c)^3 - b^3*tan(1/2*d*x + 1/2*c)^3 + 6*a*b^2*tan(1/2*d*x + 1/2*c) + b^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 = 40.67 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.68 \[ \int (a+b \cos (c+d x))^3 \sec (c+d x) \, dx=\frac {2\,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 {b^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 {b^3\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {3\,a\,b^2\,\sin \left (c+d\,x\right )}{d}+\frac {6\,a^2\,b\,\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} \] Input:

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

Output:

(2*a^3*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^3*atan(sin(c/2 
 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^3*sin(2*c + 2*d*x))/(4*d) + (3*a*b 
^2*sin(c + d*x))/d + (6*a^2*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))) 
/d
 

Reduce [B] (verification not implemented)

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

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

Output:

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