\(\int \frac {a+b \sin ^2(e+f x)}{(g \cos (e+f x))^{5/2} \sqrt {d \sin (e+f x)}} \, dx\) [522]

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

Optimal result

Integrand size = 37, antiderivative size = 107 \[ \int \frac {a+b \sin ^2(e+f x)}{(g \cos (e+f x))^{5/2} \sqrt {d \sin (e+f x)}} \, dx=\frac {2 (a+b) \sqrt {d \sin (e+f x)}}{3 d f g (g \cos (e+f x))^{3/2}}+\frac {(2 a-b) \operatorname {EllipticF}\left (e-\frac {\pi }{4}+f x,2\right ) \sqrt {\sin (2 e+2 f x)}}{3 f g^2 \sqrt {g \cos (e+f x)} \sqrt {d \sin (e+f x)}} \] Output:

2/3*(a+b)*(d*sin(f*x+e))^(1/2)/d/f/g/(g*cos(f*x+e))^(3/2)+1/3*(2*a-b)*Inve 
rseJacobiAM(e-1/4*Pi+f*x,2^(1/2))*sin(2*f*x+2*e)^(1/2)/f/g^2/(g*cos(f*x+e) 
)^(1/2)/(d*sin(f*x+e))^(1/2)
 

Mathematica [C] (verified)

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

Time = 0.23 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.95 \[ \int \frac {a+b \sin ^2(e+f x)}{(g \cos (e+f x))^{5/2} \sqrt {d \sin (e+f x)}} \, dx=\frac {2 \cos ^2(e+f x)^{3/4} \left (5 a \operatorname {Hypergeometric2F1}\left (\frac {1}{4},\frac {7}{4},\frac {5}{4},\sin ^2(e+f x)\right ) \sin (e+f x)+b \operatorname {Hypergeometric2F1}\left (\frac {5}{4},\frac {7}{4},\frac {9}{4},\sin ^2(e+f x)\right ) \sin ^3(e+f x)\right )}{5 f g (g \cos (e+f x))^{3/2} \sqrt {d \sin (e+f x)}} \] Input:

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

Output:

(2*(Cos[e + f*x]^2)^(3/4)*(5*a*Hypergeometric2F1[1/4, 7/4, 5/4, Sin[e + f* 
x]^2]*Sin[e + f*x] + b*Hypergeometric2F1[5/4, 7/4, 9/4, Sin[e + f*x]^2]*Si 
n[e + f*x]^3))/(5*f*g*(g*Cos[e + f*x])^(3/2)*Sqrt[d*Sin[e + f*x]])
 

Rubi [A] (warning: unable to verify)

Time = 0.42 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.38, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.216, Rules used = {3042, 3681, 362, 266, 768, 858, 807, 230}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3681

\(\displaystyle \frac {\cos ^2(e+f x)^{3/4} \int \frac {b \sin ^2(e+f x)+a}{\sqrt {d \sin (e+f x)} \left (1-\sin ^2(e+f x)\right )^{7/4}}d\sin (e+f x)}{f g (g \cos (e+f x))^{3/2}}\)

\(\Big \downarrow \) 362

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

\(\Big \downarrow \) 266

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

\(\Big \downarrow \) 768

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

\(\Big \downarrow \) 858

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

\(\Big \downarrow \) 807

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

\(\Big \downarrow \) 230

\(\displaystyle \frac {\cos ^2(e+f x)^{3/4} \left (\frac {2 (a+b) \sqrt {d \sin (e+f x)}}{3 d \left (1-\sin ^2(e+f x)\right )^{3/4}}-\frac {2 (2 a-b) (d \sin (e+f x))^{3/2} \left (1-d^2 \csc ^4(e+f x)\right )^{3/4} \operatorname {EllipticF}\left (\frac {1}{2} \arcsin \left (d^2 \sin (e+f x)\right ),2\right )}{3 d^2 \left (1-\sin ^2(e+f x)\right )^{3/4}}\right )}{f g (g \cos (e+f x))^{3/2}}\)

Input:

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

Output:

