\(\int \frac {\csc ^2(e+f x)}{\sqrt {g \cos (e+f x)} (a+b \sin (e+f x))} \, dx\) [1390]

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

Optimal result

Integrand size = 33, antiderivative size = 448 \[ \int \frac {\csc ^2(e+f x)}{\sqrt {g \cos (e+f x)} (a+b \sin (e+f x))} \, dx=\frac {b \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f \sqrt {g}}-\frac {b^{5/2} \arctan \left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \left (-a^2+b^2\right )^{3/4} f \sqrt {g}}+\frac {b \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f \sqrt {g}}-\frac {b^{5/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \left (-a^2+b^2\right )^{3/4} f \sqrt {g}}-\frac {\sqrt {g \cos (e+f x)} \csc (e+f x)}{a f g}+\frac {\sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right )}{a f \sqrt {g \cos (e+f x)}}+\frac {b^2 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a \left (a^2-b^2+b \sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}}+\frac {b^2 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a \left (a^2-b \left (b+\sqrt {-a^2+b^2}\right )\right ) f \sqrt {g \cos (e+f x)}} \] Output:

b*arctan((g*cos(f*x+e))^(1/2)/g^(1/2))/a^2/f/g^(1/2)-b^(5/2)*arctan(b^(1/2 
)*(g*cos(f*x+e))^(1/2)/(-a^2+b^2)^(1/4)/g^(1/2))/a^2/(-a^2+b^2)^(3/4)/f/g^ 
(1/2)+b*arctanh((g*cos(f*x+e))^(1/2)/g^(1/2))/a^2/f/g^(1/2)-b^(5/2)*arctan 
h(b^(1/2)*(g*cos(f*x+e))^(1/2)/(-a^2+b^2)^(1/4)/g^(1/2))/a^2/(-a^2+b^2)^(3 
/4)/f/g^(1/2)-(g*cos(f*x+e))^(1/2)*csc(f*x+e)/a/f/g+cos(f*x+e)^(1/2)*Inver 
seJacobiAM(1/2*f*x+1/2*e,2^(1/2))/a/f/(g*cos(f*x+e))^(1/2)+b^2*cos(f*x+e)^ 
(1/2)*EllipticPi(sin(1/2*f*x+1/2*e),2*b/(b-(-a^2+b^2)^(1/2)),2^(1/2))/a/(a 
^2-b^2+b*(-a^2+b^2)^(1/2))/f/(g*cos(f*x+e))^(1/2)+b^2*cos(f*x+e)^(1/2)*Ell 
ipticPi(sin(1/2*f*x+1/2*e),2*b/(b+(-a^2+b^2)^(1/2)),2^(1/2))/a/(a^2-b*(b+( 
-a^2+b^2)^(1/2)))/f/(g*cos(f*x+e))^(1/2)
 

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 6 vs. order 4 in optimal.

Time = 31.02 (sec) , antiderivative size = 2093, normalized size of antiderivative = 4.67 \[ \int \frac {\csc ^2(e+f x)}{\sqrt {g \cos (e+f x)} (a+b \sin (e+f x))} \, dx=\text {Result too large to show} \] Input:

Integrate[Csc[e + f*x]^2/(Sqrt[g*Cos[e + f*x]]*(a + b*Sin[e + f*x])),x]
 

Output:

