\(\int \frac {1}{(a+b \cos (e+f x)) \sqrt {c+d \sec (e+f x)}} \, dx\) [17]

Optimal result
Mathematica [A] (warning: unable to verify)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [F(-1)]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 27, antiderivative size = 102 \[ \int \frac {1}{(a+b \cos (e+f x)) \sqrt {c+d \sec (e+f x)}} \, dx=\frac {2 \operatorname {EllipticPi}\left (\frac {2 a}{a+b},\arcsin \left (\frac {\sqrt {1-\sec (e+f x)}}{\sqrt {2}}\right ),\frac {2 d}{c+d}\right ) \sqrt {\frac {c+d \sec (e+f x)}{c+d}} \tan (e+f x)}{(a+b) f \sqrt {c+d \sec (e+f x)} \sqrt {-\tan ^2(e+f x)}} \] Output:

2*EllipticPi(1/2*(1-sec(f*x+e))^(1/2)*2^(1/2),2*a/(a+b),2^(1/2)*(d/(c+d))^ 
(1/2))*((c+d*sec(f*x+e))/(c+d))^(1/2)*tan(f*x+e)/(a+b)/f/(c+d*sec(f*x+e))^ 
(1/2)/(-tan(f*x+e)^2)^(1/2)
 

Mathematica [A] (warning: unable to verify)

Time = 12.05 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.83 \[ \int \frac {1}{(a+b \cos (e+f x)) \sqrt {c+d \sec (e+f x)}} \, dx=-\frac {2 \sqrt {\frac {d+c \cos (e+f x)}{(c+d) (1+\cos (e+f x))}} \left ((a+b) \operatorname {EllipticF}\left (\arcsin \left (\tan \left (\frac {1}{2} (e+f x)\right )\right ),\frac {c-d}{c+d}\right )-2 a \operatorname {EllipticPi}\left (\frac {-a+b}{a+b},\arcsin \left (\tan \left (\frac {1}{2} (e+f x)\right )\right ),\frac {c-d}{c+d}\right )\right ) \sqrt {\cos (e+f x) \sec ^2\left (\frac {1}{2} (e+f x)\right )} \sqrt {\sec (e+f x)} \sqrt {1+\sec (e+f x)}}{(a-b) (a+b) f \sqrt {\sec ^2\left (\frac {1}{2} (e+f x)\right )} \sqrt {c+d \sec (e+f x)}} \] Input:

Integrate[1/((a + b*Cos[e + f*x])*Sqrt[c + d*Sec[e + f*x]]),x]
 

Output:

(-2*Sqrt[(d + c*Cos[e + f*x])/((c + d)*(1 + Cos[e + f*x]))]*((a + b)*Ellip 
ticF[ArcSin[Tan[(e + f*x)/2]], (c - d)/(c + d)] - 2*a*EllipticPi[(-a + b)/ 
(a + b), ArcSin[Tan[(e + f*x)/2]], (c - d)/(c + d)])*Sqrt[Cos[e + f*x]*Sec 
[(e + f*x)/2]^2]*Sqrt[Sec[e + f*x]]*Sqrt[1 + Sec[e + f*x]])/((a - b)*(a + 
b)*f*Sqrt[Sec[(e + f*x)/2]^2]*Sqrt[c + d*Sec[e + f*x]])
 

Rubi [A] (verified)

