\(\int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx\) [39]

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

Optimal result

Integrand size = 21, antiderivative size = 87 \[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=-\frac {(b \cot (e+f x))^{1+n} \operatorname {Hypergeometric2F1}\left (\frac {1+n}{2},\frac {1}{2} (1-m+n),\frac {3+n}{2},\cos ^2(e+f x)\right ) (a \sin (e+f x))^m \sin ^2(e+f x)^{\frac {1}{2} (1-m+n)}}{b f (1+n)} \] Output:

-(b*cot(f*x+e))^(1+n)*hypergeom([1/2+1/2*n, 1/2-1/2*m+1/2*n],[3/2+1/2*n],c 
os(f*x+e)^2)*(a*sin(f*x+e))^m*(sin(f*x+e)^2)^(1/2-1/2*m+1/2*n)/b/f/(1+n)
 

Mathematica [C] (warning: unable to verify)

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

Time = 1.81 (sec) , antiderivative size = 289, normalized size of antiderivative = 3.32 \[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\frac {(3+m-n) \operatorname {AppellF1}\left (\frac {1}{2} (1+m-n),-n,1+m,\frac {1}{2} (3+m-n),\tan ^2\left (\frac {1}{2} (e+f x)\right ),-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right ) (b \cot (e+f x))^n \sin (e+f x) (a \sin (e+f x))^m}{f (1+m-n) \left ((3+m-n) \operatorname {AppellF1}\left (\frac {1}{2} (1+m-n),-n,1+m,\frac {1}{2} (3+m-n),\tan ^2\left (\frac {1}{2} (e+f x)\right ),-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )-2 \left (n \operatorname {AppellF1}\left (\frac {1}{2} (3+m-n),1-n,1+m,\frac {1}{2} (5+m-n),\tan ^2\left (\frac {1}{2} (e+f x)\right ),-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )+(1+m) \operatorname {AppellF1}\left (\frac {1}{2} (3+m-n),-n,2+m,\frac {1}{2} (5+m-n),\tan ^2\left (\frac {1}{2} (e+f x)\right ),-\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )\right ) \tan ^2\left (\frac {1}{2} (e+f x)\right )\right )} \] Input:

Integrate[(b*Cot[e + f*x])^n*(a*Sin[e + f*x])^m,x]
 

Output:

((3 + m - n)*AppellF1[(1 + m - n)/2, -n, 1 + m, (3 + m - n)/2, Tan[(e + f* 
x)/2]^2, -Tan[(e + f*x)/2]^2]*(b*Cot[e + f*x])^n*Sin[e + f*x]*(a*Sin[e + f 
*x])^m)/(f*(1 + m - n)*((3 + m - n)*AppellF1[(1 + m - n)/2, -n, 1 + m, (3 
+ m - n)/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] - 2*(n*AppellF1[(3 + 
m - n)/2, 1 - n, 1 + m, (5 + m - n)/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/ 
2]^2] + (1 + m)*AppellF1[(3 + m - n)/2, -n, 2 + m, (5 + m - n)/2, Tan[(e + 
 f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2))
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3083, 3042, 3097}

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 (a \sin (e+f x))^m (b \cot (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a \cos \left (e+f x-\frac {\pi }{2}\right )\right )^m \left (-b \tan \left (e+f x-\frac {\pi }{2}\right )\right )^ndx\)

\(\Big \downarrow \) 3083

\(\displaystyle (a \sin (e+f x))^m \left (\frac {\csc (e+f x)}{a}\right )^m \int (b \cot (e+f x))^n \left (\frac {\csc (e+f x)}{a}\right )^{-m}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (a \sin (e+f x))^m \left (\frac {\csc (e+f x)}{a}\right )^m \int \left (\frac {\sec \left (e+f x-\frac {\pi }{2}\right )}{a}\right )^{-m} \left (-b \tan \left (e+f x-\frac {\pi }{2}\right )\right )^ndx\)

\(\Big \downarrow \) 3097

\(\displaystyle -\frac {(a \sin (e+f x))^m (b \cot (e+f x))^{n+1} \sin ^2(e+f x)^{\frac {1}{2} (-m+n+1)} \operatorname {Hypergeometric2F1}\left (\frac {n+1}{2},\frac {1}{2} (-m+n+1),\frac {n+3}{2},\cos ^2(e+f x)\right )}{b f (n+1)}\)

Input:

Int[(b*Cot[e + f*x])^n*(a*Sin[e + f*x])^m,x]
 

Output:

-(((b*Cot[e + f*x])^(1 + n)*Hypergeometric2F1[(1 + n)/2, (1 - m + n)/2, (3 
 + n)/2, Cos[e + f*x]^2]*(a*Sin[e + f*x])^m*(Sin[e + f*x]^2)^((1 - m + n)/ 
2))/(b*f*(1 + n)))
 

Defintions of rubi rules used

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

rule 3083
Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n 
_), x_Symbol] :> Simp[(a*Cos[e + f*x])^FracPart[m]*(Sec[e + f*x]/a)^FracPar 
t[m]   Int[(b*Tan[e + f*x])^n/(Sec[e + f*x]/a)^m, x], x] /; FreeQ[{a, b, e, 
 f, m, n}, x] &&  !IntegerQ[m] &&  !IntegerQ[n]
 

