Integrand size = 20, antiderivative size = 113 \[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=-\frac {2 d x \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {c \text {arctanh}(\cos (a+b x))}{b}-\frac {d \text {arctanh}(\sin (a+b x))}{b^2}+\frac {i d \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {i d \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}+\frac {c \sec (a+b x)}{b}+\frac {d x \sec (a+b x)}{b} \] Output:
-2*d*x*arctanh(exp(I*(b*x+a)))/b-c*arctanh(cos(b*x+a))/b-d*arctanh(sin(b*x +a))/b^2+I*d*polylog(2,-exp(I*(b*x+a)))/b^2-I*d*polylog(2,exp(I*(b*x+a)))/ b^2+c*sec(b*x+a)/b+d*x*sec(b*x+a)/b
Time = 0.62 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.88 \[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=-\frac {c \log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{b}+\frac {d \log \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b^2}+\frac {c \log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b}-\frac {d \log \left (\cos \left (\frac {1}{2} (a+b x)\right )+\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b^2}-\frac {a d \log \left (\tan \left (\frac {1}{2} (a+b x)\right )\right )}{b^2}+\frac {d \left ((a+b x) \left (\log \left (1-e^{i (a+b x)}\right )-\log \left (1+e^{i (a+b x)}\right )\right )+i \left (\operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )-\operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )\right )\right )}{b^2}+\frac {c \sec (a+b x)}{b}+\frac {d x \sec (a+b x)}{b} \] Input:
Integrate[(c + d*x)*Csc[a + b*x]*Sec[a + b*x]^2,x]
Output:
-((c*Log[Cos[(a + b*x)/2]])/b) + (d*Log[Cos[(a + b*x)/2] - Sin[(a + b*x)/2 ]])/b^2 + (c*Log[Sin[(a + b*x)/2]])/b - (d*Log[Cos[(a + b*x)/2] + Sin[(a + b*x)/2]])/b^2 - (a*d*Log[Tan[(a + b*x)/2]])/b^2 + (d*((a + b*x)*(Log[1 - E^(I*(a + b*x))] - Log[1 + E^(I*(a + b*x))]) + I*(PolyLog[2, -E^(I*(a + b* x))] - PolyLog[2, E^(I*(a + b*x))])))/b^2 + (c*Sec[a + b*x])/b + (d*x*Sec[ a + b*x])/b
Time = 0.33 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.07, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {4920, 2009}
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) \csc (a+b x) \sec ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 4920 |
\(\displaystyle -d \int \left (\frac {\sec (a+b x)}{b}-\frac {\text {arctanh}(\cos (a+b x))}{b}\right )dx-\frac {(c+d x) \text {arctanh}(\cos (a+b x))}{b}+\frac {(c+d x) \sec (a+b x)}{b}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -d \left (\frac {\text {arctanh}(\sin (a+b x))}{b^2}+\frac {2 x \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {x \text {arctanh}(\cos (a+b x))}{b}-\frac {i \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}+\frac {i \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}\right )-\frac {(c+d x) \text {arctanh}(\cos (a+b x))}{b}+\frac {(c+d x) \sec (a+b x)}{b}\) |
Input:
Int[(c + d*x)*Csc[a + b*x]*Sec[a + b*x]^2,x]
Output:
-(((c + d*x)*ArcTanh[Cos[a + b*x]])/b) - d*((2*x*ArcTanh[E^(I*(a + b*x))]) /b - (x*ArcTanh[Cos[a + b*x]])/b + ArcTanh[Sin[a + b*x]]/b^2 - (I*PolyLog[ 2, -E^(I*(a + b*x))])/b^2 + (I*PolyLog[2, E^(I*(a + b*x))])/b^2) + ((c + d *x)*Sec[a + b*x])/b
Int[Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b _.)*(x_)]^(p_.), x_Symbol] :> Module[{u = IntHide[Csc[a + b*x]^n*Sec[a + b* x]^p, x]}, Simp[(c + d*x)^m u, x] - Simp[d*m Int[(c + d*x)^(m - 1)*u, x ], x]] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p] && GtQ[m, 0] && NeQ[n, p]
Time = 0.35 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.42
method | result | size |
risch | \(\frac {2 \,{\mathrm e}^{i \left (b x +a \right )} \left (d x +c \right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}+\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 {d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}+\frac {2 i d \arctan \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {i d \operatorname {dilog}\left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b^{2}}+\frac {i d \operatorname {dilog}\left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}\) | \(160\) |
Input:
int((d*x+c)*csc(b*x+a)*sec(b*x+a)^2,x,method=_RETURNVERBOSE)
Output:
2*exp(I*(b*x+a))*(d*x+c)/b/(exp(2*I*(b*x+a))+1)+1/b*c*ln(exp(I*(b*x+a))-1) -1/b*c*ln(exp(I*(b*x+a))+1)-1/b^2*d*a*ln(exp(I*(b*x+a))-1)+2*I/b^2*d*arcta n(exp(I*(b*x+a)))+I/b^2*d*dilog(exp(I*(b*x+a))+1)+I/b^2*d*dilog(exp(I*(b*x +a)))-1/b*d*ln(exp(I*(b*x+a))+1)*x
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 366 vs. \(2 (101) = 202\).
Time = 0.10 (sec) , antiderivative size = 366, normalized size of antiderivative = 3.24 \[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\frac {2 \, b d x - i \, d \cos \left (b x + a\right ) {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d \cos \left (b x + a\right ) {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - i \, d \cos \left (b x + a\right ) {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d \cos \left (b x + a\right ) {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (b d x + b c\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - {\left (b d x + b c\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b c - a d\right )} \cos \left (b x + a\right ) \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b c - a d\right )} \cos \left (b x + a\right ) \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b d x + a d\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x + a d\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) - d \cos \left (b x + a\right ) \log \left (\sin \left (b x + a\right ) + 1\right ) + d \cos \left (b x + a\right ) \log \left (-\sin \left (b x + a\right ) + 1\right ) + 2 \, b c}{2 \, b^{2} \cos \left (b x + a\right )} \] Input:
integrate((d*x+c)*csc(b*x+a)*sec(b*x+a)^2,x, algorithm="fricas")
Output:
1/2*(2*b*d*x - I*d*cos(b*x + a)*dilog(cos(b*x + a) + I*sin(b*x + a)) + I*d *cos(b*x + a)*dilog(cos(b*x + a) - I*sin(b*x + a)) - I*d*cos(b*x + a)*dilo g(-cos(b*x + a) + I*sin(b*x + a)) + I*d*cos(b*x + a)*dilog(-cos(b*x + a) - I*sin(b*x + a)) - (b*d*x + b*c)*cos(b*x + a)*log(cos(b*x + a) + I*sin(b*x + a) + 1) - (b*d*x + b*c)*cos(b*x + a)*log(cos(b*x + a) - I*sin(b*x + a) + 1) + (b*c - a*d)*cos(b*x + a)*log(-1/2*cos(b*x + a) + 1/2*I*sin(b*x + a) + 1/2) + (b*c - a*d)*cos(b*x + a)*log(-1/2*cos(b*x + a) - 1/2*I*sin(b*x + a) + 1/2) + (b*d*x + a*d)*cos(b*x + a)*log(-cos(b*x + a) + I*sin(b*x + a) + 1) + (b*d*x + a*d)*cos(b*x + a)*log(-cos(b*x + a) - I*sin(b*x + a) + 1) - d*cos(b*x + a)*log(sin(b*x + a) + 1) + d*cos(b*x + a)*log(-sin(b*x + a) + 1) + 2*b*c)/(b^2*cos(b*x + a))
\[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\int \left (c + d x\right ) \csc {\left (a + b x \right )} \sec ^{2}{\left (a + b x \right )}\, dx \] Input:
integrate((d*x+c)*csc(b*x+a)*sec(b*x+a)**2,x)
Output:
Integral((c + d*x)*csc(a + b*x)*sec(a + b*x)**2, x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 800 vs. \(2 (101) = 202\).
Time = 0.53 (sec) , antiderivative size = 800, normalized size of antiderivative = 7.08 \[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\text {Too large to display} \] Input:
integrate((d*x+c)*csc(b*x+a)*sec(b*x+a)^2,x, algorithm="maxima")
Output:
-(2*(d*cos(2*b*x + 2*a) + I*d*sin(2*b*x + 2*a) + d)*arctan2(2*(cos(b*x + 2 *a)*cos(a) + sin(b*x + 2*a)*sin(a))/(cos(b*x + 2*a)^2 + cos(a)^2 + 2*cos(a )*sin(b*x + 2*a) + sin(b*x + 2*a)^2 - 2*cos(b*x + 2*a)*sin(a) + sin(a)^2), (cos(b*x + 2*a)^2 - cos(a)^2 + sin(b*x + 2*a)^2 - sin(a)^2)/(cos(b*x + 2* a)^2 + cos(a)^2 + 2*cos(a)*sin(b*x + 2*a) + sin(b*x + 2*a)^2 - 2*cos(b*x + 2*a)*sin(a) + sin(a)^2)) + 2*(b*d*x + b*c + (b*d*x + b*c)*cos(2*b*x + 2*a ) + (I*b*d*x + I*b*c)*sin(2*b*x + 2*a))*arctan2(sin(b*x + a), cos(b*x + a) + 1) - 2*(b*c*cos(2*b*x + 2*a) + I*b*c*sin(2*b*x + 2*a) + b*c)*arctan2(si n(b*x + a), cos(b*x + a) - 1) + 2*(b*d*x*cos(2*b*x + 2*a) + I*b*d*x*sin(2* b*x + 2*a) + b*d*x)*arctan2(sin(b*x + a), -cos(b*x + a) + 1) + 4*(I*b*d*x + I*b*c)*cos(b*x + a) - 2*(d*cos(2*b*x + 2*a) + I*d*sin(2*b*x + 2*a) + d)* dilog(-e^(I*b*x + I*a)) + 2*(d*cos(2*b*x + 2*a) + I*d*sin(2*b*x + 2*a) + d )*dilog(e^(I*b*x + I*a)) - (I*b*d*x + I*b*c + (I*b*d*x + I*b*c)*cos(2*b*x + 2*a) - (b*d*x + b*c)*sin(2*b*x + 2*a))*log(cos(b*x + a)^2 + sin(b*x + a) ^2 + 2*cos(b*x + a) + 1) - (-I*b*d*x - I*b*c + (-I*b*d*x - I*b*c)*cos(2*b* x + 2*a) + (b*d*x + b*c)*sin(2*b*x + 2*a))*log(cos(b*x + a)^2 + sin(b*x + a)^2 - 2*cos(b*x + a) + 1) - (-I*d*cos(2*b*x + 2*a) + d*sin(2*b*x + 2*a) - I*d)*log((cos(b*x + 2*a)^2 + cos(a)^2 - 2*cos(a)*sin(b*x + 2*a) + sin(b*x + 2*a)^2 + 2*cos(b*x + 2*a)*sin(a) + sin(a)^2)/(cos(b*x + 2*a)^2 + cos(a) ^2 + 2*cos(a)*sin(b*x + 2*a) + sin(b*x + 2*a)^2 - 2*cos(b*x + 2*a)*sin(...
\[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\int { {\left (d x + c\right )} \csc \left (b x + a\right ) \sec \left (b x + a\right )^{2} \,d x } \] Input:
integrate((d*x+c)*csc(b*x+a)*sec(b*x+a)^2,x, algorithm="giac")
Output:
integrate((d*x + c)*csc(b*x + a)*sec(b*x + a)^2, x)
Timed out. \[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\text {Hanged} \] Input:
int((c + d*x)/(cos(a + b*x)^2*sin(a + b*x)),x)
Output:
\text{Hanged}
\[ \int (c+d x) \csc (a+b x) \sec ^2(a+b x) \, dx=\frac {\cos \left (b x +a \right ) \left (\int \csc \left (b x +a \right ) \sec \left (b x +a \right )^{2} x d x \right ) b d +\cos \left (b x +a \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right ) c -\cos \left (b x +a \right ) c +c}{\cos \left (b x +a \right ) b} \] Input:
int((d*x+c)*csc(b*x+a)*sec(b*x+a)^2,x)
Output:
(cos(a + b*x)*int(csc(a + b*x)*sec(a + b*x)**2*x,x)*b*d + cos(a + b*x)*log (tan((a + b*x)/2))*c - cos(a + b*x)*c + c)/(cos(a + b*x)*b)