Time = 0.45 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {3042, 3308, 3042, 4461}

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 {1}{(a+b \cos (e+f x)) \sqrt {c+d \sec (e+f x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\left (a+b \sin \left (e+f x+\frac {\pi }{2}\right )\right ) \sqrt {c+d \csc \left (e+f x+\frac {\pi }{2}\right )}}dx\)

\(\Big \downarrow \) 3308

\(\displaystyle \int \frac {\sec (e+f x)}{(a \sec (e+f x)+b) \sqrt {c+d \sec (e+f x)}}dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4461

\(\displaystyle \frac {2 \tan (e+f x) \sqrt {\frac {c+d \sec (e+f x)}{c+d}} \operatorname {EllipticPi}\left (\frac {2 a}{a+b},\arcsin \left (\frac {\sqrt {1-\sec (e+f x)}}{\sqrt {2}}\right ),\frac {2 d}{c+d}\right )}{f (a+b) \sqrt {-\tan ^2(e+f x)} \sqrt {c+d \sec (e+f x)}}\)

Input:

Int[1/((a + b*Cos[e + f*x])*Sqrt[c + d*Sec[e + f*x]]),x]
 

Output:

(2*EllipticPi[(2*a)/(a + b), ArcSin[Sqrt[1 - Sec[e + f*x]]/Sqrt[2]], (2*d) 
/(c + d)]*Sqrt[(c + d*Sec[e + f*x])/(c + d)]*Tan[e + f*x])/((a + b)*f*Sqrt 
[c + d*Sec[e + f*x]]*Sqrt[-Tan[e + f*x]^2])
 

Defintions of rubi rules used

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

rule 3308
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_)*((a_) + (b_.)*sin[(e_.) + ( 
f_.)*(x_)])^(m_.), x_Symbol] :> Int[(b + a*Csc[e + f*x])^m*((c + d*Csc[e + 
f*x])^n/Csc[e + f*x]^m), x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&  !Integer 
Q[n] && IntegerQ[m]
 

rule 4461
Int[csc[(e_.) + (f_.)*(x_)]/(Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(cs 
c[(e_.) + (f_.)*(x_)]*(d_.) + (c_))), x_Symbol] :> Simp[-2*(Cot[e + f*x]/(f 
*(c + d)*Sqrt[a + b*Csc[e + f*x]]*Sqrt[-Cot[e + f*x]^2]))*Sqrt[(a + b*Csc[e 
 + f*x])/(a + b)]*EllipticPi[2*(d/(c + d)), ArcSin[Sqrt[1 - Csc[e + f*x]]/S 
qrt[2]], 2*(b/(a + b))], 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]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(205\) vs. \(2(97)=194\).

Time = 4.85 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.02

method result size
default \(-\frac {2 \left (2 a \operatorname {EllipticPi}\left (-\csc \left (f x +e \right )+\cot \left (f x +e \right ), -\frac {a -b}{a +b}, \sqrt {\frac {c -d}{c +d}}\right )-a \operatorname {EllipticF}\left (-\csc \left (f x +e \right )+\cot \left (f x +e \right ), \sqrt {\frac {c -d}{c +d}}\right )-b \operatorname {EllipticF}\left (-\csc \left (f x +e \right )+\cot \left (f x +e \right ), \sqrt {\frac {c -d}{c +d}}\right )\right ) \left (1+\cos \left (f x +e \right )\right ) \sqrt {c +d \sec \left (f x +e \right )}\, \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {d +c \cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right ) \left (c +d \right )}}}{f \left (d +c \cos \left (f x +e \right )\right ) \left (a -b \right ) \left (a +b \right )}\) \(206\)

Input:

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

Output:

-2/f*(2*a*EllipticPi(-csc(f*x+e)+cot(f*x+e),-(a-b)/(a+b),((c-d)/(c+d))^(1/ 
2))-a*EllipticF(-csc(f*x+e)+cot(f*x+e),((c-d)/(c+d))^(1/2))-b*EllipticF(-c 
sc(f*x+e)+cot(f*x+e),((c-d)/(c+d))^(1/2)))*(1+cos(f*x+e))*(c+d*sec(f*x+e)) 
^(1/2)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*((d+c*cos(f*x+e))/(1+cos(f*x+e))/ 
(c+d))^(1/2)/(d+c*cos(f*x+e))/(a-b)/(a+b)
 

Fricas [F(-1)]

Timed out. \[ \int \frac {1}{(a+b \cos (e+f x)) \sqrt {c+d \sec (e+f x)}} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Sympy [F]

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

integrate(1/(a+b*cos(f*x+e))/(c+d*sec(f*x+e))**(1/2),x)
 

Output:

Integral(1/((a + b*cos(e + f*x))*sqrt(c + d*sec(e + f*x))), x)
 

Maxima [F]

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

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

Output:

integrate(1/((b*cos(f*x + e) + a)*sqrt(d*sec(f*x + e) + c)), x)
 

Giac [F]

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

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

Output:

integrate(1/((b*cos(f*x + e) + a)*sqrt(d*sec(f*x + e) + c)), x)
 

Mupad [F(-1)]

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

int(1/((c + d/cos(e + f*x))^(1/2)*(a + b*cos(e + f*x))),x)
 

Output:

int(1/((c + d/cos(e + f*x))^(1/2)*(a + b*cos(e + f*x))), x)
 

Reduce [F]

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

int(1/(a+b*cos(f*x+e))/(c+d*sec(f*x+e))^(1/2),x)
 

Output:

int(sqrt(sec(e + f*x)*d + c)/(cos(e + f*x)*sec(e + f*x)*b*d + cos(e + f*x) 
*b*c + sec(e + f*x)*a*d + a*c),x)