Integrand size = 21, antiderivative size = 149 \[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\frac {a d \cos (e+f x) (d \csc (e+f x))^{-1+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\sin ^2(e+f x)\right )}{f (1-n) \sqrt {\cos ^2(e+f x)}}+\frac {a d^2 \cos (e+f x) (d \csc (e+f x))^{-2+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}} \] Output:
a*d*cos(f*x+e)*(d*csc(f*x+e))^(-1+n)*hypergeom([1/2, 1/2-1/2*n],[3/2-1/2*n ],sin(f*x+e)^2)/f/(1-n)/(cos(f*x+e)^2)^(1/2)+a*d^2*cos(f*x+e)*(d*csc(f*x+e ))^(-2+n)*hypergeom([1/2, 1-1/2*n],[2-1/2*n],sin(f*x+e)^2)/f/(2-n)/(cos(f* x+e)^2)^(1/2)
Result contains complex when optimal does not.
Time = 2.24 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.88 \[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\frac {2^{-1+n} a e^{-i (e+f n x)} \left (\frac {i e^{i (e+f x)}}{-1+e^{2 i (e+f x)}}\right )^n \left (-1+e^{2 i (e+f x)}\right ) \csc ^{-1-n}(e+f x) (d \csc (e+f x))^n (1+\csc (e+f x)) \left (-e^{i f (-1+n) x} n (1+n) \operatorname {Hypergeometric2F1}\left (1,\frac {1-n}{2},\frac {1+n}{2},e^{2 i (e+f x)}\right )+e^{i e} (-1+n) \left (e^{i (e+f (1+n) x)} n \operatorname {Hypergeometric2F1}\left (1,\frac {3-n}{2},\frac {3+n}{2},e^{2 i (e+f x)}\right )+2 i e^{i f n x} (1+n) \operatorname {Hypergeometric2F1}\left (1,1-\frac {n}{2},\frac {2+n}{2},e^{2 i (e+f x)}\right )\right )\right )}{f (-1+n) n (1+n) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \] Input:
Integrate[(d*Csc[e + f*x])^n*(a + a*Sin[e + f*x]),x]
Output:
(2^(-1 + n)*a*((I*E^(I*(e + f*x)))/(-1 + E^((2*I)*(e + f*x))))^n*(-1 + E^( (2*I)*(e + f*x)))*Csc[e + f*x]^(-1 - n)*(d*Csc[e + f*x])^n*(1 + Csc[e + f* x])*(-(E^(I*f*(-1 + n)*x)*n*(1 + n)*Hypergeometric2F1[1, (1 - n)/2, (1 + n )/2, E^((2*I)*(e + f*x))]) + E^(I*e)*(-1 + n)*(E^(I*(e + f*(1 + n)*x))*n*H ypergeometric2F1[1, (3 - n)/2, (3 + n)/2, E^((2*I)*(e + f*x))] + (2*I)*E^( I*f*n*x)*(1 + n)*Hypergeometric2F1[1, 1 - n/2, (2 + n)/2, E^((2*I)*(e + f* x))])))/(E^(I*(e + f*n*x))*f*(-1 + n)*n*(1 + n)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2)
Time = 0.54 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.99, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 3717, 3042, 4274, 3042, 4259, 3042, 3122}
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)+a) (d \csc (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \sin (e+f x)+a) (d \csc (e+f x))^ndx\) |
\(\Big \downarrow \) 3717 |
\(\displaystyle d \int (d \csc (e+f x))^{n-1} (\csc (e+f x) a+a)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle d \int (d \csc (e+f x))^{n-1} (\csc (e+f x) a+a)dx\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle d \left (a \int (d \csc (e+f x))^{n-1}dx+\frac {a \int (d \csc (e+f x))^ndx}{d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle d \left (a \int (d \csc (e+f x))^{n-1}dx+\frac {a \int (d \csc (e+f x))^ndx}{d}\right )\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle d \left (a \left (\frac {\sin (e+f x)}{d}\right )^n (d \csc (e+f x))^n \int \left (\frac {\sin (e+f x)}{d}\right )^{1-n}dx+\frac {a \left (\frac {\sin (e+f x)}{d}\right )^n (d \csc (e+f x))^n \int \left (\frac {\sin (e+f x)}{d}\right )^{-n}dx}{d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle d \left (a \left (\frac {\sin (e+f x)}{d}\right )^n (d \csc (e+f x))^n \int \left (\frac {\sin (e+f x)}{d}\right )^{1-n}dx+\frac {a \left (\frac {\sin (e+f x)}{d}\right )^n (d \csc (e+f x))^n \int \left (\frac {\sin (e+f x)}{d}\right )^{-n}dx}{d}\right )\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle d \left (\frac {a d \cos (e+f x) (d \csc (e+f x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\sin ^2(e+f x)\right )}{f (2-n) \sqrt {\cos ^2(e+f x)}}+\frac {a \cos (e+f x) (d \csc (e+f x))^{n-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\sin ^2(e+f x)\right )}{f (1-n) \sqrt {\cos ^2(e+f x)}}\right )\) |
Input:
Int[(d*Csc[e + f*x])^n*(a + a*Sin[e + f*x]),x]
Output:
d*((a*Cos[e + f*x]*(d*Csc[e + f*x])^(-1 + n)*Hypergeometric2F1[1/2, (1 - n )/2, (3 - n)/2, Sin[e + f*x]^2])/(f*(1 - n)*Sqrt[Cos[e + f*x]^2]) + (a*d*C os[e + f*x]*(d*Csc[e + f*x])^(-2 + n)*Hypergeometric2F1[1/2, (2 - n)/2, (4 - n)/2, Sin[e + f*x]^2])/(f*(2 - n)*Sqrt[Cos[e + f*x]^2]))
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[2*n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)]^(n_.))^(p_.), x_Symbol] :> Simp[d^(n*p) Int[(d*Csc[e + f*x])^(m - n*p )*(b + a*Csc[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x] && !IntegerQ[m] && IntegersQ[n, p]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x] )^(n - 1)*((Sin[c + d*x]/b)^(n - 1) Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
\[\int \left (d \csc \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right )d x\]
Input:
int((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x)
Output:
int((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x)
\[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="fricas")
Output:
integral((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)
\[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=a \left (\int \left (d \csc {\left (e + f x \right )}\right )^{n}\, dx + \int \left (d \csc {\left (e + f x \right )}\right )^{n} \sin {\left (e + f x \right )}\, dx\right ) \] Input:
integrate((d*csc(f*x+e))**n*(a+a*sin(f*x+e)),x)
Output:
a*(Integral((d*csc(e + f*x))**n, x) + Integral((d*csc(e + f*x))**n*sin(e + f*x), x))
\[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="maxima")
Output:
integrate((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)
\[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\int { {\left (a \sin \left (f x + e\right ) + a\right )} \left (d \csc \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x, algorithm="giac")
Output:
integrate((a*sin(f*x + e) + a)*(d*csc(f*x + e))^n, x)
Timed out. \[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=\int {\left (\frac {d}{\sin \left (e+f\,x\right )}\right )}^n\,\left (a+a\,\sin \left (e+f\,x\right )\right ) \,d x \] Input:
int((d/sin(e + f*x))^n*(a + a*sin(e + f*x)),x)
Output:
int((d/sin(e + f*x))^n*(a + a*sin(e + f*x)), x)
\[ \int (d \csc (e+f x))^n (a+a \sin (e+f x)) \, dx=d^{n} a \left (\int \csc \left (f x +e \right )^{n}d x +\int \csc \left (f x +e \right )^{n} \sin \left (f x +e \right )d x \right ) \] Input:
int((d*csc(f*x+e))^n*(a+a*sin(f*x+e)),x)
Output:
d**n*a*(int(csc(e + f*x)**n,x) + int(csc(e + f*x)**n*sin(e + f*x),x))