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

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

1/5*(B-C)*sin(d*x+c)/d/(a+a*cos(d*x+c))^3+1/15*(2*B+3*C)*sin(d*x+c)/a/d/(a 
+a*cos(d*x+c))^2+1/15*(2*B+3*C)*sin(d*x+c)/d/(a^3+a^3*cos(d*x+c))
 

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.62 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\left (7 B+3 C+(6 B+9 C) \cos (c+d x)+(2 B+3 C) \cos ^2(c+d x)\right ) \sin (c+d x)}{15 a^3 d (1+\cos (c+d x))^3} \] Input:

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

Output:

((7*B + 3*C + (6*B + 9*C)*Cos[c + d*x] + (2*B + 3*C)*Cos[c + d*x]^2)*Sin[c 
 + d*x])/(15*a^3*d*(1 + Cos[c + d*x])^3)
 

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.97, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {3042, 3508, 3042, 3229, 3042, 3129, 3042, 3127}

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) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a \cos (c+d x)+a)^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2}{\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 \) 3508

\(\displaystyle \int \frac {B+C \cos (c+d x)}{(a \cos (c+d x)+a)^3}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {B+C \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 \) 3229

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3129

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3127

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

Input:

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

Output:

((B - C)*Sin[c + d*x])/(5*d*(a + a*Cos[c + d*x])^3) + ((2*B + 3*C)*(Sin[c 
+ d*x]/(3*d*(a + a*Cos[c + d*x])^2) + Sin[c + d*x]/(3*a*d*(a + a*Cos[c + d 
*x]))))/(5*a)
 

Defintions of rubi rules used

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

rule 3127
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + 
 d*x]/(d*(b + a*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b 
^2, 0]
 

rule 3129
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*Cos[c 
+ d*x]*((a + b*Sin[c + d*x])^n/(a*d*(2*n + 1))), x] + Simp[(n + 1)/(a*(2*n 
+ 1))   Int[(a + b*Sin[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] 
&& EqQ[a^2 - b^2, 0] && LtQ[n, -1] && IntegerQ[2*n]
 

rule 3229
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(b*c - a*d)*Cos[e + f*x]*((a + b*Sin[e + f* 
x])^m/(a*f*(2*m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(a*b*(2*m + 1))   I 
nt[(a + b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && 
NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]
 

rule 3508
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) 
+ (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ 
.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2   Int[(a + b*Sin[e + f*x])^(m 
+ 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ 
[{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - 
a*b*B + a^2*C, 0]
 
Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.55

method result size
parallelrisch \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {10 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3}+5 B +5 C \right )}{20 a^{3} d}\) \(56\)
derivativedivides \(\frac {\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \,a^{3}}\) \(64\)
default \(\frac {\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} B}{3}+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d \,a^{3}}\) \(64\)
risch \(\frac {2 i \left (15 C \,{\mathrm e}^{3 i \left (d x +c \right )}+20 B \,{\mathrm e}^{2 i \left (d x +c \right )}+15 C \,{\mathrm e}^{2 i \left (d x +c \right )}+10 B \,{\mathrm e}^{i \left (d x +c \right )}+15 C \,{\mathrm e}^{i \left (d x +c \right )}+2 B +3 C \right )}{15 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5}}\) \(90\)
norman \(\frac {\frac {\left (B -C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{20 a d}+\frac {\left (B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {\left (4 B +3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{6 d a}+\frac {\left (8 B -3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{30 d a}+\frac {\left (19 B +6 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{30 d a}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} a^{2}}\) \(143\)

Input:

int((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^3,x,method=_ 
RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.91 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {{\left ({\left (2 \, B + 3 \, C\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, B + 3 \, C\right )} \cos \left (d x + c\right ) + 7 \, B + 3 \, C\right )} \sin \left (d x + c\right )}{15 \, {\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((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, a 
lgorithm="fricas")
 

Output:

1/15*((2*B + 3*C)*cos(d*x + c)^2 + 3*(2*B + 3*C)*cos(d*x + c) + 7*B + 3*C) 
*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 {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\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 + \int \frac {C \cos ^{2}{\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((B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)/(a+a*cos(d*x+c))**3,x)
 

Output:

(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) + Integral(C*cos(c + d*x)**2*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.06 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.13 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\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}} + \frac {3 \, C {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{3}}}{60 \, d} \] Input:

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, a 
lgorithm="maxima")
 

Output:

1/60*(B*(15*sin(d*x + c)/(cos(d*x + c) + 1) + 10*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 + 3*C*(5*sin(d*x + 
 c)/(cos(d*x + c) + 1) - sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/a^3)/d
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.74 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 10 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{60 \, a^{3} d} \] Input:

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)/(a+a*cos(d*x+c))^3,x, a 
lgorithm="giac")
 

Output:

1/60*(3*B*tan(1/2*d*x + 1/2*c)^5 - 3*C*tan(1/2*d*x + 1/2*c)^5 + 10*B*tan(1 
/2*d*x + 1/2*c)^3 + 15*B*tan(1/2*d*x + 1/2*c) + 15*C*tan(1/2*d*x + 1/2*c)) 
/(a^3*d)
 

Mupad [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.65 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (15\,B+15\,C+10\,B\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3\,B\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-3\,C\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}{60\,a^3\,d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)*(15*B + 15*C + 10*B*tan(c/2 + (d*x)/2)^2 + 3*B*tan(c/2 
 + (d*x)/2)^4 - 3*C*tan(c/2 + (d*x)/2)^4))/(60*a^3*d)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.65 \[ \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x)}{(a+a \cos (c+d x))^3} \, dx=\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} b -3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} c +10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +15 b +15 c \right )}{60 a^{3} d} \] Input:

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

Output:

(tan((c + d*x)/2)*(3*tan((c + d*x)/2)**4*b - 3*tan((c + d*x)/2)**4*c + 10* 
tan((c + d*x)/2)**2*b + 15*b + 15*c))/(60*a**3*d)