Integrand size = 16, antiderivative size = 32 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\frac {\cos (a+c) \csc (c-b x)}{b}+\frac {\text {arctanh}(\cos (c-b x)) \sin (a+c)}{b} \] Output:
-cos(a+c)*csc(b*x-c)/b+arctanh(cos(b*x-c))*sin(a+c)/b
Result contains complex when optimal does not.
Time = 0.08 (sec) , antiderivative size = 158, normalized size of antiderivative = 4.94 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\frac {\cos (a+c) \csc (c-b x)}{b}+\frac {2 i \arctan \left (\frac {\cos \left (\frac {b x}{2}\right )+\cos ^2(c) \cos \left (\frac {b x}{2}\right )+2 i \cos (c) \cos \left (\frac {b x}{2}\right ) \sin (c)-\cos \left (\frac {b x}{2}\right ) \sin ^2(c)+i \sin \left (\frac {b x}{2}\right )-i \cos ^2(c) \sin \left (\frac {b x}{2}\right )+2 \cos (c) \sin (c) \sin \left (\frac {b x}{2}\right )+i \sin ^2(c) \sin \left (\frac {b x}{2}\right )}{2 i \cos (c) \cos \left (\frac {b x}{2}\right )-2 \cos \left (\frac {b x}{2}\right ) \sin (c)}\right ) \sin (a+c)}{b} \] Input:
Integrate[Cos[a + b*x]*Csc[c - b*x]^2,x]
Output:
(Cos[a + c]*Csc[c - b*x])/b + ((2*I)*ArcTan[(Cos[(b*x)/2] + Cos[c]^2*Cos[( b*x)/2] + (2*I)*Cos[c]*Cos[(b*x)/2]*Sin[c] - Cos[(b*x)/2]*Sin[c]^2 + I*Sin [(b*x)/2] - I*Cos[c]^2*Sin[(b*x)/2] + 2*Cos[c]*Sin[c]*Sin[(b*x)/2] + I*Sin [c]^2*Sin[(b*x)/2])/((2*I)*Cos[c]*Cos[(b*x)/2] - 2*Cos[(b*x)/2]*Sin[c])]*S in[a + c])/b
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 \cos (a+b x) \csc ^2(c-b x) \, dx\) |
\(\Big \downarrow \) 7299 |
\(\displaystyle \int \cos (a+b x) \csc ^2(c-b x)dx\) |
Input:
Int[Cos[a + b*x]*Csc[c - b*x]^2,x]
Output:
$Aborted
Result contains complex when optimal does not.
Time = 1.41 (sec) , antiderivative size = 108, normalized size of antiderivative = 3.38
method | result | size |
risch | \(\frac {i \left ({\mathrm e}^{i \left (b x +3 a +2 c \right )}+{\mathrm e}^{i \left (b x +a \right )}\right )}{b \left ({\mathrm e}^{2 i \left (a +c \right )}-{\mathrm e}^{2 i \left (b x +a \right )}\right )}+\frac {\ln \left ({\mathrm e}^{i \left (a +c \right )}+{\mathrm e}^{i \left (b x +a \right )}\right ) \sin \left (a +c \right )}{b}-\frac {\ln \left (-{\mathrm e}^{i \left (a +c \right )}+{\mathrm e}^{i \left (b x +a \right )}\right ) \sin \left (a +c \right )}{b}\) | \(108\) |
default | \(\frac {-\frac {2 \left (-\frac {\left (\sin \left (a \right )^{2} \sin \left (c \right )^{2}-2 \cos \left (a \right ) \cos \left (c \right ) \sin \left (a \right ) \sin \left (c \right )+\cos \left (a \right )^{2} \cos \left (c \right )^{2}\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )}{2 \left (\cos \left (a \right )^{2} \cos \left (c \right )^{2}+\sin \left (c \right )^{2} \cos \left (a \right )^{2}+\cos \left (c \right )^{2} \sin \left (a \right )^{2}+\sin \left (a \right )^{2} \sin \left (c \right )^{2}\right ) \left (\sin \left (a \right ) \cos \left (c \right )+\cos \left (a \right ) \sin \left (c \right )\right )}+\frac {\cos \left (a \right ) \cos \left (c \right )-\sin \left (a \right ) \sin \left (c \right )}{2 \cos \left (a \right )^{2} \cos \left (c \right )^{2}+2 \cos \left (c \right )^{2} \sin \left (a \right )^{2}+2 \sin \left (c \right )^{2} \cos \left (a \right )^{2}+2 \sin \left (a \right )^{2} \sin \left (c \right )^{2}}\right )}{\frac {\cos \left (c \right ) \sin \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )^{2}}{2}+\frac {\sin \left (c \right ) \cos \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )^{2}}{2}+\tan \left (\frac {a}{2}+\frac {b x}{2}\right ) \cos \left (a \right ) \cos \left (c \right )-\tan \left (\frac {a}{2}+\frac {b x}{2}\right ) \sin \left (a \right ) \sin \left (c \right )-\frac {\sin \left (a \right ) \cos \left (c \right )}{2}-\frac {\cos \left (a \right ) \sin \left (c \right )}{2}}-\frac {4 \left (\sin \left (a \right ) \cos \left (c \right )+\cos \left (a \right ) \sin \left (c \right )\right ) \arctan \left (\frac {2 \left (\sin \left (a \right ) \cos \left (c \right )+\cos \left (a \right ) \sin \left (c \right )\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )-2 \sin \left (a \right ) \sin \left (c \right )+2 \cos \left (a \right ) \cos \left (c \right )}{2 \sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}\right )}{\left (2 \cos \left (a \right )^{2} \cos \left (c \right )^{2}+2 \cos \left (c \right )^{2} \sin \left (a \right )^{2}+2 \sin \left (c \right )^{2} \cos \left (a \right )^{2}+2 \sin \left (a \right )^{2} \sin \left (c \right )^{2}\right ) \sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}}{b}\) | \(412\) |
Input:
int(cos(b*x+a)*csc(b*x-c)^2,x,method=_RETURNVERBOSE)
Output:
I/b/(exp(2*I*(a+c))-exp(2*I*(b*x+a)))*(exp(I*(b*x+3*a+2*c))+exp(I*(b*x+a)) )+ln(exp(I*(a+c))+exp(I*(b*x+a)))/b*sin(a+c)-ln(-exp(I*(a+c))+exp(I*(b*x+a )))/b*sin(a+c)
Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (35) = 70\).
Time = 0.09 (sec) , antiderivative size = 171, normalized size of antiderivative = 5.34 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\frac {{\left (\cos \left (a + c\right ) \sin \left (b x + a\right ) \sin \left (a + c\right ) + {\left (\cos \left (a + c\right )^{2} - 1\right )} \cos \left (b x + a\right )\right )} \log \left (\frac {\cos \left (b x + a\right ) \cos \left (a + c\right ) + \sin \left (b x + a\right ) \sin \left (a + c\right ) + 1}{\cos \left (a + c\right ) + 1}\right ) - {\left (\cos \left (a + c\right ) \sin \left (b x + a\right ) \sin \left (a + c\right ) + {\left (\cos \left (a + c\right )^{2} - 1\right )} \cos \left (b x + a\right )\right )} \log \left (-\frac {\cos \left (b x + a\right ) \cos \left (a + c\right ) + \sin \left (b x + a\right ) \sin \left (a + c\right ) - 1}{\cos \left (a + c\right ) + 1}\right ) - 2 \, \cos \left (a + c\right )}{2 \, {\left (b \cos \left (a + c\right ) \sin \left (b x + a\right ) - b \cos \left (b x + a\right ) \sin \left (a + c\right )\right )}} \] Input:
integrate(cos(b*x+a)*csc(b*x-c)^2,x, algorithm="fricas")
Output:
1/2*((cos(a + c)*sin(b*x + a)*sin(a + c) + (cos(a + c)^2 - 1)*cos(b*x + a) )*log((cos(b*x + a)*cos(a + c) + sin(b*x + a)*sin(a + c) + 1)/(cos(a + c) + 1)) - (cos(a + c)*sin(b*x + a)*sin(a + c) + (cos(a + c)^2 - 1)*cos(b*x + a))*log(-(cos(b*x + a)*cos(a + c) + sin(b*x + a)*sin(a + c) - 1)/(cos(a + c) + 1)) - 2*cos(a + c))/(b*cos(a + c)*sin(b*x + a) - b*cos(b*x + a)*sin( a + c))
Leaf count of result is larger than twice the leaf count of optimal. 1572 vs. \(2 (27) = 54\).
Time = 59.68 (sec) , antiderivative size = 3264, normalized size of antiderivative = 102.00 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\text {Too large to display} \] Input:
integrate(cos(b*x+a)*csc(b*x-c)**2,x)
Output:
-Piecewise((0, Eq(b, 0) & Eq(c, 0)), (log(tan(b*x/2))/b, Eq(c, 0)), (0, Eq (b, 0)), (log(-tan(c/2) + tan(b*x/2))*tan(c/2)**4*tan(b*x/2)/(-b*tan(c/2)* *4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*tan(c/2)**3 + b*tan(c/2)*t an(b*x/2)**2 - b*tan(c/2) + b*tan(b*x/2)) - log(-tan(c/2) + tan(b*x/2))*ta n(c/2)**3*tan(b*x/2)**2/(-b*tan(c/2)**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x /2)**2 - b*tan(c/2)**3 + b*tan(c/2)*tan(b*x/2)**2 - b*tan(c/2) + b*tan(b*x /2)) + log(-tan(c/2) + tan(b*x/2))*tan(c/2)**3/(-b*tan(c/2)**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*tan(c/2)**3 + b*tan(c/2)*tan(b*x/2)**2 - b*tan(c/2) + b*tan(b*x/2)) - 2*log(-tan(c/2) + tan(b*x/2))*tan(c/2)**2*ta n(b*x/2)/(-b*tan(c/2)**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*tan( c/2)**3 + b*tan(c/2)*tan(b*x/2)**2 - b*tan(c/2) + b*tan(b*x/2)) + log(-tan (c/2) + tan(b*x/2))*tan(c/2)*tan(b*x/2)**2/(-b*tan(c/2)**4*tan(b*x/2) + b* tan(c/2)**3*tan(b*x/2)**2 - b*tan(c/2)**3 + b*tan(c/2)*tan(b*x/2)**2 - b*t an(c/2) + b*tan(b*x/2)) - log(-tan(c/2) + tan(b*x/2))*tan(c/2)/(-b*tan(c/2 )**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*tan(c/2)**3 + b*tan(c/2) *tan(b*x/2)**2 - b*tan(c/2) + b*tan(b*x/2)) + log(-tan(c/2) + tan(b*x/2))* tan(b*x/2)/(-b*tan(c/2)**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*ta n(c/2)**3 + b*tan(c/2)*tan(b*x/2)**2 - b*tan(c/2) + b*tan(b*x/2)) - log(ta n(b*x/2) + 1/tan(c/2))*tan(c/2)**4*tan(b*x/2)/(-b*tan(c/2)**4*tan(b*x/2) + b*tan(c/2)**3*tan(b*x/2)**2 - b*tan(c/2)**3 + b*tan(c/2)*tan(b*x/2)**2...
Leaf count of result is larger than twice the leaf count of optimal. 457 vs. \(2 (35) = 70\).
Time = 0.06 (sec) , antiderivative size = 457, normalized size of antiderivative = 14.28 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx =\text {Too large to display} \] Input:
integrate(cos(b*x+a)*csc(b*x-c)^2,x, algorithm="maxima")
Output:
1/2*(2*(sin(b*x + 2*a + 2*c) + sin(b*x))*cos(2*b*x + a) + (cos(2*b*x + a)^ 2*sin(a + c) - 2*cos(2*b*x + a)*cos(a + 2*c)*sin(a + c) + cos(a + 2*c)^2*s in(a + c) + sin(2*b*x + a)^2*sin(a + c) - 2*sin(2*b*x + a)*sin(a + 2*c)*si n(a + c) + sin(a + 2*c)^2*sin(a + c))*log(cos(b*x)^2 + 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(c) + sin(c)^2) - (cos(2*b*x + a)^2 *sin(a + c) - 2*cos(2*b*x + a)*cos(a + 2*c)*sin(a + c) + cos(a + 2*c)^2*si n(a + c) + sin(2*b*x + a)^2*sin(a + c) - 2*sin(2*b*x + a)*sin(a + 2*c)*sin (a + c) + sin(a + 2*c)^2*sin(a + c))*log(cos(b*x)^2 - 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(c) + sin(c)^2) - 2*(cos(b*x + 2*a + 2*c) + cos(b*x))*sin(2*b*x + a) - 2*cos(a + 2*c)*sin(b*x + 2*a + 2*c) - 2 *cos(a + 2*c)*sin(b*x) + 2*cos(b*x + 2*a + 2*c)*sin(a + 2*c) + 2*cos(b*x)* sin(a + 2*c))/(b*cos(2*b*x + a)^2 - 2*b*cos(2*b*x + a)*cos(a + 2*c) + b*co s(a + 2*c)^2 + b*sin(2*b*x + a)^2 - 2*b*sin(2*b*x + a)*sin(a + 2*c) + b*si n(a + 2*c)^2)
Leaf count of result is larger than twice the leaf count of optimal. 982 vs. \(2 (35) = 70\).
Time = 0.19 (sec) , antiderivative size = 982, normalized size of antiderivative = 30.69 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\text {Too large to display} \] Input:
integrate(cos(b*x+a)*csc(b*x-c)^2,x, algorithm="giac")
Output:
1/2*(4*(tan(1/2*a)^3*tan(1/2*c)^2 + tan(1/2*a)^2*tan(1/2*c)^3 - 2*tan(1/2* a)^2*tan(1/2*c) - 2*tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*a) + tan(1/2*c))*log (abs(tan(1/2*b*x + 1/2*a)*tan(1/2*a)*tan(1/2*c) - tan(1/2*b*x + 1/2*a) + t an(1/2*a) + tan(1/2*c)))/(tan(1/2*a)^3*tan(1/2*c)^3 + tan(1/2*a)^3*tan(1/2 *c) - tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*a)^2 + tan(1/2*a)*tan(1/2*c) - tan(1/2*c)^2 - 1) - 4*(tan(1/2*a)^3*tan(1/2*c) + 2*tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*a)^2 - 2*t an(1/2*a)*tan(1/2*c) - tan(1/2*c)^2)*log(abs(tan(1/2*b*x + 1/2*a)*tan(1/2* a) + tan(1/2*b*x + 1/2*a)*tan(1/2*c) - tan(1/2*a)*tan(1/2*c) + 1))/(tan(1/ 2*a)^3*tan(1/2*c)^2 + tan(1/2*a)^2*tan(1/2*c)^3 + tan(1/2*a)^3 + tan(1/2*a )^2*tan(1/2*c) + tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*c)^3 + tan(1/2*a) + tan (1/2*c)) + (tan(1/2*b*x + 1/2*a)*tan(1/2*a)^4*tan(1/2*c)^4 - 2*tan(1/2*b*x + 1/2*a)*tan(1/2*a)^4*tan(1/2*c)^2 - 8*tan(1/2*b*x + 1/2*a)*tan(1/2*a)^3* tan(1/2*c)^3 + 2*tan(1/2*a)^4*tan(1/2*c)^3 - 2*tan(1/2*b*x + 1/2*a)*tan(1/ 2*a)^2*tan(1/2*c)^4 + 2*tan(1/2*a)^3*tan(1/2*c)^4 + tan(1/2*b*x + 1/2*a)*t an(1/2*a)^4 + 8*tan(1/2*b*x + 1/2*a)*tan(1/2*a)^3*tan(1/2*c) - 2*tan(1/2*a )^4*tan(1/2*c) + 20*tan(1/2*b*x + 1/2*a)*tan(1/2*a)^2*tan(1/2*c)^2 - 12*ta n(1/2*a)^3*tan(1/2*c)^2 + 8*tan(1/2*b*x + 1/2*a)*tan(1/2*a)*tan(1/2*c)^3 - 12*tan(1/2*a)^2*tan(1/2*c)^3 + tan(1/2*b*x + 1/2*a)*tan(1/2*c)^4 - 2*tan( 1/2*a)*tan(1/2*c)^4 - 2*tan(1/2*b*x + 1/2*a)*tan(1/2*a)^2 + 2*tan(1/2*a...
Time = 24.68 (sec) , antiderivative size = 252, normalized size of antiderivative = 7.88 \[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=-\frac {\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )-\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )\,1{}\mathrm {i}}{\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}}}\right )\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}-1\right )}{2\,b\,\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}}}+\frac {\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )+\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )\,1{}\mathrm {i}}{\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}}}\right )\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}-1\right )}{2\,b\,\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}}}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}+1\right )\,1{}\mathrm {i}}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}-{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )} \] Input:
int(cos(a + b*x)/sin(c - b*x)^2,x)
Output:
(log(exp(a*1i)*exp(b*x*1i)*(exp(a*2i)*exp(c*2i) - 1) + (exp(a*2i)*exp(c*2i )*(exp(a*2i)*exp(c*2i) - 1)*1i)/(-exp(a*2i)*exp(c*2i))^(1/2))*(exp(a*2i + c*2i) - 1))/(2*b*(-exp(a*2i + c*2i))^(1/2)) - (log(exp(a*1i)*exp(b*x*1i)*( exp(a*2i)*exp(c*2i) - 1) - (exp(a*2i)*exp(c*2i)*(exp(a*2i)*exp(c*2i) - 1)* 1i)/(-exp(a*2i)*exp(c*2i))^(1/2))*(exp(a*2i + c*2i) - 1))/(2*b*(-exp(a*2i + c*2i))^(1/2)) + (exp(a*1i + b*x*1i)*(exp(a*2i + c*2i) + 1)*1i)/(b*(exp(a *2i + c*2i) - exp(a*2i + b*x*2i)))
\[ \int \cos (a+b x) \csc ^2(c-b x) \, dx=\int \cos \left (b x +a \right ) \csc \left (b x -c \right )^{2}d x \] Input:
int(cos(b*x+a)*csc(b*x-c)^2,x)
Output:
int(cos(a + b*x)*csc(b*x - c)**2,x)