\(\int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx\) [167]

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

Optimal result

Integrand size = 26, antiderivative size = 89 \[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=\frac {2 A \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \sqrt {2} A \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d} \] Output:

2*A*arctan(a^(1/2)*tan(d*x+c)/(a-a*sec(d*x+c))^(1/2))/a^(1/2)/d-2*2^(1/2)* 
A*arctan(1/2*a^(1/2)*tan(d*x+c)*2^(1/2)/(a-a*sec(d*x+c))^(1/2))/a^(1/2)/d
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.89 \[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=\frac {2 A \left (\text {arctanh}\left (\sqrt {1+\sec (c+d x)}\right )-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {1+\sec (c+d x)}}{\sqrt {2}}\right )\right ) \tan (c+d x)}{d \sqrt {1+\sec (c+d x)} \sqrt {a-a \sec (c+d x)}} \] Input:

Integrate[(A + A*Sec[c + d*x])/Sqrt[a - a*Sec[c + d*x]],x]
 

Output:

(2*A*(ArcTanh[Sqrt[1 + Sec[c + d*x]]] - Sqrt[2]*ArcTanh[Sqrt[1 + Sec[c + d 
*x]]/Sqrt[2]])*Tan[c + d*x])/(d*Sqrt[1 + Sec[c + d*x]]*Sqrt[a - a*Sec[c + 
d*x]])
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.98, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3042, 4392, 3042, 4375, 383, 216}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A \csc \left (c+d x+\frac {\pi }{2}\right )+A}{\sqrt {a-a \csc \left (c+d x+\frac {\pi }{2}\right )}}dx\)

\(\Big \downarrow \) 4392

