\(\int \frac {\sec (e+f x)}{\sqrt {a+b \sec ^2(e+f x)}} \, dx\) [259]

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

Optimal result

Integrand size = 23, antiderivative size = 82 \[ \int \frac {\sec (e+f x)}{\sqrt {a+b \sec ^2(e+f x)}} \, dx=\frac {\operatorname {EllipticF}\left (\arcsin (\sin (e+f x)),\frac {a}{a+b}\right ) \sqrt {\frac {a+b-a \sin ^2(e+f x)}{a+b}}}{f \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}} \] Output:

EllipticF(sin(f*x+e),(a/(a+b))^(1/2))*((a+b-a*sin(f*x+e)^2)/(a+b))^(1/2)/f 
/(cos(f*x+e)^2)^(1/2)/(sec(f*x+e)^2*(a+b-a*sin(f*x+e)^2))^(1/2)
 

Mathematica [A] (verified)

Time = 0.54 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.84 \[ \int \frac {\sec (e+f x)}{\sqrt {a+b \sec ^2(e+f x)}} \, dx=\frac {\sqrt {\frac {a+2 b+a \cos (2 (e+f x))}{a+b}} \operatorname {EllipticF}\left (e+f x,\frac {a}{a+b}\right ) \sec (e+f x)}{\sqrt {2} f \sqrt {a+b \sec ^2(e+f x)}} \] Input:

Integrate[Sec[e + f*x]/Sqrt[a + b*Sec[e + f*x]^2],x]
 

Output:

(Sqrt[(a + 2*b + a*Cos[2*(e + f*x)])/(a + b)]*EllipticF[e + f*x, a/(a + b) 
]*Sec[e + f*x])/(Sqrt[2]*f*Sqrt[a + b*Sec[e + f*x]^2])
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.10, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4636, 2057, 2058, 323, 321}

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 (e+f x)}{\sqrt {a+b \sec ^2(e+f x)}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4636

\(\displaystyle \frac {\int \frac {1}{\left (1-\sin ^2(e+f x)\right ) \sqrt {a+\frac {b}{1-\sin ^2(e+f x)}}}d\sin (e+f x)}{f}\)

\(\Big \downarrow \) 2057

\(\displaystyle \frac {\int \frac {1}{\left (1-\sin ^2(e+f x)\right ) \sqrt {\frac {-a \sin ^2(e+f x)+a+b}{1-\sin ^2(e+f x)}}}d\sin (e+f x)}{f}\)

\(\Big \downarrow \) 2058

\(\displaystyle \frac {\sqrt {-a \sin ^2(e+f x)+a+b} \int \frac {1}{\sqrt {1-\sin ^2(e+f x)} \sqrt {-a \sin ^2(e+f x)+a+b}}d\sin (e+f x)}{f \sqrt {1-\sin ^2(e+f x)} \sqrt {\frac {-a \sin ^2(e+f x)+a+b}{1-\sin ^2(e+f x)}}}\)

\(\Big \downarrow \) 323

\(\displaystyle \frac {\sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}} \int \frac {1}{\sqrt {1-\sin ^2(e+f x)} \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}d\sin (e+f x)}{f \sqrt {1-\sin ^2(e+f x)} \sqrt {\frac {-a \sin ^2(e+f x)+a+b}{1-\sin ^2(e+f x)}}}\)

\(\Big \downarrow \) 321

\(\displaystyle \frac {\sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}} \operatorname {EllipticF}\left (\arcsin (\sin (e+f x)),\frac {a}{a+b}\right )}{f \sqrt {1-\sin ^2(e+f x)} \sqrt {\frac {-a \sin ^2(e+f x)+a+b}{1-\sin ^2(e+f x)}}}\)

Input:

Int[Sec[e + f*x]/Sqrt[a + b*Sec[e + f*x]^2],x]
 

Output:

