\(\int \frac {\sec (e+f x) (A+A \sec (e+f x))}{\sqrt {a+b \sec (e+f x)}} \, dx\) [392]

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

Optimal result

Integrand size = 31, antiderivative size = 105 \[ \int \frac {\sec (e+f x) (A+A \sec (e+f x))}{\sqrt {a+b \sec (e+f x)}} \, dx=-\frac {2 A (a-b) \sqrt {a+b} \cot (e+f x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{b^2 f} \] Output:

-2*A*(a-b)*(a+b)^(1/2)*cot(f*x+e)*EllipticE((a+b*sec(f*x+e))^(1/2)/(a+b)^( 
1/2),((a+b)/(a-b))^(1/2))*(b*(1-sec(f*x+e))/(a+b))^(1/2)*(-b*(1+sec(f*x+e) 
)/(a-b))^(1/2)/b^2/f
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(248\) vs. \(2(105)=210\).

Time = 8.91 (sec) , antiderivative size = 248, normalized size of antiderivative = 2.36 \[ \int \frac {\sec (e+f x) (A+A \sec (e+f x))}{\sqrt {a+b \sec (e+f x)}} \, dx=\frac {A (1+\sec (e+f x)) \left (2 (b+a \cos (e+f x)) \tan \left (\frac {1}{2} (e+f x)\right )+\frac {\sqrt {\sec ^2\left (\frac {1}{2} (e+f x)\right )} \sqrt {\cos ^2\left (\frac {1}{2} (e+f x)\right ) \sec (e+f x)} \left (\frac {\sqrt {\frac {a-b}{a+b}} (a+b) \sqrt {\frac {b+a \cos (e+f x)}{(a+b) (1+\cos (e+f x))}} E\left (\arcsin \left (\sqrt {\frac {a-b}{a+b}} \tan \left (\frac {1}{2} (e+f x)\right )\right )|\frac {a+b}{a-b}\right )}{\sqrt {\frac {\cos (e+f x)}{1+\cos (e+f x)}}}+(b+a \cos (e+f x)) \tan \left (\frac {1}{2} (e+f x)\right )\right ) \left (-1+\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )}{\sqrt {\sec (e+f x)}}\right )}{b f \sqrt {a+b \sec (e+f x)}} \] Input:

Integrate[(Sec[e + f*x]*(A + A*Sec[e + f*x]))/Sqrt[a + b*Sec[e + f*x]],x]
 

Output:

(A*(1 + Sec[e + f*x])*(2*(b + a*Cos[e + f*x])*Tan[(e + f*x)/2] + (Sqrt[Sec 
[(e + f*x)/2]^2]*Sqrt[Cos[(e + f*x)/2]^2*Sec[e + f*x]]*((Sqrt[(a - b)/(a + 
 b)]*(a + b)*Sqrt[(b + a*Cos[e + f*x])/((a + b)*(1 + Cos[e + f*x]))]*Ellip 
ticE[ArcSin[Sqrt[(a - b)/(a + b)]*Tan[(e + f*x)/2]], (a + b)/(a - b)])/Sqr 
t[Cos[e + f*x]/(1 + Cos[e + f*x])] + (b + a*Cos[e + f*x])*Tan[(e + f*x)/2] 
)*(-1 + Tan[(e + f*x)/2]^2))/Sqrt[Sec[e + f*x]]))/(b*f*Sqrt[a + b*Sec[e + 
f*x]])
 

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {3042, 4492}

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) (A \sec (e+f x)+A)}{\sqrt {a+b \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 )+A\right )}{\sqrt {a+b \csc \left (e+f x+\frac {\pi }{2}\right )}}dx\)

\(\Big \downarrow \) 4492

\(\displaystyle -\frac {2 A (a-b) \sqrt {a+b} \cot (e+f x) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (\sec (e+f x)+1)}{a-b}} E\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{b^2 f}\)

Input:

Int[(Sec[e + f*x]*(A + A*Sec[e + f*x]))/Sqrt[a + b*Sec[e + f*x]],x]
 

Output:

(-2*A*(a - b)*Sqrt[a + b]*Cot[e + f*x]*EllipticE[ArcSin[Sqrt[a + b*Sec[e + 
 f*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[e + f*x]))/(a + b)] 
*Sqrt[-((b*(1 + Sec[e + f*x]))/(a - b))])/(b^2*f)
 

Defintions of rubi rules used

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

rule 4492
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[c 
sc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*(A*b - a*B)*Rt[a 
 + b*(B/A), 2]*Sqrt[b*((1 - Csc[e + f*x])/(a + b))]*(Sqrt[(-b)*((1 + Csc[e 
+ f*x])/(a - b))]/(b^2*f*Cot[e + f*x]))*EllipticE[ArcSin[Sqrt[a + b*Csc[e + 
 f*x]]/Rt[a + b*(B/A), 2]], (a*A + b*B)/(a*A - b*B)], x] /; FreeQ[{a, b, e, 
 f, A, B}, x] && NeQ[a^2 - b^2, 0] && EqQ[A^2 - B^2, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(370\) vs. \(2(96)=192\).

Time = 26.78 (sec) , antiderivative size = 371, normalized size of antiderivative = 3.53

method result size
default \(-\frac {2 A \left (\left (-\cos \left (f x +e \right )^{2}-2 \cos \left (f x +e \right )-1\right ) \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, a \operatorname {EllipticE}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )+\left (-\cos \left (f x +e \right )^{2}-2 \cos \left (f x +e \right )-1\right ) \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, b \operatorname {EllipticE}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )+\left (2 \cos \left (f x +e \right )^{2}+4 \cos \left (f x +e \right )+2\right ) \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, b \operatorname {EllipticF}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )-\sin \left (f x +e \right ) \cos \left (f x +e \right ) a -b \sin \left (f x +e \right )\right ) \sqrt {a +b \sec \left (f x +e \right )}}{f b \left (\cos \left (f x +e \right )^{2} a +a \cos \left (f x +e \right )+b \cos \left (f x +e \right )+b \right )}\) \(371\)
parts \(-\frac {2 A \left (\cos \left (f x +e \right )+1\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, \operatorname {EllipticF}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {a +b \sec \left (f x +e \right )}}{f \left (b +a \cos \left (f x +e \right )\right )}+\frac {2 A \left (\left (\cos \left (f x +e \right )^{2}+2 \cos \left (f x +e \right )+1\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, a \operatorname {EllipticE}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )+\left (\cos \left (f x +e \right )^{2}+2 \cos \left (f x +e \right )+1\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, b \operatorname {EllipticE}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )+\left (-\cos \left (f x +e \right )^{2}-2 \cos \left (f x +e \right )-1\right ) \sqrt {\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {\frac {b +a \cos \left (f x +e \right )}{\left (a +b \right ) \left (\cos \left (f x +e \right )+1\right )}}\, b \operatorname {EllipticF}\left (\cot \left (f x +e \right )-\csc \left (f x +e \right ), \sqrt {\frac {a -b}{a +b}}\right )+\sin \left (f x +e \right ) \cos \left (f x +e \right ) a +b \sin \left (f x +e \right )\right ) \sqrt {a +b \sec \left (f x +e \right )}}{f b \left (\cos \left (f x +e \right )^{2} a +a \cos \left (f x +e \right )+b \cos \left (f x +e \right )+b \right )}\) \(480\)

Input:

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

Output:

-2*A/f/b*((-cos(f*x+e)^2-2*cos(f*x+e)-1)*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f* 
x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*a*EllipticE(cot(f*x+e)-cs 
c(f*x+e),((a-b)/(a+b))^(1/2))+(-cos(f*x+e)^2-2*cos(f*x+e)-1)*(1/(a+b)*(b+a 
*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*b*Ell 
ipticE(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))+(2*cos(f*x+e)^2+4*cos(f* 
x+e)+2)*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f 
*x+e)+1))^(1/2)*b*EllipticF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))-sin 
(f*x+e)*cos(f*x+e)*a-b*sin(f*x+e))*(a+b*sec(f*x+e))^(1/2)/(cos(f*x+e)^2*a+ 
a*cos(f*x+e)+b*cos(f*x+e)+b)
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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