Integrand size = 20, antiderivative size = 58 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=-\frac {d \text {arctanh}(\cos (a+b x))}{b^2}-\frac {d \cos (a+b x)}{b^2}-\frac {(c+d x) \csc (a+b x)}{b}-\frac {(c+d x) \sin (a+b x)}{b} \] Output:
-d*arctanh(cos(b*x+a))/b^2-d*cos(b*x+a)/b^2-(d*x+c)*csc(b*x+a)/b-(d*x+c)*s in(b*x+a)/b
Time = 0.69 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.79 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=-\frac {2 d \cos (a+b x)+b d x \cot \left (\frac {1}{2} (a+b x)\right )+2 b c \csc (a+b x)+2 d \log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )-2 d \log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )+2 b c \sin (a+b x)+2 b d x \sin (a+b x)+b d x \tan \left (\frac {1}{2} (a+b x)\right )}{2 b^2} \] Input:
Integrate[(c + d*x)*Cos[a + b*x]*Cot[a + b*x]^2,x]
Output:
-1/2*(2*d*Cos[a + b*x] + b*d*x*Cot[(a + b*x)/2] + 2*b*c*Csc[a + b*x] + 2*d *Log[Cos[(a + b*x)/2]] - 2*d*Log[Sin[(a + b*x)/2]] + 2*b*c*Sin[a + b*x] + 2*b*d*x*Sin[a + b*x] + b*d*x*Tan[(a + b*x)/2])/b^2
Time = 0.46 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.450, Rules used = {4908, 3042, 3777, 25, 3042, 3118, 4910, 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 (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 4908 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx-\int (c+d x) \cos (a+b x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx-\int (c+d x) \sin \left (a+b x+\frac {\pi }{2}\right )dx\) |
\(\Big \downarrow \) 3777 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx-\frac {d \int -\sin (a+b x)dx}{b}-\frac {(c+d x) \sin (a+b x)}{b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx+\frac {d \int \sin (a+b x)dx}{b}-\frac {(c+d x) \sin (a+b x)}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx+\frac {d \int \sin (a+b x)dx}{b}-\frac {(c+d x) \sin (a+b x)}{b}\) |
\(\Big \downarrow \) 3118 |
\(\displaystyle \int (c+d x) \cot (a+b x) \csc (a+b x)dx-\frac {d \cos (a+b x)}{b^2}-\frac {(c+d x) \sin (a+b x)}{b}\) |
\(\Big \downarrow \) 4910 |
\(\displaystyle \frac {d \int \csc (a+b x)dx}{b}-\frac {d \cos (a+b x)}{b^2}-\frac {(c+d x) \sin (a+b x)}{b}-\frac {(c+d x) \csc (a+b x)}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d \int \csc (a+b x)dx}{b}-\frac {d \cos (a+b x)}{b^2}-\frac {(c+d x) \sin (a+b x)}{b}-\frac {(c+d x) \csc (a+b x)}{b}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {d \text {arctanh}(\cos (a+b x))}{b^2}-\frac {d \cos (a+b x)}{b^2}-\frac {(c+d x) \sin (a+b x)}{b}-\frac {(c+d x) \csc (a+b x)}{b}\) |
Input:
Int[(c + d*x)*Cos[a + b*x]*Cot[a + b*x]^2,x]
Output:
-((d*ArcTanh[Cos[a + b*x]])/b^2) - (d*Cos[a + b*x])/b^2 - ((c + d*x)*Csc[a + b*x])/b - ((c + d*x)*Sin[a + b*x])/b
Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[( -(c + d*x)^m)*(Cos[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1)*C os[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[Cos[(a_.) + (b_.)*(x_)]^(n_.)*Cot[(a_.) + (b_.)*(x_)]^(p_.)*((c_.) + (d _.)*(x_))^(m_.), x_Symbol] :> -Int[(c + d*x)^m*Cos[a + b*x]^n*Cot[a + b*x]^ (p - 2), x] + Int[(c + d*x)^m*Cos[a + b*x]^(n - 2)*Cot[a + b*x]^p, x] /; Fr eeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]
Int[Cot[(a_.) + (b_.)*(x_)]^(p_.)*Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d _.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Csc[a + b*x]^n/(b*n)), x ] + Simp[d*(m/(b*n)) Int[(c + d*x)^(m - 1)*Csc[a + b*x]^n, x], x] /; Free Q[{a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]
Result contains complex when optimal does not.
Time = 0.51 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.14
method | result | size |
risch | \(\frac {i \left (b d x +c b +i d \right ) {\mathrm e}^{i \left (b x +a \right )}}{2 b^{2}}-\frac {i \left (b d x +c b -i d \right ) {\mathrm e}^{-i \left (b x +a \right )}}{2 b^{2}}-\frac {2 i \left (d x +c \right ) {\mathrm e}^{i \left (b x +a \right )}}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}-\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}\) | \(124\) |
Input:
int((d*x+c)*cos(b*x+a)*cot(b*x+a)^2,x,method=_RETURNVERBOSE)
Output:
1/2*I*(b*d*x+c*b+I*d)/b^2*exp(I*(b*x+a))-1/2*I*(b*d*x+c*b-I*d)/b^2*exp(-I* (b*x+a))-2*I*(d*x+c)*exp(I*(b*x+a))/b/(exp(2*I*(b*x+a))-1)-d/b^2*ln(exp(I* (b*x+a))+1)+d/b^2*ln(exp(I*(b*x+a))-1)
Time = 0.08 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.64 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=-\frac {4 \, b d x - 2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} + 2 \, d \cos \left (b x + a\right ) \sin \left (b x + a\right ) + d \log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) - d \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) + 4 \, b c}{2 \, b^{2} \sin \left (b x + a\right )} \] Input:
integrate((d*x+c)*cos(b*x+a)*cot(b*x+a)^2,x, algorithm="fricas")
Output:
-1/2*(4*b*d*x - 2*(b*d*x + b*c)*cos(b*x + a)^2 + 2*d*cos(b*x + a)*sin(b*x + a) + d*log(1/2*cos(b*x + a) + 1/2)*sin(b*x + a) - d*log(-1/2*cos(b*x + a ) + 1/2)*sin(b*x + a) + 4*b*c)/(b^2*sin(b*x + a))
\[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=\int \left (c + d x\right ) \cos {\left (a + b x \right )} \cot ^{2}{\left (a + b x \right )}\, dx \] Input:
integrate((d*x+c)*cos(b*x+a)*cot(b*x+a)**2,x)
Output:
Integral((c + d*x)*cos(a + b*x)*cot(a + b*x)**2, x)
Leaf count of result is larger than twice the leaf count of optimal. 2110 vs. \(2 (58) = 116\).
Time = 0.06 (sec) , antiderivative size = 2110, normalized size of antiderivative = 36.38 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=\text {Too large to display} \] Input:
integrate((d*x+c)*cos(b*x+a)*cot(b*x+a)^2,x, algorithm="maxima")
Output:
-1/2*(2*c*(1/sin(b*x + a) + sin(b*x + a)) - 2*a*d*(1/sin(b*x + a) + sin(b* x + a))/b - (((b*x + a)*sin(2*b*x + 2*a) - cos(2*b*x + 2*a) + 1)*cos(3*b*x + 3*a)^3 + (b*x - (b*x + a)*cos(2*b*x + 2*a) + a - sin(2*b*x + 2*a))*sin( 3*b*x + 3*a)^3 - 6*(b*x + a)*sin(b*x + a)^3 - 2*(4*(b*x + a)*cos(b*x + a)* sin(2*b*x + 2*a) - (3*(b*x + a)*sin(b*x + a) + cos(b*x + a))*cos(2*b*x + 2 *a) + 3*(b*x + a)*sin(b*x + a) + cos(b*x + a))*cos(3*b*x + 3*a)^2 - ((b*x + a)*sin(b*x + a) + cos(b*x + a))*cos(2*b*x + 2*a)^2 + (8*(b*x + a)*cos(2* b*x + 2*a)*sin(b*x + a) + ((b*x + a)*sin(2*b*x + 2*a) - cos(2*b*x + 2*a) + 1)*cos(3*b*x + 3*a) - 2*(3*(b*x + a)*cos(b*x + a) - sin(b*x + a))*sin(2*b *x + 2*a) - 8*(b*x + a)*sin(b*x + a))*sin(3*b*x + 3*a)^2 - ((b*x + a)*sin( b*x + a) + cos(b*x + a))*sin(2*b*x + 2*a)^2 + (12*(b*x + a)*cos(b*x + a)*s in(b*x + a) - (12*(b*x + a)*cos(b*x + a)*sin(b*x + a) + cos(b*x + a)^2 + s in(b*x + a)^2 + 2)*cos(2*b*x + 2*a) + cos(2*b*x + 2*a)^2 + cos(b*x + a)^2 + (13*(b*x + a)*cos(b*x + a)^2 + (b*x + a)*sin(b*x + a)^2)*sin(2*b*x + 2*a ) + sin(2*b*x + 2*a)^2 + sin(b*x + a)^2 + 1)*cos(3*b*x + 3*a) + 2*(3*(b*x + a)*sin(b*x + a)^3 + (3*(b*x + a)*cos(b*x + a)^2 + b*x + a)*sin(b*x + a) + cos(b*x + a))*cos(2*b*x + 2*a) - ((cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a) ^2 - 2*cos(2*b*x + 2*a) + 1)*cos(3*b*x + 3*a)^2 + (cos(b*x + a)^2 + sin(b* x + a)^2)*cos(2*b*x + 2*a)^2 + (cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 - 2*cos(2*b*x + 2*a) + 1)*sin(3*b*x + 3*a)^2 + (cos(b*x + a)^2 + sin(b*x ...
Leaf count of result is larger than twice the leaf count of optimal. 1759 vs. \(2 (58) = 116\).
Time = 0.66 (sec) , antiderivative size = 1759, normalized size of antiderivative = 30.33 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=\text {Too large to display} \] Input:
integrate((d*x+c)*cos(b*x+a)*cot(b*x+a)^2,x, algorithm="giac")
Output:
1/2*(b*d*x*tan(1/2*b*x)^4*tan(1/2*a)^4 + b*c*tan(1/2*b*x)^4*tan(1/2*a)^4 + 6*b*d*x*tan(1/2*b*x)^4*tan(1/2*a)^2 + 8*b*d*x*tan(1/2*b*x)^3*tan(1/2*a)^3 - d*log(4*(tan(1/2*b*x)^2*tan(1/2*a)^2 - 2*tan(1/2*b*x)*tan(1/2*a) + 1)/( tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2* b*x)^4*tan(1/2*a)^3 + d*log(4*(tan(1/2*b*x)^2 + 2*tan(1/2*b*x)*tan(1/2*a) + tan(1/2*a)^2)/(tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a) ^2 + 1))*tan(1/2*b*x)^4*tan(1/2*a)^3 + 6*b*d*x*tan(1/2*b*x)^2*tan(1/2*a)^4 - d*log(4*(tan(1/2*b*x)^2*tan(1/2*a)^2 - 2*tan(1/2*b*x)*tan(1/2*a) + 1)/( tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2* b*x)^3*tan(1/2*a)^4 + d*log(4*(tan(1/2*b*x)^2 + 2*tan(1/2*b*x)*tan(1/2*a) + tan(1/2*a)^2)/(tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a) ^2 + 1))*tan(1/2*b*x)^3*tan(1/2*a)^4 + 6*b*c*tan(1/2*b*x)^4*tan(1/2*a)^2 + 8*b*c*tan(1/2*b*x)^3*tan(1/2*a)^3 - 2*d*tan(1/2*b*x)^4*tan(1/2*a)^3 + 6*b *c*tan(1/2*b*x)^2*tan(1/2*a)^4 - 2*d*tan(1/2*b*x)^3*tan(1/2*a)^4 + b*d*x*t an(1/2*b*x)^4 - 8*b*d*x*tan(1/2*b*x)^3*tan(1/2*a) - d*log(4*(tan(1/2*b*x)^ 2*tan(1/2*a)^2 - 2*tan(1/2*b*x)*tan(1/2*a) + 1)/(tan(1/2*b*x)^2*tan(1/2*a) ^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2*b*x)^4*tan(1/2*a) + d*log (4*(tan(1/2*b*x)^2 + 2*tan(1/2*b*x)*tan(1/2*a) + tan(1/2*a)^2)/(tan(1/2*b* x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2*b*x)^4*tan (1/2*a) - 12*b*d*x*tan(1/2*b*x)^2*tan(1/2*a)^2 - 8*b*d*x*tan(1/2*b*x)*t...
Time = 19.06 (sec) , antiderivative size = 162, normalized size of antiderivative = 2.79 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx={\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (\frac {\left (b\,c+d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,b^2}+\frac {d\,x\,1{}\mathrm {i}}{2\,b}\right )+{\mathrm {e}}^{-a\,1{}\mathrm {i}-b\,x\,1{}\mathrm {i}}\,\left (\frac {\left (-b\,c+d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,b^2}-\frac {d\,x\,1{}\mathrm {i}}{2\,b}\right )-\frac {d\,\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}+1{}\mathrm {i}\right )}{b^2}+\frac {d\,\ln \left (d\,2{}\mathrm {i}-d\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,2{}\mathrm {i}\right )}{b^2}+\frac {2\,{\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (c+d\,x\right )}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}\right )} \] Input:
int(cos(a + b*x)*cot(a + b*x)^2*(c + d*x),x)
Output:
exp(a*1i + b*x*1i)*(((d*1i + b*c)*1i)/(2*b^2) + (d*x*1i)/(2*b)) + exp(- a* 1i - b*x*1i)*(((d*1i - b*c)*1i)/(2*b^2) - (d*x*1i)/(2*b)) - (d*log(exp(a*1 i + b*x*1i)*1i + 1i))/b^2 + (d*log(d*2i - d*exp(a*1i)*exp(b*x*1i)*2i))/b^2 + (2*exp(a*1i + b*x*1i)*(c + d*x))/(b*(exp(a*2i + b*x*2i)*1i - 1i))
Time = 0.15 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.52 \[ \int (c+d x) \cos (a+b x) \cot ^2(a+b x) \, dx=\frac {-\cos \left (b x +a \right ) \sin \left (b x +a \right ) d +\mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right ) \sin \left (b x +a \right ) d -\sin \left (b x +a \right )^{2} b c -\sin \left (b x +a \right )^{2} b d x +\sin \left (b x +a \right ) d -b c -b d x}{\sin \left (b x +a \right ) b^{2}} \] Input:
int((d*x+c)*cos(b*x+a)*cot(b*x+a)^2,x)
Output:
( - cos(a + b*x)*sin(a + b*x)*d + log(tan((a + b*x)/2))*sin(a + b*x)*d - s in(a + b*x)**2*b*c - sin(a + b*x)**2*b*d*x + sin(a + b*x)*d - b*c - b*d*x) /(sin(a + b*x)*b**2)