Integrand size = 29, antiderivative size = 96 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-b^2 x+\frac {a b \text {arctanh}(\cos (c+d x))}{d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{3 d}-\frac {a b \cot (c+d x) \csc (c+d x)}{3 d}-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d} \] Output:
-b^2*x+a*b*arctanh(cos(d*x+c))/d+1/3*(a^2-2*b^2)*cot(d*x+c)/d-1/3*a*b*cot( d*x+c)*csc(d*x+c)/d-1/3*cot(d*x+c)*csc(d*x+c)^2*(a+b*sin(d*x+c))^2/d
Leaf count is larger than twice the leaf count of optimal. \(538\) vs. \(2(96)=192\).
Time = 7.23 (sec) , antiderivative size = 538, normalized size of antiderivative = 5.60 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {b^2 (c+d x) (b+a \csc (c+d x))^2 \sin ^2(c+d x)}{d (a+b \sin (c+d x))^2}+\frac {\left (a^2 \cos \left (\frac {1}{2} (c+d x)\right )-3 b^2 \cos \left (\frac {1}{2} (c+d x)\right )\right ) \csc \left (\frac {1}{2} (c+d x)\right ) (b+a \csc (c+d x))^2 \sin ^2(c+d x)}{6 d (a+b \sin (c+d x))^2}-\frac {a b \csc ^2\left (\frac {1}{2} (c+d x)\right ) (b+a \csc (c+d x))^2 \sin ^2(c+d x)}{4 d (a+b \sin (c+d x))^2}-\frac {a^2 \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right ) (b+a \csc (c+d x))^2 \sin ^2(c+d x)}{24 d (a+b \sin (c+d x))^2}+\frac {a b (b+a \csc (c+d x))^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin ^2(c+d x)}{d (a+b \sin (c+d x))^2}-\frac {a b (b+a \csc (c+d x))^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin ^2(c+d x)}{d (a+b \sin (c+d x))^2}+\frac {a b (b+a \csc (c+d x))^2 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \sin ^2(c+d x)}{4 d (a+b \sin (c+d x))^2}+\frac {(b+a \csc (c+d x))^2 \sec \left (\frac {1}{2} (c+d x)\right ) \left (-a^2 \sin \left (\frac {1}{2} (c+d x)\right )+3 b^2 \sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin ^2(c+d x)}{6 d (a+b \sin (c+d x))^2}+\frac {a^2 (b+a \csc (c+d x))^2 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \sin ^2(c+d x) \tan \left (\frac {1}{2} (c+d x)\right )}{24 d (a+b \sin (c+d x))^2} \] Input:
Integrate[Cot[c + d*x]^2*Csc[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]
Output:
-((b^2*(c + d*x)*(b + a*Csc[c + d*x])^2*Sin[c + d*x]^2)/(d*(a + b*Sin[c + d*x])^2)) + ((a^2*Cos[(c + d*x)/2] - 3*b^2*Cos[(c + d*x)/2])*Csc[(c + d*x) /2]*(b + a*Csc[c + d*x])^2*Sin[c + d*x]^2)/(6*d*(a + b*Sin[c + d*x])^2) - (a*b*Csc[(c + d*x)/2]^2*(b + a*Csc[c + d*x])^2*Sin[c + d*x]^2)/(4*d*(a + b *Sin[c + d*x])^2) - (a^2*Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^2*(b + a*Csc[c + d*x])^2*Sin[c + d*x]^2)/(24*d*(a + b*Sin[c + d*x])^2) + (a*b*(b + a*Csc[ c + d*x])^2*Log[Cos[(c + d*x)/2]]*Sin[c + d*x]^2)/(d*(a + b*Sin[c + d*x])^ 2) - (a*b*(b + a*Csc[c + d*x])^2*Log[Sin[(c + d*x)/2]]*Sin[c + d*x]^2)/(d* (a + b*Sin[c + d*x])^2) + (a*b*(b + a*Csc[c + d*x])^2*Sec[(c + d*x)/2]^2*S in[c + d*x]^2)/(4*d*(a + b*Sin[c + d*x])^2) + ((b + a*Csc[c + d*x])^2*Sec[ (c + d*x)/2]*(-(a^2*Sin[(c + d*x)/2]) + 3*b^2*Sin[(c + d*x)/2])*Sin[c + d* x]^2)/(6*d*(a + b*Sin[c + d*x])^2) + (a^2*(b + a*Csc[c + d*x])^2*Sec[(c + d*x)/2]^2*Sin[c + d*x]^2*Tan[(c + d*x)/2])/(24*d*(a + b*Sin[c + d*x])^2)
Time = 0.93 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.03, number of steps used = 14, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.483, Rules used = {3042, 3368, 3042, 3527, 3042, 3510, 27, 3042, 3500, 27, 3042, 3214, 3042, 4257}
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 \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)^2 (a+b \sin (c+d x))^2}{\sin (c+d x)^4}dx\) |
\(\Big \downarrow \) 3368 |
\(\displaystyle \int \left (1-\sin ^2(c+d x)\right ) \csc ^4(c+d x) (a+b \sin (c+d x))^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (1-\sin (c+d x)^2\right ) (a+b \sin (c+d x))^2}{\sin (c+d x)^4}dx\) |
\(\Big \downarrow \) 3527 |
\(\displaystyle \frac {1}{3} \int \csc ^3(c+d x) (a+b \sin (c+d x)) \left (-3 b \sin ^2(c+d x)-a \sin (c+d x)+2 b\right )dx-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \int \frac {(a+b \sin (c+d x)) \left (-3 b \sin (c+d x)^2-a \sin (c+d x)+2 b\right )}{\sin (c+d x)^3}dx-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3510 |
\(\displaystyle \frac {1}{3} \left (-\frac {1}{2} \int 2 \csc ^2(c+d x) \left (a^2+3 b \sin (c+d x) a-2 b^2+3 b^2 \sin ^2(c+d x)\right )dx-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{3} \left (-\int \csc ^2(c+d x) \left (a^2+3 b \sin (c+d x) a-2 b^2+3 b^2 \sin ^2(c+d x)\right )dx-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (-\int \frac {a^2+3 b \sin (c+d x) a-2 b^2+3 b^2 \sin (c+d x)^2}{\sin (c+d x)^2}dx-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3500 |
\(\displaystyle \frac {1}{3} \left (-\int 3 \csc (c+d x) \left (\sin (c+d x) b^2+a b\right )dx+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{3} \left (-3 \int \csc (c+d x) \left (\sin (c+d x) b^2+a b\right )dx+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (-3 \int \frac {\sin (c+d x) b^2+a b}{\sin (c+d x)}dx+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {1}{3} \left (-3 \left (a b \int \csc (c+d x)dx+b^2 x\right )+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (-3 \left (a b \int \csc (c+d x)dx+b^2 x\right )+\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{3} \left (\frac {\left (a^2-2 b^2\right ) \cot (c+d x)}{d}-3 \left (b^2 x-\frac {a b \text {arctanh}(\cos (c+d x))}{d}\right )-\frac {a b \cot (c+d x) \csc (c+d x)}{d}\right )-\frac {\cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{3 d}\) |
Input:
Int[Cot[c + d*x]^2*Csc[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]
Output:
(-3*(b^2*x - (a*b*ArcTanh[Cos[c + d*x]])/d) + ((a^2 - 2*b^2)*Cot[c + d*x]) /d - (a*b*Cot[c + d*x]*Csc[c + d*x])/d)/3 - (Cot[c + d*x]*Csc[c + d*x]^2*( a + b*Sin[c + d*x])^2)/(3*d)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^m*(1 - Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, m, n }, x] && NeQ[a^2 - b^2, 0] && (IGtQ[m, 0] || IntegersQ[2*m, 2*n])
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* (a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x ])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A *b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)*Cos[ e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - S imp[1/(b^2*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*( m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d + b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1)) ))*Sin[e + f*x] - b*C*d*(m + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; F reeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(c^2*C + A*d^2))*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Simp[1/(d*(n + 1)*(c^2 - d^ 2)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A* d*(b*d*m + a*c*(n + 1)) + c*C*(b*c*m + a*d*(n + 1)) - (A*d*(a*d*(n + 2) - b *c*(n + 1)) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x] - b*( A*d^2*(m + n + 2) + C*(c^2*(m + 1) + d^2*(n + 1)))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.27 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {-\frac {a^{2} \cos \left (d x +c \right )^{3}}{3 \sin \left (d x +c \right )^{3}}+2 a b \left (-\frac {\cos \left (d x +c \right )^{3}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(96\) |
default | \(\frac {-\frac {a^{2} \cos \left (d x +c \right )^{3}}{3 \sin \left (d x +c \right )^{3}}+2 a b \left (-\frac {\cos \left (d x +c \right )^{3}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(96\) |
risch | \(-b^{2} x +\frac {2 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-2 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+2 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+4 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a^{2}}{3}-2 i b^{2}-2 a b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(147\) |
Input:
int(cot(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(-1/3*a^2/sin(d*x+c)^3*cos(d*x+c)^3+2*a*b*(-1/2/sin(d*x+c)^2*cos(d*x+c )^3-1/2*cos(d*x+c)-1/2*ln(csc(d*x+c)-cot(d*x+c)))+b^2*(-cot(d*x+c)-d*x-c))
Time = 0.09 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.74 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {2 \, {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{3} + 6 \, b^{2} \cos \left (d x + c\right ) + 3 \, {\left (a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 6 \, {\left (b^{2} d x \cos \left (d x + c\right )^{2} - b^{2} d x - a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="frica s")
Output:
1/6*(2*(a^2 - 3*b^2)*cos(d*x + c)^3 + 6*b^2*cos(d*x + c) + 3*(a*b*cos(d*x + c)^2 - a*b)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 3*(a*b*cos(d*x + c)^2 - a*b)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 6*(b^2*d*x*cos(d*x + c)^2 - b^2*d*x - a*b*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x + c)^2 - d )*sin(d*x + c))
\[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cot ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate(cot(d*x+c)**2*csc(d*x+c)**2*(a+b*sin(d*x+c))**2,x)
Output:
Integral((a + b*sin(c + d*x))**2*cot(c + d*x)**2*csc(c + d*x)**2, x)
Time = 0.12 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.85 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {2 \, a^{2} \cot \left (d x + c\right )^{3} + 6 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} b^{2} - 3 \, a b {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="maxim a")
Output:
-1/6*(2*a^2*cot(d*x + c)^3 + 6*(d*x + c + 1/tan(d*x + c))*b^2 - 3*a*b*(2*c os(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - log(cos(d*x + c ) - 1)))/d
Time = 0.16 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.74 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, {\left (d x + c\right )} b^{2} - 24 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {44 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x, algorithm="giac" )
Output:
1/24*(a^2*tan(1/2*d*x + 1/2*c)^3 + 6*a*b*tan(1/2*d*x + 1/2*c)^2 - 24*(d*x + c)*b^2 - 24*a*b*log(abs(tan(1/2*d*x + 1/2*c))) - 3*a^2*tan(1/2*d*x + 1/2 *c) + 12*b^2*tan(1/2*d*x + 1/2*c) + (44*a*b*tan(1/2*d*x + 1/2*c)^3 + 3*a^2 *tan(1/2*d*x + 1/2*c)^2 - 12*b^2*tan(1/2*d*x + 1/2*c)^2 - 6*a*b*tan(1/2*d* x + 1/2*c) - a^2)/tan(1/2*d*x + 1/2*c)^3)/d
Time = 34.25 (sec) , antiderivative size = 231, normalized size of antiderivative = 2.41 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}+\frac {a^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {b^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {2\,b^2\,\mathrm {atan}\left (\frac {b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,b\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {a\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \] Input:
int((cot(c + d*x)^2*(a + b*sin(c + d*x))^2)/sin(c + d*x)^2,x)
Output:
(a^2*tan(c/2 + (d*x)/2)^3)/(24*d) - (a^2*cot(c/2 + (d*x)/2)^3)/(24*d) + (a ^2*cot(c/2 + (d*x)/2))/(8*d) - (b^2*cot(c/2 + (d*x)/2))/(2*d) - (a^2*tan(c /2 + (d*x)/2))/(8*d) + (b^2*tan(c/2 + (d*x)/2))/(2*d) - (2*b^2*atan((b*cos (c/2 + (d*x)/2) + a*sin(c/2 + (d*x)/2))/(a*cos(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2))))/d - (a*b*cot(c/2 + (d*x)/2)^2)/(4*d) + (a*b*tan(c/2 + (d*x)/ 2)^2)/(4*d) - (a*b*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d
Time = 0.18 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.20 \[ \int \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2}-3 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2}-3 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b -\cos \left (d x +c \right ) a^{2}-3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3} a b -3 \sin \left (d x +c \right )^{3} b^{2} d x}{3 \sin \left (d x +c \right )^{3} d} \] Input:
int(cot(d*x+c)^2*csc(d*x+c)^2*(a+b*sin(d*x+c))^2,x)
Output:
(cos(c + d*x)*sin(c + d*x)**2*a**2 - 3*cos(c + d*x)*sin(c + d*x)**2*b**2 - 3*cos(c + d*x)*sin(c + d*x)*a*b - cos(c + d*x)*a**2 - 3*log(tan((c + d*x) /2))*sin(c + d*x)**3*a*b - 3*sin(c + d*x)**3*b**2*d*x)/(3*sin(c + d*x)**3* d)