\(\displaystyle -a A \int \frac {\tan ^2(c+d x)}{(a-a \sec (c+d x))^{3/2}}dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4375

\(\displaystyle \frac {2 a A \int \frac {\tan ^2(c+d x)}{(a-a \sec (c+d x)) \left (\frac {a \tan ^2(c+d x)}{a-a \sec (c+d x)}+1\right ) \left (\frac {a \tan ^2(c+d x)}{a-a \sec (c+d x)}+2\right )}d\left (-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}\)

\(\Big \downarrow \) 383

\(\displaystyle \frac {2 a A \left (\frac {2 \int \frac {1}{\frac {a \tan ^2(c+d x)}{a-a \sec (c+d x)}+2}d\left (-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a}-\frac {\int \frac {1}{\frac {a \tan ^2(c+d x)}{a-a \sec (c+d x)}+1}d\left (-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a}\right )}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {2 a A \left (\frac {\arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a^{3/2}}-\frac {\sqrt {2} \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{a^{3/2}}\right )}{d}\)

Input:

Int[(A + A*Sec[c + d*x])/Sqrt[a - a*Sec[c + d*x]],x]
 

Output:

(2*a*A*(ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a - a*Sec[c + d*x]]]/a^(3/2) - 
(Sqrt[2]*ArcTan[(Sqrt[a]*Tan[c + d*x])/(Sqrt[2]*Sqrt[a - a*Sec[c + d*x]])] 
)/a^(3/2)))/d
 

Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 383
Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Sym 
bol] :> Simp[(-a)*(e^2/(b*c - a*d))   Int[(e*x)^(m - 2)/(a + b*x^2), x], x] 
 + Simp[c*(e^2/(b*c - a*d))   Int[(e*x)^(m - 2)/(c + d*x^2), x], x] /; Free 
Q[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3]
 

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

rule 4375
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n 
_.), x_Symbol] :> Simp[-2*(a^(m/2 + n + 1/2)/d)   Subst[Int[x^m*((2 + a*x^2 
)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c + d*x] 
]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && I 
ntegerQ[n - 1/2]
 

rule 4392
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*( 
d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m   Int[Cot[e + f*x]^(2*m)*( 
c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && E 
qQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !( 
IntegerQ[n] && GtQ[m - n, 0])
 
Maple [F]

\[\int \frac {A +A \sec \left (d x +c \right )}{\sqrt {a -a \sec \left (d x +c \right )}}d x\]

Input:

int((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x)
 

Output:

int((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x)
 

Fricas [A] (verification not implemented)

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

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

Output:

[(sqrt(2)*A*a*sqrt(-1/a)*log(-(2*sqrt(2)*(cos(d*x + c)^2 + cos(d*x + c))*s 
qrt((a*cos(d*x + c) - a)/cos(d*x + c))*sqrt(-1/a) - (3*cos(d*x + c) + 1)*s 
in(d*x + c))/((cos(d*x + c) - 1)*sin(d*x + c))) - A*sqrt(-a)*log((2*(cos(d 
*x + c)^2 + cos(d*x + c))*sqrt(-a)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c)) 
 - (2*a*cos(d*x + c) + a)*sin(d*x + c))/sin(d*x + c)))/(a*d), 2*(sqrt(2)*A 
*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*cos(d*x + 
c)/(sqrt(a)*sin(d*x + c))) - A*sqrt(a)*arctan(sqrt((a*cos(d*x + c) - a)/co 
s(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))))/(a*d)]
 

Sympy [F]

\[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=A \left (\int \frac {\sec {\left (c + d x \right )}}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx + \int \frac {1}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx\right ) \] Input:

integrate((A+A*sec(d*x+c))/(a-a*sec(d*x+c))**(1/2),x)
 

Output:

A*(Integral(sec(c + d*x)/sqrt(-a*sec(c + d*x) + a), x) + Integral(1/sqrt(- 
a*sec(c + d*x) + a), x))
 

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.38 (sec) , antiderivative size = 699, normalized size of antiderivative = 7.85 \[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx =\text {Too large to display} \] Input:

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

Output:

-(sqrt(2)*sqrt(a)*arctan2(((abs(2*e^(I*d*x + I*c) - 2)^4 + 16*cos(d*x + c) 
^4 + 16*sin(d*x + c)^4 + 8*(cos(d*x + c)^2 - sin(d*x + c)^2 + 2*cos(d*x + 
c) + 1)*abs(2*e^(I*d*x + I*c) - 2)^2 + 64*cos(d*x + c)^3 + 32*(cos(d*x + c 
)^2 + 2*cos(d*x + c) + 1)*sin(d*x + c)^2 + 96*cos(d*x + c)^2 + 64*cos(d*x 
+ c) + 16)^(1/4)*sin(1/2*arctan2(8*(cos(d*x + c) + 1)*sin(d*x + c)/abs(2*e 
^(I*d*x + I*c) - 2)^2, (abs(2*e^(I*d*x + I*c) - 2)^2 + 4*cos(d*x + c)^2 - 
4*sin(d*x + c)^2 + 8*cos(d*x + c) + 4)/abs(2*e^(I*d*x + I*c) - 2)^2)) + 2* 
sin(d*x + c))/abs(2*e^(I*d*x + I*c) - 2), ((abs(2*e^(I*d*x + I*c) - 2)^4 + 
 16*cos(d*x + c)^4 + 16*sin(d*x + c)^4 + 8*(cos(d*x + c)^2 - sin(d*x + c)^ 
2 + 2*cos(d*x + c) + 1)*abs(2*e^(I*d*x + I*c) - 2)^2 + 64*cos(d*x + c)^3 + 
 32*(cos(d*x + c)^2 + 2*cos(d*x + c) + 1)*sin(d*x + c)^2 + 96*cos(d*x + c) 
^2 + 64*cos(d*x + c) + 16)^(1/4)*cos(1/2*arctan2(8*(cos(d*x + c) + 1)*sin( 
d*x + c)/abs(2*e^(I*d*x + I*c) - 2)^2, (abs(2*e^(I*d*x + I*c) - 2)^2 + 4*c 
os(d*x + c)^2 - 4*sin(d*x + c)^2 + 8*cos(d*x + c) + 4)/abs(2*e^(I*d*x + I* 
c) - 2)^2)) + 2*cos(d*x + c) + 2)/abs(2*e^(I*d*x + I*c) - 2)) - sqrt(a)*ar 
ctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^( 
1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + 
c), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/ 
4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + cos(d*x + c) 
))*A/(a*d)
 

Giac [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.80 \[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=\frac {2 \, A {\left (\frac {\sqrt {2} \arctan \left (\frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{\sqrt {a}}\right )}{\sqrt {a}} - \frac {\arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{2 \, \sqrt {a}}\right )}{\sqrt {a}}\right )}}{d} \] Input:

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

Output:

2*A*(sqrt(2)*arctan(sqrt(a*tan(1/2*d*x + 1/2*c)^2 - a)/sqrt(a))/sqrt(a) - 
arctan(1/2*sqrt(2)*sqrt(a*tan(1/2*d*x + 1/2*c)^2 - a)/sqrt(a))/sqrt(a))/d
 

Mupad [F(-1)]

Timed out. \[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=\int \frac {A+\frac {A}{\cos \left (c+d\,x\right )}}{\sqrt {a-\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx=-\sqrt {a}\, \left (\int \frac {\sqrt {-\sec \left (d x +c \right )+1}}{\sec \left (d x +c \right )-1}d x +\int \frac {\sqrt {-\sec \left (d x +c \right )+1}\, \sec \left (d x +c \right )}{\sec \left (d x +c \right )-1}d x \right ) \] Input:

int((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x)
 

Output:

 - sqrt(a)*(int(sqrt( - sec(c + d*x) + 1)/(sec(c + d*x) - 1),x) + int((sqr 
t( - sec(c + d*x) + 1)*sec(c + d*x))/(sec(c + d*x) - 1),x))