(EllipticF[ArcSin[Sin[e + f*x]], a/(a + b)]*Sqrt[1 - (a*Sin[e + f*x]^2)/(a 
 + b)])/(f*Sqrt[1 - Sin[e + f*x]^2]*Sqrt[(a + b - a*Sin[e + f*x]^2)/(1 - S 
in[e + f*x]^2)])
 

Defintions of rubi rules used

rule 321
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> S 
imp[(1/(Sqrt[a]*Sqrt[c]*Rt[-d/c, 2]))*EllipticF[ArcSin[Rt[-d/c, 2]*x], b*(c 
/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && GtQ[a, 
0] &&  !(NegQ[b/a] && SimplerSqrtQ[-b/a, -d/c])
 

rule 323
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> S 
imp[Sqrt[1 + (d/c)*x^2]/Sqrt[c + d*x^2]   Int[1/(Sqrt[a + b*x^2]*Sqrt[1 + ( 
d/c)*x^2]), x], x] /; FreeQ[{a, b, c, d}, x] &&  !GtQ[c, 0]
 

rule 2057
Int[(u_.)*((a_) + (b_.)/((c_) + (d_.)*(x_)^(n_)))^(p_), x_Symbol] :> Int[u* 
((b + a*c + a*d*x^n)/(c + d*x^n))^p, x] /; FreeQ[{a, b, c, d, n, p}, x]
 

rule 2058
Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))^(q_.)*((c_) + (d_.)*(x_)^(n_))^ 
(r_.))^(p_), x_Symbol] :> Simp[Simp[(e*(a + b*x^n)^q*(c + d*x^n)^r)^p/((a + 
 b*x^n)^(p*q)*(c + d*x^n)^(p*r))]   Int[u*(a + b*x^n)^(p*q)*(c + d*x^n)^(p* 
r), x], x] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x]
 

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

rule 4636
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
 Subst[Int[(a + b/(1 - ff^2*x^2)^(n/2))^p/(1 - ff^2*x^2)^((m + 1)/2), x], x 
, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2] 
 && IntegerQ[n/2] &&  !IntegerQ[p]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 2.92 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.80

method result size
default \(\frac {2 \sqrt {\frac {i \sqrt {a}\, \sqrt {b}\, \cos \left (f x +e \right )-i \sqrt {a}\, \sqrt {b}+\cos \left (f x +e \right ) a +b}{\left (a +b \right ) \left (1+\cos \left (f x +e \right )\right )}}\, \sqrt {\frac {-i \sqrt {a}\, \sqrt {b}\, \cos \left (f x +e \right )+i \sqrt {a}\, \sqrt {b}+\cos \left (f x +e \right ) a +b}{\left (a +b \right ) \left (1+\cos \left (f x +e \right )\right )}}\, \operatorname {EllipticF}\left (\sqrt {\frac {2 i \sqrt {a}\, \sqrt {b}+a -b}{a +b}}\, \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), \sqrt {\frac {-4 i a^{\frac {3}{2}} \sqrt {b}+4 i \sqrt {a}\, b^{\frac {3}{2}}+a^{2}-6 a b +b^{2}}{\left (a +b \right )^{2}}}\right ) \left (\sec \left (f x +e \right )+1\right )}{f \sqrt {\frac {2 i \sqrt {a}\, \sqrt {b}+a -b}{a +b}}\, \sqrt {a +b \sec \left (f x +e \right )^{2}}}\) \(230\)

Input:

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

Output:

