\(\int \frac {(c (d \sin (e+f x))^p)^n}{(a+b \sin (e+f x))^2} \, dx\) [837]

Optimal result
Mathematica [B] (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 = 27, antiderivative size = 322 \[ \int \frac {\left (c (d \sin (e+f x))^p\right )^n}{(a+b \sin (e+f x))^2} \, dx=\frac {2 a b \operatorname {AppellF1}\left (\frac {1}{2},-\frac {n p}{2},2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \sin ^2(e+f x)^{-\frac {n p}{2}} \left (c (d \sin (e+f x))^p\right )^n}{\left (a^2-b^2\right )^2 f}-\frac {b^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-1-n p),2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \sin (e+f x) \sin ^2(e+f x)^{\frac {1}{2} (-1-n p)} \left (c (d \sin (e+f x))^p\right )^n}{\left (a^2-b^2\right )^2 f}-\frac {a^2 \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (1-n p),2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right ) \cot (e+f x) \sin ^2(e+f x)^{\frac {1}{2} (1-n p)} \left (c (d \sin (e+f x))^p\right )^n}{\left (a^2-b^2\right )^2 f} \] Output:

2*a*b*AppellF1(1/2,-1/2*n*p,2,3/2,cos(f*x+e)^2,-b^2*cos(f*x+e)^2/(a^2-b^2) 
)*cos(f*x+e)*(c*(d*sin(f*x+e))^p)^n/(a^2-b^2)^2/f/((sin(f*x+e)^2)^(1/2*n*p 
))-b^2*AppellF1(1/2,-1/2*n*p-1/2,2,3/2,cos(f*x+e)^2,-b^2*cos(f*x+e)^2/(a^2 
-b^2))*cos(f*x+e)*sin(f*x+e)*(sin(f*x+e)^2)^(-1/2*n*p-1/2)*(c*(d*sin(f*x+e 
))^p)^n/(a^2-b^2)^2/f-a^2*AppellF1(1/2,-1/2*n*p+1/2,2,3/2,cos(f*x+e)^2,-b^ 
2*cos(f*x+e)^2/(a^2-b^2))*cot(f*x+e)*(sin(f*x+e)^2)^(-1/2*n*p+1/2)*(c*(d*s 
in(f*x+e))^p)^n/(a^2-b^2)^2/f
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(1970\) vs. \(2(322)=644\).

Time = 19.98 (sec) , antiderivative size = 1970, normalized size of antiderivative = 6.12 \[ \int \frac {\left (c (d \sin (e+f x))^p\right )^n}{(a+b \sin (e+f x))^2} \, dx =\text {Too large to display} \] Input:

Integrate[(c*(d*Sin[e + f*x])^p)^n/(a + b*Sin[e + f*x])^2,x]
 

Output:

-(((Sec[e + f*x]^2)^((n*p)/2)*(c*(d*Sin[e + f*x])^p)^n*Tan[e + f*x]*(Tan[e 
 + f*x]/Sqrt[Sec[e + f*x]^2])^(n*p)*(-(a*(2 + n*p)*((a^2 + b^2)*AppellF1[( 
1 + n*p)/2, (n*p)/2, 1, (3 + n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e 
 + f*x]^2] - 2*b^2*AppellF1[(1 + n*p)/2, (n*p)/2, 2, (3 + n*p)/2, -Tan[e + 
 f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2])) + 2*b*(a^2 - b^2)*(1 + n*p)*Appe 
llF1[1 + (n*p)/2, (-1 + n*p)/2, 2, 2 + (n*p)/2, -Tan[e + f*x]^2, (-1 + b^2 
/a^2)*Tan[e + f*x]^2]*Tan[e + f*x]))/(a^3*(a^2 - b^2)*f*(1 + n*p)*(2 + n*p 
)*(a + b*Sin[e + f*x])^2*(-(((Sec[e + f*x]^2)^(1 + (n*p)/2)*(Tan[e + f*x]/ 
Sqrt[Sec[e + f*x]^2])^(n*p)*(-(a*(2 + n*p)*((a^2 + b^2)*AppellF1[(1 + n*p) 
/2, (n*p)/2, 1, (3 + n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^ 
2] - 2*b^2*AppellF1[(1 + n*p)/2, (n*p)/2, 2, (3 + n*p)/2, -Tan[e + f*x]^2, 
 (-1 + b^2/a^2)*Tan[e + f*x]^2])) + 2*b*(a^2 - b^2)*(1 + n*p)*AppellF1[1 + 
 (n*p)/2, (-1 + n*p)/2, 2, 2 + (n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Ta 
n[e + f*x]^2]*Tan[e + f*x]))/(a^3*(a^2 - b^2)*(1 + n*p)*(2 + n*p))) - (n*p 
*(Sec[e + f*x]^2)^((n*p)/2)*Tan[e + f*x]^2*(Tan[e + f*x]/Sqrt[Sec[e + f*x] 
^2])^(n*p)*(-(a*(2 + n*p)*((a^2 + b^2)*AppellF1[(1 + n*p)/2, (n*p)/2, 1, ( 
3 + n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2] - 2*b^2*Appell 
F1[(1 + n*p)/2, (n*p)/2, 2, (3 + n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*T 
an[e + f*x]^2])) + 2*b*(a^2 - b^2)*(1 + n*p)*AppellF1[1 + (n*p)/2, (-1 + n 
*p)/2, 2, 2 + (n*p)/2, -Tan[e + f*x]^2, (-1 + b^2/a^2)*Tan[e + f*x]^2]*...
 

Rubi [A] (verified)

Time = 0.93 (sec) , antiderivative size = 346, normalized size of antiderivative = 1.07, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3042, 3305, 3042, 3303, 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 {\left (c (d \sin (e+f x))^p\right )^n}{(a+b \sin (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (c (d \sin (e+f x))^p\right )^n}{(a+b \sin (e+f x))^2}dx\)

\(\Big \downarrow \) 3305

\(\displaystyle (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n \int \frac {(d \sin (e+f x))^{n p}}{(a+b \sin (e+f x))^2}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n \int \frac {(d \sin (e+f x))^{n p}}{(a+b \sin (e+f x))^2}dx\)

\(\Big \downarrow \) 3303

\(\displaystyle (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n \int \left (\frac {a^2 (d \sin (e+f x))^{n p}}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2}-\frac {2 a b \sin (e+f x) (d \sin (e+f x))^{n p}}{\left (a^2-b^2 \sin ^2(e+f x)\right )^2}+\frac {b^2 \sin ^2(e+f x) (d \sin (e+f x))^{n p}}{\left (b^2 \sin ^2(e+f x)-a^2\right )^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n \left (\frac {2 a b \cos (e+f x) \sin ^2(e+f x)^{-\frac {n p}{2}} (d \sin (e+f x))^{n p} \operatorname {AppellF1}\left (\frac {1}{2},-\frac {n p}{2},2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}-\frac {b^2 \cos (e+f x) \sin ^2(e+f x)^{\frac {1}{2} (-n p-1)} (d \sin (e+f x))^{n p+1} \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (-n p-1),2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{d f \left (a^2-b^2\right )^2}-\frac {a^2 d \cos (e+f x) \sin ^2(e+f x)^{\frac {1}{2} (1-n p)} (d \sin (e+f x))^{n p-1} \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2} (1-n p),2,\frac {3}{2},\cos ^2(e+f x),-\frac {b^2 \cos ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}\right )\)

Input:

Int[(c*(d*Sin[e + f*x])^p)^n/(a + b*Sin[e + f*x])^2,x]
 

Output:

((c*(d*Sin[e + f*x])^p)^n*((2*a*b*AppellF1[1/2, -1/2*(n*p), 2, 3/2, Cos[e 
+ f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Sin[e + f*x 
])^(n*p))/((a^2 - b^2)^2*f*(Sin[e + f*x]^2)^((n*p)/2)) - (b^2*AppellF1[1/2 
, (-1 - n*p)/2, 2, 3/2, Cos[e + f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2) 
)]*Cos[e + f*x]*(d*Sin[e + f*x])^(1 + n*p)*(Sin[e + f*x]^2)^((-1 - n*p)/2) 
)/((a^2 - b^2)^2*d*f) - (a^2*d*AppellF1[1/2, (1 - n*p)/2, 2, 3/2, Cos[e + 
f*x]^2, -((b^2*Cos[e + f*x]^2)/(a^2 - b^2))]*Cos[e + f*x]*(d*Sin[e + f*x]) 
^(-1 + n*p)*(Sin[e + f*x]^2)^((1 - n*p)/2))/((a^2 - b^2)^2*f)))/(d*Sin[e + 
 f*x])^(n*p)
 

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 3303
Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*( 
x_)])^(m_.), x_Symbol] :> Int[ExpandTrig[(d*sin[e + f*x])^n*(1/((a - b*sin[ 
e + f*x])^m/(a^2 - b^2*sin[e + f*x]^2)^m)), x], x] /; FreeQ[{a, b, d, e, f, 
 n}, x] && NeQ[a^2 - b^2, 0] && ILtQ[m, -1]
 

rule 3305
Int[((c_.)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(p_))^(n_)*((a_.) + (b_.)*sin[(e 
_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Simp[c^IntPart[n]*((c*(d*Sin[e + f*x 
])^p)^FracPart[n]/(d*Sin[e + f*x])^(p*FracPart[n]))   Int[(a + b*Sin[e + f* 
x])^m*(d*Sin[e + f*x])^(n*p), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, 
x] &&  !IntegerQ[n]
 
Maple [F]

\[\int \frac {\left (c \left (d \sin \left (f x +e \right )\right )^{p}\right )^{n}}{\left (a +b \sin \left (f x +e \right )\right )^{2}}d x\]

Input:

int((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x)
 

Output:

int((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x)
 

Fricas [F]

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

integrate((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x, algorithm="fricas")
 

Output:

integral(-((d*sin(f*x + e))^p*c)^n/(b^2*cos(f*x + e)^2 - 2*a*b*sin(f*x + e 
) - a^2 - b^2), x)
 

Sympy [F]

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

integrate((c*(d*sin(f*x+e))**p)**n/(a+b*sin(f*x+e))**2,x)
 

Output:

Integral((c*(d*sin(e + f*x))**p)**n/(a + b*sin(e + f*x))**2, x)
 

Maxima [F]

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

integrate((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x, algorithm="maxima")
 

Output:

integrate(((d*sin(f*x + e))^p*c)^n/(b*sin(f*x + e) + a)^2, x)
 

Giac [F]

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

integrate((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x, algorithm="giac")
 

Output:

integrate(((d*sin(f*x + e))^p*c)^n/(b*sin(f*x + e) + a)^2, x)
 

Mupad [F(-1)]

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

int((c*(d*sin(e + f*x))^p)^n/(a + b*sin(e + f*x))^2,x)
 

Output:

int((c*(d*sin(e + f*x))^p)^n/(a + b*sin(e + f*x))^2, x)
 

Reduce [F]

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

int((c*(d*sin(f*x+e))^p)^n/(a+b*sin(f*x+e))^2,x)
 

Output:

d**(n*p)*c**n*int(sin(e + f*x)**(n*p)/(sin(e + f*x)**2*b**2 + 2*sin(e + f* 
x)*a*b + a**2),x)