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

Optimal result
Mathematica [A] (warning: unable to verify)
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 = 19, antiderivative size = 72 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {2 x}{a^2}+\frac {10 \sin (c+d x)}{3 a^2 d}-\frac {2 \sin (c+d x)}{a^2 d (1+\sec (c+d x))}-\frac {\sin (c+d x)}{3 d (a+a \sec (c+d x))^2} \] Output:

-2*x/a^2+10/3*sin(d*x+c)/a^2/d-2*sin(d*x+c)/a^2/d/(1+sec(d*x+c))-1/3*sin(d 
*x+c)/d/(a+a*sec(d*x+c))^2
 

Mathematica [A] (warning: unable to verify)

Time = 0.60 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.35 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\sin (c+d x) \left (24 \arcsin (\cos (c+d x)) \cos ^4\left (\frac {1}{2} (c+d x)\right )+\left (10+14 \cos (c+d x)+3 \cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )}{3 a^2 d \sqrt {1-\cos (c+d x)} (1+\cos (c+d x))^{5/2}} \] Input:

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

Output:

(Sin[c + d*x]*(24*ArcSin[Cos[c + d*x]]*Cos[(c + d*x)/2]^4 + (10 + 14*Cos[c 
 + d*x] + 3*Cos[c + d*x]^2)*Sqrt[Sin[c + d*x]^2]))/(3*a^2*d*Sqrt[1 - Cos[c 
 + d*x]]*(1 + Cos[c + d*x])^(5/2))
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.11, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.526, Rules used = {3042, 4304, 27, 3042, 4508, 3042, 4274, 24, 3042, 3117}

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 {\cos (c+d x)}{(a \sec (c+d x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\csc \left (c+d x+\frac {\pi }{2}\right ) \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^2}dx\)

\(\Big \downarrow \) 4304

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4508

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4274

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

\(\Big \downarrow \) 24

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3117

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

Input:

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

Output:

-1/3*Sin[c + d*x]/(d*(a + a*Sec[c + d*x])^2) + (2*((-3*Sin[c + d*x])/(d*(1 
 + Sec[c + d*x])) + (-3*a^2*x + (5*a^2*Sin[c + d*x])/d)/a^2))/(3*a^2)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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 3117
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; 
 FreeQ[{c, d}, x]
 

rule 4274
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_)), x_Symbol] :> Simp[a   Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d   In 
t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
 

rule 4304
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_), x_Symbol] :> Simp[(-Cot[e + f*x])*(a + b*Csc[e + f*x])^m*((d*Csc 
[e + f*x])^n/(f*(2*m + 1))), x] + Simp[1/(a^2*(2*m + 1))   Int[(a + b*Csc[e 
 + f*x])^(m + 1)*(d*Csc[e + f*x])^n*(a*(2*m + n + 1) - b*(m + n + 1)*Csc[e 
+ f*x]), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && EqQ[a^2 - b^2, 0] && LtQ 
[m, -1] && (IntegersQ[2*m, 2*n] || IntegerQ[m])
 

rule 4508
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-(A*b 
- a*B))*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(b*f*(2*m + 
 1))), x] - Simp[1/(a^2*(2*m + 1))   Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Cs 
c[e + f*x])^n*Simp[b*B*n - a*A*(2*m + n + 1) + (A*b - a*B)*(m + n + 1)*Csc[ 
e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B 
, 0] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)] &&  !GtQ[n, 0]
 
Maple [A] (verified)

Time = 0.46 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.76

method result size
parallelrisch \(\frac {-12 d x +6 \sin \left (d x +c \right )+16 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{6 a^{2} d}\) \(55\)
derivativedivides \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}+5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) \(72\)
default \(\frac {-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}+5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) \(72\)
risch \(-\frac {2 x}{a^{2}}-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 a^{2} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 a^{2} d}+\frac {2 i \left (9 \,{\mathrm e}^{2 i \left (d x +c \right )}+15 \,{\mathrm e}^{i \left (d x +c \right )}+8\right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}\) \(90\)
norman \(\frac {-\frac {2 x}{a}+\frac {9 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{6 a d}-\frac {2 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) a}\) \(99\)

Input:

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

Output:

1/6*(-12*d*x+6*sin(d*x+c)+16*tan(1/2*d*x+1/2*c)-tan(1/2*d*x+1/2*c)*sec(1/2 
*d*x+1/2*c)^2)/a^2/d
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.25 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {6 \, d x \cos \left (d x + c\right )^{2} + 12 \, d x \cos \left (d x + c\right ) + 6 \, d x - {\left (3 \, \cos \left (d x + c\right )^{2} + 14 \, \cos \left (d x + c\right ) + 10\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \] Input:

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

Output:

-1/3*(6*d*x*cos(d*x + c)^2 + 12*d*x*cos(d*x + c) + 6*d*x - (3*cos(d*x + c) 
^2 + 14*cos(d*x + c) + 10)*sin(d*x + c))/(a^2*d*cos(d*x + c)^2 + 2*a^2*d*c 
os(d*x + c) + a^2*d)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.64 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {24 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} + \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}}{6 \, d} \] Input:

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

Output:

1/6*((15*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^3/(cos(d*x + c) + 
1)^3)/a^2 - 24*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 + 12*sin(d*x + 
c)/((a^2 + a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)))/d
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.10 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {\frac {12 \, {\left (d x + c\right )}}{a^{2}} - \frac {12 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a^{2}} + \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \] Input:

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

Output:

-1/6*(12*(d*x + c)/a^2 - 12*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 
+ 1)*a^2) + (a^4*tan(1/2*d*x + 1/2*c)^3 - 15*a^4*tan(1/2*d*x + 1/2*c))/a^6 
)/d
 

Mupad [B] (verification not implemented)

Time = 9.62 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.26 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=-\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-16\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-12\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+12\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (c+d\,x\right )}{6\,a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.11 \[ \int \frac {\cos (c+d x)}{(a+a \sec (c+d x))^2} \, dx=\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+14 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}-12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} d x +27 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-12 d x}{6 a^{2} d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right )} \] Input:

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

Output:

( - tan((c + d*x)/2)**5 + 14*tan((c + d*x)/2)**3 - 12*tan((c + d*x)/2)**2* 
d*x + 27*tan((c + d*x)/2) - 12*d*x)/(6*a**2*d*(tan((c + d*x)/2)**2 + 1))