Integrand size = 12, antiderivative size = 65 \[ \int (c+d x) \cot (a+b x) \, dx=-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2} \] Output:
-1/2*I*(d*x+c)^2/d+(d*x+c)*ln(1-exp(2*I*(b*x+a)))/b-1/2*I*d*polylog(2,exp( 2*I*(b*x+a)))/b^2
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(180\) vs. \(2(65)=130\).
Time = 3.50 (sec) , antiderivative size = 180, normalized size of antiderivative = 2.77 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {1}{2} d x^2 \cot (a)+\frac {c \log (\sin (a+b x))}{b}-\frac {d \csc (a) \sec (a) \left (b^2 e^{i \arctan (\tan (a))} x^2+\frac {\left (i b x (-\pi +2 \arctan (\tan (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x+\arctan (\tan (a))) \log \left (1-e^{2 i (b x+\arctan (\tan (a)))}\right )+\pi \log (\cos (b x))+2 \arctan (\tan (a)) \log (\sin (b x+\arctan (\tan (a))))+i \operatorname {PolyLog}\left (2,e^{2 i (b x+\arctan (\tan (a)))}\right )\right ) \tan (a)}{\sqrt {1+\tan ^2(a)}}\right )}{2 b^2 \sqrt {\sec ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}} \] Input:
Integrate[(c + d*x)*Cot[a + b*x],x]
Output:
(d*x^2*Cot[a])/2 + (c*Log[Sin[a + b*x]])/b - (d*Csc[a]*Sec[a]*(b^2*E^(I*Ar cTan[Tan[a]])*x^2 + ((I*b*x*(-Pi + 2*ArcTan[Tan[a]]) - Pi*Log[1 + E^((-2*I )*b*x)] - 2*(b*x + ArcTan[Tan[a]])*Log[1 - E^((2*I)*(b*x + ArcTan[Tan[a]]) )] + Pi*Log[Cos[b*x]] + 2*ArcTan[Tan[a]]*Log[Sin[b*x + ArcTan[Tan[a]]]] + I*PolyLog[2, E^((2*I)*(b*x + ArcTan[Tan[a]]))])*Tan[a])/Sqrt[1 + Tan[a]^2] ))/(2*b^2*Sqrt[Sec[a]^2*(Cos[a]^2 + Sin[a]^2)])
Time = 0.36 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.25, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 25, 4202, 2620, 2715, 2838}
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) \cot (a+b x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\left ((c+d x) \tan \left (a+b x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int (c+d x) \tan \left (\frac {1}{2} (2 a+\pi )+b x\right )dx\) |
\(\Big \downarrow \) 4202 |
\(\displaystyle 2 i \int \frac {e^{i (2 a+2 b x+\pi )} (c+d x)}{1+e^{i (2 a+2 b x+\pi )}}dx-\frac {i (c+d x)^2}{2 d}\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle 2 i \left (\frac {i d \int \log \left (1+e^{i (2 a+2 b x+\pi )}\right )dx}{2 b}-\frac {i (c+d x) \log \left (1+e^{i (2 a+2 b x+\pi )}\right )}{2 b}\right )-\frac {i (c+d x)^2}{2 d}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle 2 i \left (\frac {d \int e^{-i (2 a+2 b x+\pi )} \log \left (1+e^{i (2 a+2 b x+\pi )}\right )de^{i (2 a+2 b x+\pi )}}{4 b^2}-\frac {i (c+d x) \log \left (1+e^{i (2 a+2 b x+\pi )}\right )}{2 b}\right )-\frac {i (c+d x)^2}{2 d}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle 2 i \left (-\frac {d \operatorname {PolyLog}\left (2,-e^{i (2 a+2 b x+\pi )}\right )}{4 b^2}-\frac {i (c+d x) \log \left (1+e^{i (2 a+2 b x+\pi )}\right )}{2 b}\right )-\frac {i (c+d x)^2}{2 d}\) |
Input:
Int[(c + d*x)*Cot[a + b*x],x]
Output:
((-1/2*I)*(c + d*x)^2)/d + (2*I)*(((-1/2*I)*(c + d*x)*Log[1 + E^(I*(2*a + Pi + 2*b*x))])/b - (d*PolyLog[2, -E^(I*(2*a + Pi + 2*b*x))])/(4*b^2))
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I *((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[2*I Int[(c + d*x)^m*(E^(2*I*( e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] && IGt Q[m, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 203 vs. \(2 (55 ) = 110\).
Time = 0.31 (sec) , antiderivative size = 204, normalized size of antiderivative = 3.14
method | result | size |
parts | \(-\frac {\ln \left (\cot \left (b x +a \right )^{2}+1\right ) d x}{2 b}-\frac {\ln \left (\cot \left (b x +a \right )^{2}+1\right ) c}{2 b}+\frac {d \left (\frac {i \left (\ln \left (\cot \left (b x +a \right )-i\right ) \ln \left (\cot \left (b x +a \right )^{2}+1\right )-\operatorname {dilog}\left (-\frac {i \left (\cot \left (b x +a \right )+i\right )}{2}\right )-\ln \left (\cot \left (b x +a \right )-i\right ) \ln \left (-\frac {i \left (\cot \left (b x +a \right )+i\right )}{2}\right )-\frac {\ln \left (\cot \left (b x +a \right )-i\right )^{2}}{2}\right )}{2}-\frac {i \left (\ln \left (\cot \left (b x +a \right )+i\right ) \ln \left (\cot \left (b x +a \right )^{2}+1\right )-\operatorname {dilog}\left (\frac {i \left (\cot \left (b x +a \right )-i\right )}{2}\right )-\ln \left (\cot \left (b x +a \right )+i\right ) \ln \left (\frac {i \left (\cot \left (b x +a \right )-i\right )}{2}\right )-\frac {\ln \left (\cot \left (b x +a \right )+i\right )^{2}}{2}\right )}{2}\right )}{2 b^{2}}\) | \(204\) |
risch | \(-\frac {i d \,x^{2}}{2}+i x c -\frac {2 c \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}+\frac {c \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b}+\frac {c \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b}-\frac {2 i d a x}{b}-\frac {i d \,a^{2}}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}-\frac {i d \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}-\frac {i d \operatorname {polylog}\left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}\) | \(215\) |
Input:
int((d*x+c)*cot(b*x+a),x,method=_RETURNVERBOSE)
Output:
-1/2/b*ln(cot(b*x+a)^2+1)*d*x-1/2/b*ln(cot(b*x+a)^2+1)*c+1/2*d/b^2*(1/2*I* (ln(cot(b*x+a)-I)*ln(cot(b*x+a)^2+1)-dilog(-1/2*I*(cot(b*x+a)+I))-ln(cot(b *x+a)-I)*ln(-1/2*I*(cot(b*x+a)+I))-1/2*ln(cot(b*x+a)-I)^2)-1/2*I*(ln(cot(b *x+a)+I)*ln(cot(b*x+a)^2+1)-dilog(1/2*I*(cot(b*x+a)-I))-ln(cot(b*x+a)+I)*l n(1/2*I*(cot(b*x+a)-I))-1/2*ln(cot(b*x+a)+I)^2))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 196 vs. \(2 (52) = 104\).
Time = 0.08 (sec) , antiderivative size = 196, normalized size of antiderivative = 3.02 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {-i \, d {\rm Li}_2\left (\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right )\right ) + i \, d {\rm Li}_2\left (\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right )\right ) + 2 \, {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, a\right ) + \frac {1}{2} i \, \sin \left (2 \, b x + 2 \, a\right ) + \frac {1}{2}\right ) + 2 \, {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, a\right ) - \frac {1}{2} i \, \sin \left (2 \, b x + 2 \, a\right ) + \frac {1}{2}\right ) + 2 \, {\left (b d x + a d\right )} \log \left (-\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \, {\left (b d x + a d\right )} \log \left (-\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right )}{4 \, b^{2}} \] Input:
integrate((d*x+c)*cot(b*x+a),x, algorithm="fricas")
Output:
1/4*(-I*d*dilog(cos(2*b*x + 2*a) + I*sin(2*b*x + 2*a)) + I*d*dilog(cos(2*b *x + 2*a) - I*sin(2*b*x + 2*a)) + 2*(b*c - a*d)*log(-1/2*cos(2*b*x + 2*a) + 1/2*I*sin(2*b*x + 2*a) + 1/2) + 2*(b*c - a*d)*log(-1/2*cos(2*b*x + 2*a) - 1/2*I*sin(2*b*x + 2*a) + 1/2) + 2*(b*d*x + a*d)*log(-cos(2*b*x + 2*a) + I*sin(2*b*x + 2*a) + 1) + 2*(b*d*x + a*d)*log(-cos(2*b*x + 2*a) - I*sin(2* b*x + 2*a) + 1))/b^2
\[ \int (c+d x) \cot (a+b x) \, dx=\int \left (c + d x\right ) \cot {\left (a + b x \right )}\, dx \] Input:
integrate((d*x+c)*cot(b*x+a),x)
Output:
Integral((c + d*x)*cot(a + b*x), x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (52) = 104\).
Time = 0.12 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.92 \[ \int (c+d x) \cot (a+b x) \, dx=\frac {-i \, b^{2} d x^{2} - 2 i \, b^{2} c x - 2 i \, b d x \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) + 2 i \, b c \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 i \, d {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 2 i \, d {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right )}{2 \, b^{2}} \] Input:
integrate((d*x+c)*cot(b*x+a),x, algorithm="maxima")
Output:
1/2*(-I*b^2*d*x^2 - 2*I*b^2*c*x - 2*I*b*d*x*arctan2(sin(b*x + a), -cos(b*x + a) + 1) + 2*I*b*c*arctan2(sin(b*x + a), cos(b*x + a) - 1) - 2*(-I*b*d*x - I*b*c)*arctan2(sin(b*x + a), cos(b*x + a) + 1) - 2*I*d*dilog(-e^(I*b*x + I*a)) - 2*I*d*dilog(e^(I*b*x + I*a)) + (b*d*x + b*c)*log(cos(b*x + a)^2 + sin(b*x + a)^2 + 2*cos(b*x + a) + 1) + (b*d*x + b*c)*log(cos(b*x + a)^2 + sin(b*x + a)^2 - 2*cos(b*x + a) + 1))/b^2
\[ \int (c+d x) \cot (a+b x) \, dx=\int { {\left (d x + c\right )} \cot \left (b x + a\right ) \,d x } \] Input:
integrate((d*x+c)*cot(b*x+a),x, algorithm="giac")
Output:
integrate((d*x + c)*cot(b*x + a), x)
Timed out. \[ \int (c+d x) \cot (a+b x) \, dx=\int \mathrm {cot}\left (a+b\,x\right )\,\left (c+d\,x\right ) \,d x \] Input:
int(cot(a + b*x)*(c + d*x),x)
Output:
int(cot(a + b*x)*(c + d*x), x)
\[ \int (c+d x) \cot (a+b x) \, dx=\frac {\left (\int \cot \left (b x +a \right ) x d x \right ) b d -\mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+1\right ) c +\mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right ) c}{b} \] Input:
int((d*x+c)*cot(b*x+a),x)
Output:
(int(cot(a + b*x)*x,x)*b*d - log(tan((a + b*x)/2)**2 + 1)*c + log(tan((a + b*x)/2))*c)/b