Integrand size = 25, antiderivative size = 52 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=-a x+\frac {a \text {arctanh}(\cos (c+d x))}{2 d}-\frac {a \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d} \] Output:
-a*x+1/2*a*arctanh(cos(d*x+c))/d-a*cot(d*x+c)/d-1/2*a*cot(d*x+c)*csc(d*x+c )/d
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.13 (sec) , antiderivative size = 109, normalized size of antiderivative = 2.10 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=-\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {a \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}+\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d} \] Input:
Integrate[Cot[c + d*x]^2*Csc[c + d*x]*(a + a*Sin[c + d*x]),x]
Output:
-1/8*(a*Csc[(c + d*x)/2]^2)/d - (a*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2])/d + (a*Log[Cos[(c + d*x)/2]])/(2*d) - (a*Log[Sin[( c + d*x)/2]])/(2*d) + (a*Sec[(c + d*x)/2]^2)/(8*d)
Time = 0.42 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.04, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {3042, 3317, 3042, 3091, 3042, 3954, 24, 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 (c+d x) (a \sin (c+d x)+a) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)^2 (a \sin (c+d x)+a)}{\sin (c+d x)^3}dx\) |
\(\Big \downarrow \) 3317 |
\(\displaystyle a \int \cot ^2(c+d x)dx+a \int \cot ^2(c+d x) \csc (c+d x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx+a \int \sec \left (c+d x-\frac {\pi }{2}\right ) \tan \left (c+d x-\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3091 |
\(\displaystyle a \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx+a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx+a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle a \left (-\int 1dx-\frac {\cot (c+d x)}{d}\right )+a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )\) |
\(\Big \downarrow \) 24 |
\(\displaystyle a \left (-\frac {1}{2} \int \csc (c+d x)dx-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+a \left (-\frac {\cot (c+d x)}{d}-x\right )\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle a \left (\frac {\text {arctanh}(\cos (c+d x))}{2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 d}\right )+a \left (-\frac {\cot (c+d x)}{d}-x\right )\) |
Input:
Int[Cot[c + d*x]^2*Csc[c + d*x]*(a + a*Sin[c + d*x]),x]
Output:
a*(-x - Cot[c + d*x]/d) + a*(ArcTanh[Cos[c + d*x]]/(2*d) - (Cot[c + d*x]*C sc[c + d*x])/(2*d))
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( n_), x_Symbol] :> Simp[b*(a*Sec[e + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Simp[b^2*((n - 1)/(m + n - 1)) Int[(a*Sec[e + f*x])^m*( b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] & & NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n _.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a Int[(g*Co s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d Int[(g*Cos[e + f*x])^ p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d *x])^(n - 1)/(d*(n - 1))), x] - Simp[b^2 Int[(b*Tan[c + d*x])^(n - 2), x] , x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.19 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.37
method | result | size |
derivativedivides | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+a \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 )}{d}\) | \(71\) |
default | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+a \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 )}{d}\) | \(71\) |
risch | \(-a x +\frac {a \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}-2 i {\mathrm e}^{2 i \left (d x +c \right )}+2 i\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) | \(93\) |
Input:
int(cot(d*x+c)^2*csc(d*x+c)*(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)
Output:
1/d*(a*(-cot(d*x+c)-d*x-c)+a*(-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))))
Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (48) = 96\).
Time = 0.09 (sec) , antiderivative size = 114, normalized size of antiderivative = 2.19 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=-\frac {4 \, a d x \cos \left (d x + c\right )^{2} - 4 \, a d x - 4 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="fricas")
Output:
-1/4*(4*a*d*x*cos(d*x + c)^2 - 4*a*d*x - 4*a*cos(d*x + c)*sin(d*x + c) - 2 *a*cos(d*x + c) - (a*cos(d*x + c)^2 - a)*log(1/2*cos(d*x + c) + 1/2) + (a* cos(d*x + c)^2 - a)*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^2 - d)
\[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=a \left (\int \cot ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx + \int \sin {\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx\right ) \] Input:
integrate(cot(d*x+c)**2*csc(d*x+c)*(a+a*sin(d*x+c)),x)
Output:
a*(Integral(cot(c + d*x)**2*csc(c + d*x), x) + Integral(sin(c + d*x)*cot(c + d*x)**2*csc(c + d*x), x))
Time = 0.11 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.27 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=-\frac {4 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a - a {\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 )}}{4 \, d} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="maxima")
Output:
-1/4*(4*(d*x + c + 1/tan(d*x + c))*a - a*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - log(cos(d*x + c) - 1)))/d
Time = 0.15 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.83 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, {\left (d x + c\right )} a - 4 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {6 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \] Input:
integrate(cot(d*x+c)^2*csc(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="giac")
Output:
1/8*(a*tan(1/2*d*x + 1/2*c)^2 - 8*(d*x + c)*a - 4*a*log(abs(tan(1/2*d*x + 1/2*c))) + 4*a*tan(1/2*d*x + 1/2*c) + (6*a*tan(1/2*d*x + 1/2*c)^2 - 4*a*ta n(1/2*d*x + 1/2*c) - a)/tan(1/2*d*x + 1/2*c)^2)/d
Time = 18.15 (sec) , antiderivative size = 145, normalized size of antiderivative = 2.79 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {a\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d} \] Input:
int((cot(c + d*x)^2*(a + a*sin(c + d*x)))/sin(c + d*x),x)
Output:
(a*tan(c/2 + (d*x)/2))/(2*d) - (a*cot(c/2 + (d*x)/2))/(2*d) - (2*a*atan((2 *cos(c/2 + (d*x)/2) + sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2) - 2*sin(c/2 + (d*x)/2))))/d - (a*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(2*d) - ( a*cot(c/2 + (d*x)/2)^2)/(8*d) + (a*tan(c/2 + (d*x)/2)^2)/(8*d)
Time = 0.16 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.33 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \left (-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )-\cos \left (d x +c \right )-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2}-2 \sin \left (d x +c \right )^{2} d x \right )}{2 \sin \left (d x +c \right )^{2} d} \] Input:
int(cot(d*x+c)^2*csc(d*x+c)*(a+a*sin(d*x+c)),x)
Output:
(a*( - 2*cos(c + d*x)*sin(c + d*x) - cos(c + d*x) - log(tan((c + d*x)/2))* sin(c + d*x)**2 - 2*sin(c + d*x)**2*d*x))/(2*sin(c + d*x)**2*d)