Integrand size = 17, antiderivative size = 232 \[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\frac {(e+f x)^2 \log \left (1-e^{-2 i (c+d x)}\right )}{2 f}-\frac {(e+f x)^2 \log \left (1-\frac {(a-i b) e^{-2 i (c+d x)}}{a+i b}\right )}{2 f}+\frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}+\frac {i (e+f x) \operatorname {PolyLog}\left (2,e^{-2 i (c+d x)}\right )}{2 d}-\frac {i (e+f x) \operatorname {PolyLog}\left (2,\frac {(a-i b) e^{-2 i (c+d x)}}{a+i b}\right )}{2 d}+\frac {f \operatorname {PolyLog}\left (3,e^{-2 i (c+d x)}\right )}{4 d^2}-\frac {f \operatorname {PolyLog}\left (3,\frac {(a-i b) e^{-2 i (c+d x)}}{a+i b}\right )}{4 d^2} \] Output:
1/2*(f*x+e)^2*ln(1-exp(-2*I*(d*x+c)))/f-1/2*(f*x+e)^2*ln(1-(a-I*b)/(a+I*b) /exp(2*I*(d*x+c)))/f+1/2*(f*x+e)^2*ln(a+b*cot(d*x+c))/f+1/2*I*(f*x+e)*poly log(2,exp(-2*I*(d*x+c)))/d-1/2*I*(f*x+e)*polylog(2,(a-I*b)/(a+I*b)/exp(2*I *(d*x+c)))/d+1/4*f*polylog(3,exp(-2*I*(d*x+c)))/d^2-1/4*f*polylog(3,(a-I*b )/(a+I*b)/exp(2*I*(d*x+c)))/d^2
Time = 2.41 (sec) , antiderivative size = 400, normalized size of antiderivative = 1.72 \[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\frac {2 d^2 f x^2 \log \left (1-e^{-i (c+d x)}\right )+2 d^2 f x^2 \log \left (1+e^{-i (c+d x)}\right )-2 d^2 f x^2 \log \left (1+\frac {(-a+i b) e^{-2 i (c+d x)}}{a+i b}\right )+2 d^2 f x^2 \log (a+b \cot (c+d x))+2 i d e \log \left (-\frac {b (-i+\cot (c+d x))}{a+i b}\right ) \log (a+b \cot (c+d x))-2 i d e \log \left (-\frac {b (i+\cot (c+d x))}{a-i b}\right ) \log (a+b \cot (c+d x))+4 i d f x \operatorname {PolyLog}\left (2,-e^{-i (c+d x)}\right )+4 i d f x \operatorname {PolyLog}\left (2,e^{-i (c+d x)}\right )-2 i d f x \operatorname {PolyLog}\left (2,\frac {(a-i b) e^{-2 i (c+d x)}}{a+i b}\right )-2 i d e \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a-i b}\right )+2 i d e \operatorname {PolyLog}\left (2,\frac {a+b \cot (c+d x)}{a+i b}\right )+4 f \operatorname {PolyLog}\left (3,-e^{-i (c+d x)}\right )+4 f \operatorname {PolyLog}\left (3,e^{-i (c+d x)}\right )-f \operatorname {PolyLog}\left (3,\frac {(a-i b) e^{-2 i (c+d x)}}{a+i b}\right )}{4 d^2} \] Input:
Integrate[(e + f*x)*Log[a + b*Cot[c + d*x]],x]
Output:
(2*d^2*f*x^2*Log[1 - E^((-I)*(c + d*x))] + 2*d^2*f*x^2*Log[1 + E^((-I)*(c + d*x))] - 2*d^2*f*x^2*Log[1 + (-a + I*b)/((a + I*b)*E^((2*I)*(c + d*x)))] + 2*d^2*f*x^2*Log[a + b*Cot[c + d*x]] + (2*I)*d*e*Log[-((b*(-I + Cot[c + d*x]))/(a + I*b))]*Log[a + b*Cot[c + d*x]] - (2*I)*d*e*Log[-((b*(I + Cot[c + d*x]))/(a - I*b))]*Log[a + b*Cot[c + d*x]] + (4*I)*d*f*x*PolyLog[2, -E^ ((-I)*(c + d*x))] + (4*I)*d*f*x*PolyLog[2, E^((-I)*(c + d*x))] - (2*I)*d*f *x*PolyLog[2, (a - I*b)/((a + I*b)*E^((2*I)*(c + d*x)))] - (2*I)*d*e*PolyL og[2, (a + b*Cot[c + d*x])/(a - I*b)] + (2*I)*d*e*PolyLog[2, (a + b*Cot[c + d*x])/(a + I*b)] + 4*f*PolyLog[3, -E^((-I)*(c + d*x))] + 4*f*PolyLog[3, E^((-I)*(c + d*x))] - f*PolyLog[3, (a - I*b)/((a + I*b)*E^((2*I)*(c + d*x) ))])/(4*d^2)
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 (e+f x) \log (a+b \cot (c+d x)) \, dx\) |
\(\Big \downarrow \) 3031 |
\(\displaystyle \frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}-\frac {\int -\frac {b d (e+f x)^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}dx}{2 f}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {b d (e+f x)^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}dx}{2 f}+\frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {b d \int \frac {(e+f x)^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}dx}{2 f}+\frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}\) |
\(\Big \downarrow \) 7293 |
\(\displaystyle \frac {b d \int \left (\frac {e^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}+\frac {f^2 x^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}+\frac {2 e f x \csc ^2(c+d x)}{a+b \cot (c+d x)}\right )dx}{2 f}+\frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b d \left (2 e f \int \frac {x \csc ^2(c+d x)}{a+b \cot (c+d x)}dx+f^2 \int \frac {x^2 \csc ^2(c+d x)}{a+b \cot (c+d x)}dx-\frac {e^2 \log (a+b \cot (c+d x))}{b d}\right )}{2 f}+\frac {(e+f x)^2 \log (a+b \cot (c+d x))}{2 f}\) |
Input:
Int[(e + f*x)*Log[a + b*Cot[c + d*x]],x]
Output:
$Aborted
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[Log[u_]*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[(a + b*x)^(m + 1) *(Log[u]/(b*(m + 1))), x] - Simp[1/(b*(m + 1)) Int[SimplifyIntegrand[(a + b*x)^(m + 1)*(D[u, x]/u), x], x], x] /; FreeQ[{a, b, m}, x] && InverseFunc tionFreeQ[u, x] && NeQ[m, -1]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 8.86 (sec) , antiderivative size = 3380, normalized size of antiderivative = 14.57
Input:
int((f*x+e)*ln(a+b*cot(d*x+c)),x,method=_RETURNVERBOSE)
Output:
1/2*f/d^2*ln(-exp(I*(d*x+c))+1)*c^2-I/d*f*b/(a+I*b)*ln(1-(a+I*b)*exp(2*I*( d*x+c))/(a-I*b))*c*x-I*f/d^2*c*dilog(exp(I*(d*x+c)))+I/d*e*dilog(exp(I*(d* x+c)))-I*f/d*polylog(2,-exp(I*(d*x+c)))*x-I*f/d^2*polylog(2,-exp(I*(d*x+c) ))*c+I*f/d^2*c*dilog(exp(I*(d*x+c))+1)-I*f/d*polylog(2,exp(I*(d*x+c)))*x-1 /d*e*a/(a+I*b)*ln(-(I*exp(I*(d*x+c))*b+a*exp(I*(d*x+c))-(-(I*b-a)*(a+I*b)) ^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))*c-1/d*e*a/(a+I*b)*ln((I*exp(I*(d*x+c))*b +a*exp(I*(d*x+c))+(-(I*b-a)*(a+I*b))^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))*c-1/ 2/d^2*a*f*c^2/(a+I*b)*ln(I*b*exp(2*I*(d*x+c))+a*exp(2*I*(d*x+c))+I*b-a)+I/ d*e*a/(a+I*b)*dilog((-I*exp(I*(d*x+c))*b-a*exp(I*(d*x+c))+(-(I*b-a)*(a+I*b ))^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))+I/d*e*a/(a+I*b)*dilog((I*exp(I*(d*x+c) )*b+a*exp(I*(d*x+c))+(-(I*b-a)*(a+I*b))^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))+1 /d^2*a*f*c^2/(a+I*b)*ln(-(I*exp(I*(d*x+c))*b+a*exp(I*(d*x+c))-(-(I*b-a)*(a +I*b))^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))+1/d^2*a*f*c^2/(a+I*b)*ln((I*exp(I* (d*x+c))*b+a*exp(I*(d*x+c))+(-(I*b-a)*(a+I*b))^(1/2))/(-(I*b-a)*(a+I*b))^( 1/2))+1/d^2*b*c*f/(a+I*b)*dilog((-I*exp(I*(d*x+c))*b-a*exp(I*(d*x+c))+(-(I *b-a)*(a+I*b))^(1/2))/(-(I*b-a)*(a+I*b))^(1/2))+f/d*ln(-exp(I*(d*x+c))+1)* x*c-1/d*e*c*ln(exp(I*(d*x+c))-1)+1/2*f/d^2*c^2*ln(exp(I*(d*x+c))-1)-I*f/d^ 2*polylog(2,exp(I*(d*x+c)))*c-1/2*I*Pi*csgn(I*(I*b*exp(2*I*(d*x+c))+a*exp( 2*I*(d*x+c))+I*b-a)/(exp(2*I*(d*x+c))-1))*(csgn(I*(I*b*exp(2*I*(d*x+c))+a* exp(2*I*(d*x+c))+I*b-a))*csgn(I/(exp(2*I*(d*x+c))-1))-csgn(I*(I*b*exp(2...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 989 vs. \(2 (194) = 388\).
Time = 0.18 (sec) , antiderivative size = 989, normalized size of antiderivative = 4.26 \[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\text {Too large to display} \] Input:
integrate((f*x+e)*log(a+b*cot(d*x+c)),x, algorithm="fricas")
Output:
-1/8*(2*(-I*d*f*x - I*d*e)*dilog(-(a^2 + b^2 - (a^2 + 2*I*a*b - b^2)*cos(2 *d*x + 2*c) + (-I*a^2 + 2*a*b + I*b^2)*sin(2*d*x + 2*c))/(a^2 + b^2) + 1) + 2*(I*d*f*x + I*d*e)*dilog(-(a^2 + b^2 - (a^2 - 2*I*a*b - b^2)*cos(2*d*x + 2*c) + (I*a^2 + 2*a*b - I*b^2)*sin(2*d*x + 2*c))/(a^2 + b^2) + 1) + 2*(I *d*f*x + I*d*e)*dilog(cos(2*d*x + 2*c) + I*sin(2*d*x + 2*c)) + 2*(-I*d*f*x - I*d*e)*dilog(cos(2*d*x + 2*c) - I*sin(2*d*x + 2*c)) - 2*(2*c*d*e - c^2* f)*log(1/2*a^2 + I*a*b - 1/2*b^2 - 1/2*(a^2 + b^2)*cos(2*d*x + 2*c) + 1/2* (I*a^2 + I*b^2)*sin(2*d*x + 2*c)) - 2*(2*c*d*e - c^2*f)*log(-1/2*a^2 + I*a *b + 1/2*b^2 + 1/2*(a^2 + b^2)*cos(2*d*x + 2*c) + 1/2*(I*a^2 + I*b^2)*sin( 2*d*x + 2*c)) + 2*(d^2*f*x^2 + 2*d^2*e*x + 2*c*d*e - c^2*f)*log((a^2 + b^2 - (a^2 + 2*I*a*b - b^2)*cos(2*d*x + 2*c) + (-I*a^2 + 2*a*b + I*b^2)*sin(2 *d*x + 2*c))/(a^2 + b^2)) + 2*(d^2*f*x^2 + 2*d^2*e*x + 2*c*d*e - c^2*f)*lo g((a^2 + b^2 - (a^2 - 2*I*a*b - b^2)*cos(2*d*x + 2*c) + (I*a^2 + 2*a*b - I *b^2)*sin(2*d*x + 2*c))/(a^2 + b^2)) - 4*(d^2*f*x^2 + 2*d^2*e*x)*log((b*co s(2*d*x + 2*c) + a*sin(2*d*x + 2*c) + b)/sin(2*d*x + 2*c)) + 2*(2*c*d*e - c^2*f)*log(-1/2*cos(2*d*x + 2*c) + 1/2*I*sin(2*d*x + 2*c) + 1/2) + 2*(2*c* d*e - c^2*f)*log(-1/2*cos(2*d*x + 2*c) - 1/2*I*sin(2*d*x + 2*c) + 1/2) - 2 *(d^2*f*x^2 + 2*d^2*e*x + 2*c*d*e - c^2*f)*log(-cos(2*d*x + 2*c) + I*sin(2 *d*x + 2*c) + 1) - 2*(d^2*f*x^2 + 2*d^2*e*x + 2*c*d*e - c^2*f)*log(-cos(2* d*x + 2*c) - I*sin(2*d*x + 2*c) + 1) + f*polylog(3, ((a^2 + 2*I*a*b - b...
\[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\int \left (e + f x\right ) \log {\left (a + b \cot {\left (c + d x \right )} \right )}\, dx \] Input:
integrate((f*x+e)*ln(a+b*cot(d*x+c)),x)
Output:
Integral((e + f*x)*log(a + b*cot(c + d*x)), x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 653 vs. \(2 (194) = 388\).
Time = 0.11 (sec) , antiderivative size = 653, normalized size of antiderivative = 2.81 \[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx =\text {Too large to display} \] Input:
integrate((f*x+e)*log(a+b*cot(d*x+c)),x, algorithm="maxima")
Output:
1/4*(2*(2*(d*x + c)*e + ((d*x + c)^2 - 2*(d*x + c)*c)*f/d)*log(b*cot(d*x + c) + a) + (2*(-I*(d*x + c)^2*f + 2*(-I*d*e + I*c*f)*(d*x + c))*arctan2(-( 2*a*b*cos(2*d*x + 2*c) + (a^2 - b^2)*sin(2*d*x + 2*c))/(a^2 + b^2), (2*a*b *sin(2*d*x + 2*c) + a^2 + b^2 - (a^2 - b^2)*cos(2*d*x + 2*c))/(a^2 + b^2)) + 2*(I*(d*x + c)^2*f + 2*(I*d*e - I*c*f)*(d*x + c))*arctan2(sin(d*x + c), cos(d*x + c) + 1) + 2*(-I*(d*x + c)^2*f + 2*(-I*d*e + I*c*f)*(d*x + c))*a rctan2(sin(d*x + c), -cos(d*x + c) + 1) + 2*(I*d*e + I*(d*x + c)*f - I*c*f )*dilog((I*a - b)*e^(2*I*d*x + 2*I*c)/(I*a + b)) + 4*(-I*d*e - I*(d*x + c) *f + I*c*f)*dilog(-e^(I*d*x + I*c)) + 4*(-I*d*e - I*(d*x + c)*f + I*c*f)*d ilog(e^(I*d*x + I*c)) + ((d*x + c)^2*f + 2*(d*e - c*f)*(d*x + c))*log(cos( d*x + c)^2 + sin(d*x + c)^2 + 2*cos(d*x + c) + 1) + ((d*x + c)^2*f + 2*(d* e - c*f)*(d*x + c))*log(cos(d*x + c)^2 + sin(d*x + c)^2 - 2*cos(d*x + c) + 1) - ((d*x + c)^2*f + 2*(d*e - c*f)*(d*x + c))*log(((a^2 + b^2)*cos(2*d*x + 2*c)^2 + 4*a*b*sin(2*d*x + 2*c) + (a^2 + b^2)*sin(2*d*x + 2*c)^2 + a^2 + b^2 - 2*(a^2 - b^2)*cos(2*d*x + 2*c))/(a^2 + b^2)) - f*polylog(3, (I*a - b)*e^(2*I*d*x + 2*I*c)/(I*a + b)) + 4*f*polylog(3, -e^(I*d*x + I*c)) + 4* f*polylog(3, e^(I*d*x + I*c)))/d)/d
\[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\int { {\left (f x + e\right )} \log \left (b \cot \left (d x + c\right ) + a\right ) \,d x } \] Input:
integrate((f*x+e)*log(a+b*cot(d*x+c)),x, algorithm="giac")
Output:
integrate((f*x + e)*log(b*cot(d*x + c) + a), x)
Timed out. \[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\int \ln \left (a+b\,\mathrm {cot}\left (c+d\,x\right )\right )\,\left (e+f\,x\right ) \,d x \] Input:
int(log(a + b*cot(c + d*x))*(e + f*x),x)
Output:
int(log(a + b*cot(c + d*x))*(e + f*x), x)
\[ \int (e+f x) \log (a+b \cot (c+d x)) \, dx=\left (\int \mathrm {log}\left (a +b \cot \left (d x +c \right )\right )d x \right ) e +\left (\int \mathrm {log}\left (a +b \cot \left (d x +c \right )\right ) x d x \right ) f \] Input:
int((f*x+e)*log(a+b*cot(d*x+c)),x)
Output:
int(log(cot(c + d*x)*b + a),x)*e + int(log(cot(c + d*x)*b + a)*x,x)*f