-(Cot[e + f*x]/(a*f*Sqrt[g*Cos[e + f*x]])) - (Sqrt[Cos[e + f*x]]*((4*a*(a 
+ b*Sqrt[1 - Cos[e + f*x]^2])*((5*a*(a^2 - b^2)*AppellF1[1/4, 1/2, 1, 5/4, 
 Cos[e + f*x]^2, (b^2*Cos[e + f*x]^2)/(-a^2 + b^2)]*Sqrt[Cos[e + f*x]])/(S 
qrt[1 - Cos[e + f*x]^2]*(5*(a^2 - b^2)*AppellF1[1/4, 1/2, 1, 5/4, Cos[e + 
f*x]^2, (b^2*Cos[e + f*x]^2)/(-a^2 + b^2)] - 2*(2*b^2*AppellF1[5/4, 1/2, 2 
, 9/4, Cos[e + f*x]^2, (b^2*Cos[e + f*x]^2)/(-a^2 + b^2)] + (-a^2 + b^2)*A 
ppellF1[5/4, 3/2, 1, 9/4, Cos[e + f*x]^2, (b^2*Cos[e + f*x]^2)/(-a^2 + b^2 
)])*Cos[e + f*x]^2)*(a^2 + b^2*(-1 + Cos[e + f*x]^2))) - ((1/8 - I/8)*Sqrt 
[b]*(2*ArcTan[1 - ((1 + I)*Sqrt[b]*Sqrt[Cos[e + f*x]])/(-a^2 + b^2)^(1/4)] 
 - 2*ArcTan[1 + ((1 + I)*Sqrt[b]*Sqrt[Cos[e + f*x]])/(-a^2 + b^2)^(1/4)] + 
 Log[Sqrt[-a^2 + b^2] - (1 + I)*Sqrt[b]*(-a^2 + b^2)^(1/4)*Sqrt[Cos[e + f* 
x]] + I*b*Cos[e + f*x]] - Log[Sqrt[-a^2 + b^2] + (1 + I)*Sqrt[b]*(-a^2 + b 
^2)^(1/4)*Sqrt[Cos[e + f*x]] + I*b*Cos[e + f*x]]))/(-a^2 + b^2)^(3/4)))/(S 
qrt[1 - Cos[e + f*x]^2]*(b + a*Csc[e + f*x])) - (b*(-1 + Cos[e + f*x]^2)*( 
a + b*Sqrt[1 - Cos[e + f*x]^2])*Cos[2*(e + f*x)]*Csc[e + f*x]*((-10*Sqrt[2 
]*(2*a^2 - b^2)*ArcTan[1 - (Sqrt[2]*Sqrt[b]*Sqrt[Cos[e + f*x]])/(a^2 - b^2 
)^(1/4)])/(a*Sqrt[b]*(a^2 - b^2)^(3/4)) + (10*Sqrt[2]*(2*a^2 - b^2)*ArcTan 
[1 + (Sqrt[2]*Sqrt[b]*Sqrt[Cos[e + f*x]])/(a^2 - b^2)^(1/4)])/(a*Sqrt[b]*( 
a^2 - b^2)^(3/4)) - (20*ArcTan[Sqrt[Cos[e + f*x]]])/a - (16*b*AppellF1[5/4 
, 1/2, 1, 9/4, Cos[e + f*x]^2, (b^2*Cos[e + f*x]^2)/(-a^2 + b^2)]*Cos[e...
 

Rubi [A] (verified)

Time = 1.29 (sec) , antiderivative size = 448, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3042, 3377, 2009}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin (e+f x)^2 \sqrt {g \cos (e+f x)} (a+b \sin (e+f x))}dx\)

\(\Big \downarrow \) 3377

\(\displaystyle \int \left (\frac {b^2}{a^2 \sqrt {g \cos (e+f x)} (a+b \sin (e+f x))}-\frac {b \csc (e+f x)}{a^2 \sqrt {g \cos (e+f x)}}+\frac {\csc ^2(e+f x)}{a \sqrt {g \cos (e+f x)}}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {b^{5/2} \arctan \left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt [4]{b^2-a^2}}\right )}{a^2 f \sqrt {g} \left (b^2-a^2\right )^{3/4}}+\frac {b \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f \sqrt {g}}-\frac {b^{5/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt [4]{b^2-a^2}}\right )}{a^2 f \sqrt {g} \left (b^2-a^2\right )^{3/4}}+\frac {b \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f \sqrt {g}}+\frac {b^2 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {b^2-a^2}},\frac {1}{2} (e+f x),2\right )}{a f \left (b \sqrt {b^2-a^2}+a^2-b^2\right ) \sqrt {g \cos (e+f x)}}+\frac {b^2 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {b^2-a^2}},\frac {1}{2} (e+f x),2\right )}{a f \left (a^2-b \left (\sqrt {b^2-a^2}+b\right )\right ) \sqrt {g \cos (e+f x)}}-\frac {\csc (e+f x) \sqrt {g \cos (e+f x)}}{a f g}+\frac {\sqrt {\cos (e+f x)} \operatorname {EllipticF}\left (\frac {1}{2} (e+f x),2\right )}{a f \sqrt {g \cos (e+f x)}}\)

Input:

Int[Csc[e + f*x]^2/(Sqrt[g*Cos[e + f*x]]*(a + b*Sin[e + f*x])),x]
 

Output:

(b*ArcTan[Sqrt[g*Cos[e + f*x]]/Sqrt[g]])/(a^2*f*Sqrt[g]) - (b^(5/2)*ArcTan 
[(Sqrt[b]*Sqrt[g*Cos[e + f*x]])/((-a^2 + b^2)^(1/4)*Sqrt[g])])/(a^2*(-a^2 
+ b^2)^(3/4)*f*Sqrt[g]) + (b*ArcTanh[Sqrt[g*Cos[e + f*x]]/Sqrt[g]])/(a^2*f 
*Sqrt[g]) - (b^(5/2)*ArcTanh[(Sqrt[b]*Sqrt[g*Cos[e + f*x]])/((-a^2 + b^2)^ 
(1/4)*Sqrt[g])])/(a^2*(-a^2 + b^2)^(3/4)*f*Sqrt[g]) - (Sqrt[g*Cos[e + f*x] 
]*Csc[e + f*x])/(a*f*g) + (Sqrt[Cos[e + f*x]]*EllipticF[(e + f*x)/2, 2])/( 
a*f*Sqrt[g*Cos[e + f*x]]) + (b^2*Sqrt[Cos[e + f*x]]*EllipticPi[(2*b)/(b - 
Sqrt[-a^2 + b^2]), (e + f*x)/2, 2])/(a*(a^2 - b^2 + b*Sqrt[-a^2 + b^2])*f* 
Sqrt[g*Cos[e + f*x]]) + (b^2*Sqrt[Cos[e + f*x]]*EllipticPi[(2*b)/(b + Sqrt 
[-a^2 + b^2]), (e + f*x)/2, 2])/(a*(a^2 - b*(b + Sqrt[-a^2 + b^2]))*f*Sqrt 
[g*Cos[e + f*x]])
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 3377
Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*sin[(e_.) + (f_.)*(x_)]^(n_))/((a 
_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[ExpandTrig[(g*cos[e + 
 f*x])^p, sin[e + f*x]^n/(a + b*sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, 
 g, p}, x] && NeQ[a^2 - b^2, 0] && IntegerQ[n] && (LtQ[n, 0] || IGtQ[p + 1/ 
2, 0])
 
Maple [B] (warning: unable to verify)

Leaf count of result is larger than twice the leaf count of optimal. \(1243\) vs. \(2(391)=782\).

Time = 4.92 (sec) , antiderivative size = 1244, normalized size of antiderivative = 2.78

method result size
default \(\text {Expression too large to display}\) \(1244\)

Input:

int(csc(f*x+e)^2/(g*cos(f*x+e))^(1/2)/(a+b*sin(f*x+e)),x,method=_RETURNVER 
BOSE)
 

Output:

(4*b*(-1/4/a^2/(-g)^(1/2)*ln((-2*g+2*(-g)^(1/2)*(2*g*cos(1/2*f*x+1/2*e)^2- 
g)^(1/2))/cos(1/2*f*x+1/2*e))+1/8/a^2/g^(1/2)*ln((4*cos(1/2*f*x+1/2*e)*g+2 
*g^(1/2)*(-2*g*sin(1/2*f*x+1/2*e)^2+g)^(1/2)-2*g)/(cos(1/2*f*x+1/2*e)-1))+ 
1/8/a^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2)*(-1+2*sin(1/2*f*x+1/2*e)^2)^(1/2)*EllipticPi(cos(1/2*f*x+1 
/2*e),(-4*_alpha^2*b^2+4*b^2)/a^2,2^(1/2))*(g*(2*_alpha^2*b^2+a^2-2*b^2)/b 
^2)^(1/2)*_alpha^3*b^2-8*b^2*_alpha*(sin(1/2*f*x+1/2*e)^2)^(1/2)*(-1+2*...
 

Fricas [F(-1)]

Timed out. \[ \int \frac {\csc ^2(e+f x)}{\sqrt {g \cos (e+f x)} (a+b \sin (e+f x))} \, dx=\text {Timed out} \] Input:

integrate(csc(f*x+e)^2/(g*cos(f*x+e))^(1/2)/(a+b*sin(f*x+e)),x, algorithm= 
"fricas")
 

Output:

Timed out
 

Sympy [F]

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

integrate(csc(f*x+e)**2/(g*cos(f*x+e))**(1/2)/(a+b*sin(f*x+e)),x)
 

Output:

Integral(csc(e + f*x)**2/(sqrt(g*cos(e + f*x))*(a + b*sin(e + f*x))), x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\csc ^2(e+f x)}{\sqrt {g \cos (e+f x)} (a+b \sin (e+f x))} \, dx=\text {Exception raised: RuntimeError} \] Input:

integrate(csc(f*x+e)^2/(g*cos(f*x+e))^(1/2)/(a+b*sin(f*x+e)),x, algorithm= 
"maxima")
 

Output:

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is un 
defined.
 

Giac [F]

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

integrate(csc(f*x+e)^2/(g*cos(f*x+e))^(1/2)/(a+b*sin(f*x+e)),x, algorithm= 
"giac")
 

Output:

integrate(csc(f*x + e)^2/(sqrt(g*cos(f*x + e))*(b*sin(f*x + e) + a)), x)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(sqrt(g)*int((sqrt(cos(e + f*x))*csc(e + f*x)**2)/(cos(e + f*x)*sin(e + f* 
x)*b + cos(e + f*x)*a),x))/g