((Cos[e + f*x]^2)^(3/4)*((2*(a + b)*Sqrt[d*Sin[e + f*x]])/(3*d*(1 - Sin[e 
+ f*x]^2)^(3/4)) - (2*(2*a - b)*(1 - d^2*Csc[e + f*x]^4)^(3/4)*EllipticF[A 
rcSin[d^2*Sin[e + f*x]]/2, 2]*(d*Sin[e + f*x])^(3/2))/(3*d^2*(1 - Sin[e + 
f*x]^2)^(3/4))))/(f*g*(g*Cos[e + f*x])^(3/2))
 

Defintions of rubi rules used

rule 230
Int[((a_) + (b_.)*(x_)^2)^(-3/4), x_Symbol] :> Simp[(2/(a^(3/4)*Rt[-b/a, 2] 
))*EllipticF[(1/2)*ArcSin[Rt[-b/a, 2]*x], 2], x] /; FreeQ[{a, b}, x] && GtQ 
[a, 0] && NegQ[b/a]
 

rule 266
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{k = De 
nominator[m]}, Simp[k/c   Subst[Int[x^(k*(m + 1) - 1)*(a + b*(x^(2*k)/c^2)) 
^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && FractionQ[m] && I 
ntBinomialQ[a, b, c, 2, m, p, x]
 

rule 362
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2), x 
_Symbol] :> Simp[(-(b*c - a*d))*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(2*a*b*e 
*(p + 1))), x] - Simp[(a*d*(m + 1) - b*c*(m + 2*p + 3))/(2*a*b*(p + 1))   I 
nt[(e*x)^m*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && N 
eQ[b*c - a*d, 0] && LtQ[p, -1] && (( !IntegerQ[p + 1/2] && NeQ[p, -5/4]) || 
  !RationalQ[m] || (ILtQ[p + 1/2, 0] && LeQ[-1, m, -2*(p + 1)]))
 

rule 768
Int[((a_) + (b_.)*(x_)^4)^(-3/4), x_Symbol] :> Simp[x^3*((1 + a/(b*x^4))^(3 
/4)/(a + b*x^4)^(3/4))   Int[1/(x^3*(1 + a/(b*x^4))^(3/4)), x], x] /; FreeQ 
[{a, b}, x]
 

rule 807
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = GCD[m 
+ 1, n]}, Simp[1/k   Subst[Int[x^((m + 1)/k - 1)*(a + b*x^(n/k))^p, x], x, 
x^k], x] /; k != 1] /; FreeQ[{a, b, p}, x] && IGtQ[n, 0] && IntegerQ[m]
 

rule 858
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Subst[Int[(a + 
b/x^n)^p/x^(m + 2), x], x, 1/x] /; FreeQ[{a, b, p}, x] && ILtQ[n, 0] && Int 
egerQ[m]
 

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

rule 3681
Int[(cos[(e_.) + (f_.)*(x_)]*(c_.))^(m_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = 
 FreeFactors[Sin[e + f*x], x]}, Simp[ff*c^(2*IntPart[(m - 1)/2] + 1)*((c*Co 
s[e + f*x])^(2*FracPart[(m - 1)/2])/(f*(Cos[e + f*x]^2)^FracPart[(m - 1)/2] 
))   Subst[Int[(d*ff*x)^n*(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x] 
, x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !In 
tegerQ[m]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(229\) vs. \(2(93)=186\).

Time = 6.34 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.15

method result size
default \(\frac {\left (2 \cos \left (f x +e \right )+2\right ) \sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}\, \sqrt {-2 \csc \left (f x +e \right )+2 \cot \left (f x +e \right )+2}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )}\, a \operatorname {EllipticF}\left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}, \frac {\sqrt {2}}{2}\right )+\left (-\cos \left (f x +e \right )-1\right ) \sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}\, \sqrt {-2 \csc \left (f x +e \right )+2 \cot \left (f x +e \right )+2}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )}\, b \operatorname {EllipticF}\left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}, \frac {\sqrt {2}}{2}\right )+2 \tan \left (f x +e \right ) a +2 \tan \left (f x +e \right ) b}{3 f \sqrt {g \cos \left (f x +e \right )}\, \sqrt {d \sin \left (f x +e \right )}\, g^{2}}\) \(230\)
parts \(\frac {2 a \left (\left (\cos \left (f x +e \right )+1\right ) \sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}\, \sqrt {-2 \csc \left (f x +e \right )+2 \cot \left (f x +e \right )+2}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )}\, \operatorname {EllipticF}\left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}, \frac {\sqrt {2}}{2}\right )+\tan \left (f x +e \right )\right )}{3 f \sqrt {g \cos \left (f x +e \right )}\, \sqrt {d \sin \left (f x +e \right )}\, g^{2}}-\frac {b \left (\left (\cos \left (f x +e \right )+1\right ) \sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}\, \sqrt {-2 \csc \left (f x +e \right )+2 \cot \left (f x +e \right )+2}\, \sqrt {-\csc \left (f x +e \right )+\cot \left (f x +e \right )}\, \operatorname {EllipticF}\left (\sqrt {\csc \left (f x +e \right )-\cot \left (f x +e \right )+1}, \frac {\sqrt {2}}{2}\right )-2 \tan \left (f x +e \right )\right )}{3 f \sqrt {g \cos \left (f x +e \right )}\, \sqrt {d \sin \left (f x +e \right )}\, g^{2}}\) \(252\)

