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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

(3*a*b*(b*c + b*d*x - a*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + a*Log[C 
os[(c + d*x)/2] + Sin[(c + d*x)/2]]) + b^3*Sin[c + d*x] + a^3*Tan[c + d*x] 
)/d
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.01, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 3271, 3042, 3502, 27, 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 ^2(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 )^2}dx\)

\(\Big \downarrow \) 3271

\(\displaystyle \int \left (3 b a^2+3 b^2 \cos (c+d x) a-b \left (a^2-b^2\right ) \cos ^2(c+d x)\right ) \sec (c+d x)dx+\frac {a^2 \tan (c+d x) (a+b \cos (c+d x))}{d}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3502

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3214

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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 3271
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-(b^2*c^2 - 2*a*b*c*d + a^2*d^2))*Co 
s[e + f*x]*(a + b*Sin[e + f*x])^(m - 2)*((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 - 3)*(c + d*Sin[e + f*x])^(n + 1)*Simp[b*(m - 2)*(b*c - a*d)^ 
2 + a*d*(n + 1)*(c*(a^2 + b^2) - 2*a*b*d) + (b*(n + 1)*(a*b*c^2 + c*d*(a^2 
+ b^2) - 3*a*b*d^2) - a*(n + 2)*(b*c - a*d)^2)*Sin[e + f*x] + b*(b^2*(c^2 - 
 d^2) - m*(b*c - a*d)^2 + d*n*(2*a*b*c - d*(a^2 + b^2)))*Sin[e + f*x]^2, x] 
, x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - 
b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 2] && LtQ[n, -1] && (IntegerQ[m] || 
IntegersQ[2*m, 2*n])
 

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 = 4.43 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\frac {\tan \left (d x +c \right ) a^{3}+3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 b^{2} a \left (d x +c \right )+\sin \left (d x +c \right ) b^{3}}{d}\) \(57\)
default \(\frac {\tan \left (d x +c \right ) a^{3}+3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 b^{2} a \left (d x +c \right )+\sin \left (d x +c \right ) b^{3}}{d}\) \(57\)
parts \(\frac {a^{3} \tan \left (d x +c \right )}{d}+\frac {\sin \left (d x +c \right ) b^{3}}{d}+\frac {3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {3 b^{2} a \left (d x +c \right )}{d}\) \(65\)
parallelrisch \(\frac {6 \cos \left (d x +c \right ) a \,b^{2} d x +6 \cos \left (d x +c \right ) a^{2} b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-6 \cos \left (d x +c \right ) a^{2} b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 \sin \left (d x +c \right ) a^{3}+\sin \left (2 d x +2 c \right ) b^{3}}{2 \cos \left (d x +c \right ) d}\) \(101\)
risch \(3 a \,b^{2} x -\frac {i b^{3} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i b^{3} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i a^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(111\)
norman \(\frac {-3 a \,b^{2} x -\frac {2 \left (a^{3}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {2 \left (a^{3}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 \left (3 a^{3}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {2 \left (3 a^{3}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-6 a \,b^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+6 a \,b^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+3 a \,b^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{\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 )}-\frac {3 a^{2} b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {3 a^{2} b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) \(235\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

(3*(d*x + c)*a*b^2 + 3*a^2*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*a^2*b* 
log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(a^3*tan(1/2*d*x + 1/2*c)^3 - b^3*t 
an(1/2*d*x + 1/2*c)^3 + a^3*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)^4 - 1))/d
 

Mupad [B] (verification not implemented)

Time = 35.25 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.43 \[ \int (a+b \cos (c+d x))^3 \sec ^2(c+d x) \, dx=\frac {b^3\,\sin \left (c+d\,x\right )}{d}+\frac {a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {6\,a\,b^2\,\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\,a^2\,b\,\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} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

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