\(\int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx\) [62]

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 = 29, antiderivative size = 117 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {A \text {arctanh}(\sin (c+d x))}{a^3 d}-\frac {(A-B) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}-\frac {(7 A-2 B) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}-\frac {2 (11 A-B) \sin (c+d x)}{15 d \left (a^3+a^3 \cos (c+d x)\right )} \] Output:

A*arctanh(sin(d*x+c))/a^3/d-1/5*(A-B)*sin(d*x+c)/d/(a+a*cos(d*x+c))^3-1/15 
*(7*A-2*B)*sin(d*x+c)/a/d/(a+a*cos(d*x+c))^2-2/15*(11*A-B)*sin(d*x+c)/d/(a 
^3+a^3*cos(d*x+c))
 

Mathematica [A] (verified)

Time = 1.50 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.68 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {-240 A \cos ^6\left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (-5 (29 A-4 B) \sin \left (\frac {d x}{2}\right )+75 A \sin \left (c+\frac {d x}{2}\right )-95 A \sin \left (c+\frac {3 d x}{2}\right )+10 B \sin \left (c+\frac {3 d x}{2}\right )+15 A \sin \left (2 c+\frac {3 d x}{2}\right )-22 A \sin \left (2 c+\frac {5 d x}{2}\right )+2 B \sin \left (2 c+\frac {5 d x}{2}\right )\right )}{30 a^3 d (1+\cos (c+d x))^3} \] Input:

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

Output:

(-240*A*Cos[(c + d*x)/2]^6*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log 
[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + Cos[(c + d*x)/2]*Sec[c/2]*(-5*(29 
*A - 4*B)*Sin[(d*x)/2] + 75*A*Sin[c + (d*x)/2] - 95*A*Sin[c + (3*d*x)/2] + 
 10*B*Sin[c + (3*d*x)/2] + 15*A*Sin[2*c + (3*d*x)/2] - 22*A*Sin[2*c + (5*d 
*x)/2] + 2*B*Sin[2*c + (5*d*x)/2]))/(30*a^3*d*(1 + Cos[c + d*x])^3)
 

Rubi [A] (verified)

Time = 0.75 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {3042, 3457, 3042, 3457, 3042, 3457, 27, 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 \frac {\sec (c+d x) (A+B \cos (c+d x))}{(a \cos (c+d x)+a)^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3457

\(\displaystyle \frac {\int \frac {(5 a A-2 a (A-B) \cos (c+d x)) \sec (c+d x)}{(\cos (c+d x) a+a)^2}dx}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3457

\(\displaystyle \frac {\frac {\int \frac {\left (15 a^2 A-a^2 (7 A-2 B) \cos (c+d x)\right ) \sec (c+d x)}{\cos (c+d x) a+a}dx}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {\int \frac {15 a^2 A-a^2 (7 A-2 B) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right ) \left (\sin \left (c+d x+\frac {\pi }{2}\right ) a+a\right )}dx}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3457

\(\displaystyle \frac {\frac {\frac {\int 15 a^3 A \sec (c+d x)dx}{a^2}-\frac {2 a^2 (11 A-B) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {15 a A \int \sec (c+d x)dx-\frac {2 a^2 (11 A-B) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {15 a A \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {2 a^2 (11 A-B) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {\frac {\frac {15 a A \text {arctanh}(\sin (c+d x))}{d}-\frac {2 a^2 (11 A-B) \sin (c+d x)}{d (a \cos (c+d x)+a)}}{3 a^2}-\frac {a (7 A-2 B) \sin (c+d x)}{3 d (a \cos (c+d x)+a)^2}}{5 a^2}-\frac {(A-B) \sin (c+d x)}{5 d (a \cos (c+d x)+a)^3}\)

Input:

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

Output:

-1/5*((A - B)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])^3) + (-1/3*(a*(7*A - 2 
*B)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])^2) + ((15*a*A*ArcTanh[Sin[c + d* 
x]])/d - (2*a^2*(11*A - B)*Sin[c + d*x])/(d*(a + a*Cos[c + d*x])))/(3*a^2) 
)/(5*a^2)
 

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 3457
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + 
(f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim 
p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( 
n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) 
  Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b 
*d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 
2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ 
[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] 
 &&  !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 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.53 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.81

method result size
parallelrisch \(\frac {-20 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+20 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {10 \left (2 A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3}+35 A -5 B \right )}{20 a^{3} d}\) \(95\)
derivativedivides \(\frac {-4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} A}{5}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} B}{5}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}-\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} A}{3}}{4 d \,a^{3}}\) \(119\)
default \(\frac {-4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+4 A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B -\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} A}{5}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} B}{5}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}-\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} A}{3}}{4 d \,a^{3}}\) \(119\)
risch \(-\frac {2 i \left (15 A \,{\mathrm e}^{4 i \left (d x +c \right )}+75 A \,{\mathrm e}^{3 i \left (d x +c \right )}+145 A \,{\mathrm e}^{2 i \left (d x +c \right )}-20 B \,{\mathrm e}^{2 i \left (d x +c \right )}+95 A \,{\mathrm e}^{i \left (d x +c \right )}-10 B \,{\mathrm e}^{i \left (d x +c \right )}+22 A -2 B \right )}{15 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5}}+\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{3} d}-\frac {A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{3} d}\) \(146\)
norman \(\frac {-\frac {\left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{20 a d}-\frac {5 \left (5 A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 a d}-\frac {\left (7 A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}-\frac {\left (23 A -13 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{60 a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) a^{2}}+\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{3} d}-\frac {A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{3} d}\) \(163\)

Input:

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

Output:

1/20*(-20*A*ln(tan(1/2*d*x+1/2*c)-1)+20*A*ln(tan(1/2*d*x+1/2*c)+1)-tan(1/2 
*d*x+1/2*c)*((A-B)*tan(1/2*d*x+1/2*c)^4+10/3*(2*A-B)*tan(1/2*d*x+1/2*c)^2+ 
35*A-5*B))/a^3/d
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.58 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {15 \, {\left (A \cos \left (d x + c\right )^{3} + 3 \, A \cos \left (d x + c\right )^{2} + 3 \, A \cos \left (d x + c\right ) + A\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (A \cos \left (d x + c\right )^{3} + 3 \, A \cos \left (d x + c\right )^{2} + 3 \, A \cos \left (d x + c\right ) + A\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, {\left (11 \, A - B\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (17 \, A - 2 \, B\right )} \cos \left (d x + c\right ) + 32 \, A - 7 \, B\right )} \sin \left (d x + c\right )}{30 \, {\left (a^{3} d \cos \left (d x + c\right )^{3} + 3 \, a^{3} d \cos \left (d x + c\right )^{2} + 3 \, a^{3} d \cos \left (d x + c\right ) + a^{3} d\right )}} \] Input:

integrate((A+B*cos(d*x+c))*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, algorithm="fri 
cas")
 

Output:

1/30*(15*(A*cos(d*x + c)^3 + 3*A*cos(d*x + c)^2 + 3*A*cos(d*x + c) + A)*lo 
g(sin(d*x + c) + 1) - 15*(A*cos(d*x + c)^3 + 3*A*cos(d*x + c)^2 + 3*A*cos( 
d*x + c) + A)*log(-sin(d*x + c) + 1) - 2*(2*(11*A - B)*cos(d*x + c)^2 + 3* 
(17*A - 2*B)*cos(d*x + c) + 32*A - 7*B)*sin(d*x + c))/(a^3*d*cos(d*x + c)^ 
3 + 3*a^3*d*cos(d*x + c)^2 + 3*a^3*d*cos(d*x + c) + a^3*d)
 

Sympy [F]

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

integrate((A+B*cos(d*x+c))*sec(d*x+c)/(a+a*cos(d*x+c))**3,x)
 

Output:

(Integral(A*sec(c + d*x)/(cos(c + d*x)**3 + 3*cos(c + d*x)**2 + 3*cos(c + 
d*x) + 1), x) + Integral(B*cos(c + d*x)*sec(c + d*x)/(cos(c + d*x)**3 + 3* 
cos(c + d*x)**2 + 3*cos(c + d*x) + 1), x))/a**3
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.60 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=-\frac {A {\left (\frac {\frac {105 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {20 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {60 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}\right )} - \frac {B {\left (\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{3}}}{60 \, d} \] Input:

integrate((A+B*cos(d*x+c))*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, algorithm="max 
ima")
 

Output:

-1/60*(A*((105*sin(d*x + c)/(cos(d*x + c) + 1) + 20*sin(d*x + c)^3/(cos(d* 
x + c) + 1)^3 + 3*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/a^3 - 60*log(sin(d* 
x + c)/(cos(d*x + c) + 1) + 1)/a^3 + 60*log(sin(d*x + c)/(cos(d*x + c) + 1 
) - 1)/a^3) - B*(15*sin(d*x + c)/(cos(d*x + c) + 1) + 10*sin(d*x + c)^3/(c 
os(d*x + c) + 1)^3 + 3*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/a^3)/d
 

Giac [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.26 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\frac {60 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} - \frac {60 \, A \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} - \frac {3 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 20 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{15}}}{60 \, d} \] Input:

integrate((A+B*cos(d*x+c))*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, algorithm="gia 
c")
 

Output:

1/60*(60*A*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^3 - 60*A*log(abs(tan(1/2*d 
*x + 1/2*c) - 1))/a^3 - (3*A*a^12*tan(1/2*d*x + 1/2*c)^5 - 3*B*a^12*tan(1/ 
2*d*x + 1/2*c)^5 + 20*A*a^12*tan(1/2*d*x + 1/2*c)^3 - 10*B*a^12*tan(1/2*d* 
x + 1/2*c)^3 + 105*A*a^12*tan(1/2*d*x + 1/2*c) - 15*B*a^12*tan(1/2*d*x + 1 
/2*c))/a^15)/d
 

Mupad [B] (verification not implemented)

Time = 35.80 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.11 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {2\,A\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^3\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A-B}{4\,a^3}+\frac {3\,A+B}{4\,a^3}+\frac {3\,A-B}{4\,a^3}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (A-B\right )}{20\,a^3\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {A-B}{12\,a^3}+\frac {3\,A-B}{12\,a^3}\right )}{d} \] Input:

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

Output:

(2*A*atanh(tan(c/2 + (d*x)/2)))/(a^3*d) - (tan(c/2 + (d*x)/2)*((A - B)/(4* 
a^3) + (3*A + B)/(4*a^3) + (3*A - B)/(4*a^3)))/d - (tan(c/2 + (d*x)/2)^5*( 
A - B))/(20*a^3*d) - (tan(c/2 + (d*x)/2)^3*((A - B)/(12*a^3) + (3*A - B)/( 
12*a^3)))/d
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.02 \[ \int \frac {(A+B \cos (c+d x)) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {-60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a +60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a -3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} a +3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5} b -20 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} a +10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b -105 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a +15 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b}{60 a^{3} d} \] Input:

int((A+B*cos(d*x+c))*sec(d*x+c)/(a+a*cos(d*x+c))^3,x)
 

Output:

( - 60*log(tan((c + d*x)/2) - 1)*a + 60*log(tan((c + d*x)/2) + 1)*a - 3*ta 
n((c + d*x)/2)**5*a + 3*tan((c + d*x)/2)**5*b - 20*tan((c + d*x)/2)**3*a + 
 10*tan((c + d*x)/2)**3*b - 105*tan((c + d*x)/2)*a + 15*tan((c + d*x)/2)*b 
)/(60*a**3*d)