\(\int \frac {a+b \tan (e+f x)}{\sqrt {d \sec (e+f x)}} \, dx\) [590]

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 = 58 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {d \sec (e+f x)}} \, dx=-\frac {2 b}{f \sqrt {d \sec (e+f x)}}+\frac {2 a E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{f \sqrt {\cos (e+f x)} \sqrt {d \sec (e+f x)}} \] Output:

-2*b/f/(d*sec(f*x+e))^(1/2)+2*a*EllipticE(sin(1/2*f*x+1/2*e),2^(1/2))/f/co 
s(f*x+e)^(1/2)/(d*sec(f*x+e))^(1/2)
 

Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.93 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {d \sec (e+f x)}} \, dx=\frac {-2 b \sqrt {\cos (e+f x)}+2 a E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{f \sqrt {\cos (e+f x)} \sqrt {d \sec (e+f x)}} \] Input:

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

Output:

(-2*b*Sqrt[Cos[e + f*x]] + 2*a*EllipticE[(e + f*x)/2, 2])/(f*Sqrt[Cos[e + 
f*x]]*Sqrt[d*Sec[e + f*x]])
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3967, 3042, 4258, 3042, 3119}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3967

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4258

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {a \int \sqrt {\sin \left (e+f x+\frac {\pi }{2}\right )}dx}{\sqrt {\cos (e+f x)} \sqrt {d \sec (e+f x)}}-\frac {2 b}{f \sqrt {d \sec (e+f x)}}\)

\(\Big \downarrow \) 3119

\(\displaystyle \frac {2 a E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{f \sqrt {\cos (e+f x)} \sqrt {d \sec (e+f x)}}-\frac {2 b}{f \sqrt {d \sec (e+f x)}}\)

Input:

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

Output:

(-2*b)/(f*Sqrt[d*Sec[e + f*x]]) + (2*a*EllipticE[(e + f*x)/2, 2])/(f*Sqrt[ 
Cos[e + f*x]]*Sqrt[d*Sec[e + f*x]])
 

Defintions of rubi rules used

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

rule 3119
Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)* 
(c - Pi/2 + d*x), 2], x] /; FreeQ[{c, d}, x]
 

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 4258
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x] 
)^n*Sin[c + d*x]^n   Int[1/Sin[c + d*x]^n, x], x] /; FreeQ[{b, c, d}, x] && 
 EqQ[n^2, 1/4]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 8.91 (sec) , antiderivative size = 193, normalized size of antiderivative = 3.33

method result size
parts \(\frac {2 a \left (i \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \operatorname {EllipticF}\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \left (-\cos \left (f x +e \right )-2-\sec \left (f x +e \right )\right )+i \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \operatorname {EllipticE}\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \left (2+\cos \left (f x +e \right )+\sec \left (f x +e \right )\right )+\sin \left (f x +e \right )\right )}{f \left (1+\cos \left (f x +e \right )\right ) \sqrt {d \sec \left (f x +e \right )}}-\frac {2 b}{f \sqrt {d \sec \left (f x +e \right )}}\) \(193\)
risch \(-\frac {i \left (-i b +a \right ) \sqrt {2}}{f \sqrt {\frac {d \,{\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}}}-\frac {i a \left (-\frac {2 \left (d \,{\mathrm e}^{2 i \left (f x +e \right )}+d \right )}{d \sqrt {{\mathrm e}^{i \left (f x +e \right )} \left (d \,{\mathrm e}^{2 i \left (f x +e \right )}+d \right )}}+\frac {i \sqrt {-i \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\, \sqrt {2}\, \sqrt {i \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}\, \sqrt {i {\mathrm e}^{i \left (f x +e \right )}}\, \left (-2 i \operatorname {EllipticE}\left (\sqrt {-i \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}, \frac {\sqrt {2}}{2}\right )+i \operatorname {EllipticF}\left (\sqrt {-i \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}, \frac {\sqrt {2}}{2}\right )\right )}{\sqrt {d \,{\mathrm e}^{3 i \left (f x +e \right )}+d \,{\mathrm e}^{i \left (f x +e \right )}}}\right ) \sqrt {2}\, \sqrt {d \,{\mathrm e}^{i \left (f x +e \right )} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}}{f \sqrt {\frac {d \,{\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}}\, \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(306\)
default \(\frac {i \operatorname {EllipticF}\left (i \left (-\csc \left (f x +e \right )+\cot \left (f x +e \right )\right ), i\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, a \left (4 \cos \left (f x +e \right )+8+4 \sec \left (f x +e \right )\right )+i \operatorname {EllipticE}\left (i \left (-\csc \left (f x +e \right )+\cot \left (f x +e \right )\right ), i\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, a \left (-4 \cos \left (f x +e \right )-8-4 \sec \left (f x +e \right )\right )+\ln \left (\frac {4 \cos \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}+4 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}-2 \cos \left (f x +e \right )+2}{1+\cos \left (f x +e \right )}\right ) b -\ln \left (\frac {2 \cos \left (f x +e \right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}+2 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}-\cos \left (f x +e \right )+1}{1+\cos \left (f x +e \right )}\right ) b +4 \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}\, a \sin \left (f x +e \right )+\left (-4 \cos \left (f x +e \right )-4\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}\, b}{2 f \left (1+\cos \left (f x +e \right )\right ) \sqrt {d \sec \left (f x +e \right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\left (1+\cos \left (f x +e \right )\right )^{2}}}}\) \(446\)

Input:

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

Output:

2*a/f/(1+cos(f*x+e))/(d*sec(f*x+e))^(1/2)*(I*(1/(1+cos(f*x+e)))^(1/2)*(cos 
(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*(-cos 
(f*x+e)-2-sec(f*x+e))+I*(1/(1+cos(f*x+e)))^(1/2)*(cos(f*x+e)/(1+cos(f*x+e) 
))^(1/2)*EllipticE(I*(csc(f*x+e)-cot(f*x+e)),I)*(2+cos(f*x+e)+sec(f*x+e))+ 
sin(f*x+e))-2*b/f/(d*sec(f*x+e))^(1/2)
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.09 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.53 \[ \int \frac {a+b \tan (e+f x)}{\sqrt {d \sec (e+f x)}} \, dx=\frac {i \, \sqrt {2} a \sqrt {d} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )\right ) - i \, \sqrt {2} a \sqrt {d} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )\right ) - 2 \, b \sqrt {\frac {d}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{d f} \] Input:

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

Output:

(I*sqrt(2)*a*sqrt(d)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos 
(f*x + e) + I*sin(f*x + e))) - I*sqrt(2)*a*sqrt(d)*weierstrassZeta(-4, 0, 
weierstrassPInverse(-4, 0, cos(f*x + e) - I*sin(f*x + e))) - 2*b*sqrt(d/co 
s(f*x + e))*cos(f*x + e))/(d*f)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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