Input:

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

Output:

1/3/f/(g*cos(f*x+e))^(1/2)/(d*sin(f*x+e))^(1/2)/g^2*((2*cos(f*x+e)+2)*(csc 
(f*x+e)-cot(f*x+e)+1)^(1/2)*(-2*csc(f*x+e)+2*cot(f*x+e)+2)^(1/2)*(-csc(f*x 
+e)+cot(f*x+e))^(1/2)*a*EllipticF((csc(f*x+e)-cot(f*x+e)+1)^(1/2),1/2*2^(1 
/2))+(-cos(f*x+e)-1)*(csc(f*x+e)-cot(f*x+e)+1)^(1/2)*(-2*csc(f*x+e)+2*cot( 
f*x+e)+2)^(1/2)*(-csc(f*x+e)+cot(f*x+e))^(1/2)*b*EllipticF((csc(f*x+e)-cot 
(f*x+e)+1)^(1/2),1/2*2^(1/2))+2*tan(f*x+e)*a+2*tan(f*x+e)*b)
 

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.11 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.17 \[ \int \frac {a+b \sin ^2(e+f x)}{(g \cos (e+f x))^{5/2} \sqrt {d \sin (e+f x)}} \, dx=-\frac {\sqrt {i \, d g} {\left (2 \, a - b\right )} \cos \left (f x + e\right )^{2} F(\arcsin \left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )\,|\,-1) + \sqrt {-i \, d g} {\left (2 \, a - b\right )} \cos \left (f x + e\right )^{2} F(\arcsin \left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )\,|\,-1) - 2 \, \sqrt {g \cos \left (f x + e\right )} \sqrt {d \sin \left (f x + e\right )} {\left (a + b\right )}}{3 \, d f g^{3} \cos \left (f x + e\right )^{2}} \] Input:

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

Output:

-1/3*(sqrt(I*d*g)*(2*a - b)*cos(f*x + e)^2*elliptic_f(arcsin(cos(f*x + e) 
+ I*sin(f*x + e)), -1) + sqrt(-I*d*g)*(2*a - b)*cos(f*x + e)^2*elliptic_f( 
arcsin(cos(f*x + e) - I*sin(f*x + e)), -1) - 2*sqrt(g*cos(f*x + e))*sqrt(d 
*sin(f*x + e))*(a + b))/(d*f*g^3*cos(f*x + e)^2)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [F(-1)]

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

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

Output:

Timed out
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(sqrt(g)*sqrt(d)*( - cos(e + f*x)**2*int((sqrt(sin(e + f*x))*sqrt(cos(e + 
f*x)))/(cos(e + f*x)*sin(e + f*x)),x)*b*f + 3*cos(e + f*x)**2*int((sqrt(si 
n(e + f*x))*sqrt(cos(e + f*x)))/(cos(e + f*x)**3*sin(e + f*x)),x)*a*f + 2* 
sqrt(sin(e + f*x))*sqrt(cos(e + f*x))*b))/(3*cos(e + f*x)**2*d*f*g**3)