2/f/((2*I*a^(1/2)*b^(1/2)+a-b)/(a+b))^(1/2)*(1/(a+b)*(I*a^(1/2)*b^(1/2)*co 
s(f*x+e)-I*a^(1/2)*b^(1/2)+cos(f*x+e)*a+b)/(1+cos(f*x+e)))^(1/2)*((-I*a^(1 
/2)*b^(1/2)*cos(f*x+e)+I*a^(1/2)*b^(1/2)+cos(f*x+e)*a+b)/(a+b)/(1+cos(f*x+ 
e)))^(1/2)*EllipticF(((2*I*a^(1/2)*b^(1/2)+a-b)/(a+b))^(1/2)*(csc(f*x+e)-c 
ot(f*x+e)),(1/(a+b)^2*(-4*I*a^(3/2)*b^(1/2)+4*I*a^(1/2)*b^(3/2)+a^2-6*a*b+ 
b^2))^(1/2))/(a+b*sec(f*x+e)^2)^(1/2)*(sec(f*x+e)+1)
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.10 (sec) , antiderivative size = 303, normalized size of antiderivative = 3.70 \[ \int \frac {\sec (e+f x)}{\sqrt {a+b \sec ^2(e+f x)}} \, dx=-\frac {{\left (2 i \, a^{\frac {3}{2}} \sqrt {\frac {a b + b^{2}}{a^{2}}} + \sqrt {a} {\left (i \, a + 2 i \, b\right )}\right )} \sqrt {\frac {2 \, a \sqrt {\frac {a b + b^{2}}{a^{2}}} - a - 2 \, b}{a}} F(\arcsin \left (\sqrt {\frac {2 \, a \sqrt {\frac {a b + b^{2}}{a^{2}}} - a - 2 \, b}{a}} {\left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {a^{2} + 8 \, a b + 8 \, b^{2} + 4 \, {\left (a^{2} + 2 \, a b\right )} \sqrt {\frac {a b + b^{2}}{a^{2}}}}{a^{2}}) + {\left (-2 i \, a^{\frac {3}{2}} \sqrt {\frac {a b + b^{2}}{a^{2}}} + \sqrt {a} {\left (-i \, a - 2 i \, b\right )}\right )} \sqrt {\frac {2 \, a \sqrt {\frac {a b + b^{2}}{a^{2}}} - a - 2 \, b}{a}} F(\arcsin \left (\sqrt {\frac {2 \, a \sqrt {\frac {a b + b^{2}}{a^{2}}} - a - 2 \, b}{a}} {\left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )}\right )\,|\,\frac {a^{2} + 8 \, a b + 8 \, b^{2} + 4 \, {\left (a^{2} + 2 \, a b\right )} \sqrt {\frac {a b + b^{2}}{a^{2}}}}{a^{2}})}{a^{2} f} \] Input:

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

Output:

-((2*I*a^(3/2)*sqrt((a*b + b^2)/a^2) + sqrt(a)*(I*a + 2*I*b))*sqrt((2*a*sq 
rt((a*b + b^2)/a^2) - a - 2*b)/a)*elliptic_f(arcsin(sqrt((2*a*sqrt((a*b + 
b^2)/a^2) - a - 2*b)/a)*(cos(f*x + e) + I*sin(f*x + e))), (a^2 + 8*a*b + 8 
*b^2 + 4*(a^2 + 2*a*b)*sqrt((a*b + b^2)/a^2))/a^2) + (-2*I*a^(3/2)*sqrt((a 
*b + b^2)/a^2) + sqrt(a)*(-I*a - 2*I*b))*sqrt((2*a*sqrt((a*b + b^2)/a^2) - 
 a - 2*b)/a)*elliptic_f(arcsin(sqrt((2*a*sqrt((a*b + b^2)/a^2) - a - 2*b)/ 
a)*(cos(f*x + e) - I*sin(f*x + e))), (a^2 + 8*a*b + 8*b^2 + 4*(a^2 + 2*a*b 
)*sqrt((a*b + b^2)/a^2))/a^2))/(a^2*f)
 

Sympy [F]

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

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

Output:

Integral(sec(e + f*x)/sqrt(a + b*sec(e + f*x)**2), x)
 

Maxima [F]

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

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

Output:

integrate(sec(f*x + e)/sqrt(b*sec(f*x + e)^2 + a), x)
 

Giac [F]

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

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

Output:

integrate(sec(f*x + e)/sqrt(b*sec(f*x + e)^2 + a), x)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

int((sqrt(sec(e + f*x)**2*b + a)*sec(e + f*x))/(sec(e + f*x)**2*b + a),x)