rule 3097
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[(a*Sec[e + f*x])^m*(b*Tan[e + f*x])^(n + 1)*((Cos[e 
+ f*x]^2)^((m + n + 1)/2)/(b*f*(n + 1)))*Hypergeometric2F1[(n + 1)/2, (m + 
n + 1)/2, (n + 3)/2, Sin[e + f*x]^2], x] /; FreeQ[{a, b, e, f, m, n}, x] && 
  !IntegerQ[(n - 1)/2] &&  !IntegerQ[m/2]
 
Maple [F]

\[\int \left (b \cot \left (f x +e \right )\right )^{n} \left (a \sin \left (f x +e \right )\right )^{m}d x\]

Input:

int((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x)
 

Output:

int((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x)
 

Fricas [F]

\[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\int { \left (b \cot \left (f x + e\right )\right )^{n} \left (a \sin \left (f x + e\right )\right )^{m} \,d x } \] Input:

integrate((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x, algorithm="fricas")
 

Output:

integral((b*cot(f*x + e))^n*(a*sin(f*x + e))^m, x)
 

Sympy [F]

\[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\int \left (a \sin {\left (e + f x \right )}\right )^{m} \left (b \cot {\left (e + f x \right )}\right )^{n}\, dx \] Input:

integrate((b*cot(f*x+e))**n*(a*sin(f*x+e))**m,x)
 

Output:

Integral((a*sin(e + f*x))**m*(b*cot(e + f*x))**n, x)
 

Maxima [F]

\[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\int { \left (b \cot \left (f x + e\right )\right )^{n} \left (a \sin \left (f x + e\right )\right )^{m} \,d x } \] Input:

integrate((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x, algorithm="maxima")
 

Output:

integrate((b*cot(f*x + e))^n*(a*sin(f*x + e))^m, x)
 

Giac [F]

\[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\int { \left (b \cot \left (f x + e\right )\right )^{n} \left (a \sin \left (f x + e\right )\right )^{m} \,d x } \] Input:

integrate((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x, algorithm="giac")
 

Output:

integrate((b*cot(f*x + e))^n*(a*sin(f*x + e))^m, x)
 

Mupad [F(-1)]

Timed out. \[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=\int {\left (b\,\mathrm {cot}\left (e+f\,x\right )\right )}^n\,{\left (a\,\sin \left (e+f\,x\right )\right )}^m \,d x \] Input:

int((b*cot(e + f*x))^n*(a*sin(e + f*x))^m,x)
 

Output:

int((b*cot(e + f*x))^n*(a*sin(e + f*x))^m, x)
 

Reduce [F]

\[ \int (b \cot (e+f x))^n (a \sin (e+f x))^m \, dx=b^{n} a^{m} \left (\int \sin \left (f x +e \right )^{m} \cot \left (f x +e \right )^{n}d x \right ) \] Input:

int((b*cot(f*x+e))^n*(a*sin(f*x+e))^m,x)
 

Output:

b**n*a**m*int(sin(e + f*x)**m*cot(e + f*x)**n,x)