Integrand size = 33, antiderivative size = 111 \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=2 \arctan \left (\frac {\cos (x)}{\sqrt {-5+\sin ^2(x)}}\right )-\frac {\arctan \left (\frac {\sqrt {5} \cos (x)}{\sqrt {-5+\sin ^2(x)}}\right )}{\sqrt {5}}-\frac {2 \arctan \left (\frac {\sqrt {-5+\sin ^2(x)}}{\sqrt {5}}\right )}{\sqrt {5}}-2 \text {arctanh}\left (\frac {\sin (x)}{\sqrt {-5+\sin ^2(x)}}\right )+2 \sqrt {-5+\sin ^2(x)}+\frac {2}{5} \csc (x) \sqrt {-5+\sin ^2(x)} \]
2*arctan(cos(x)/(-5+sin(x)^2)^(1/2))-2*arctanh(sin(x)/(-5+sin(x)^2)^(1/2)) -1/5*arctan(cos(x)*5^(1/2)/(-5+sin(x)^2)^(1/2))*5^(1/2)-2/5*arctan(1/5*(-5 +sin(x)^2)^(1/2)*5^(1/2))*5^(1/2)+2*(-5+sin(x)^2)^(1/2)+2/5*(-5+sin(x)^2)^ (1/2)/sin(x)
Result contains complex when optimal does not.
Time = 7.00 (sec) , antiderivative size = 295, normalized size of antiderivative = 2.66 \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=\frac {2 \sqrt {2} \left (-2 \cos ^3(x)+\cos (2 x)+2 \cos ^2(x) \cot (x)\right ) \left (18+2 \cos (2 x)+20 \sqrt {2} \text {arctanh}\left (\frac {2 \sqrt {2} \tan \left (\frac {x}{2}\right )}{\sqrt {-\left ((9+\cos (2 x)) \sec ^4\left (\frac {x}{2}\right )\right )}}\right ) \cos ^3\left (\frac {x}{2}\right ) \sqrt {-\left ((9+\cos (2 x)) \sec ^4\left (\frac {x}{2}\right )\right )} \sin \left (\frac {x}{2}\right )+85 \sin (x)+\sqrt {10} \arctan \left (\frac {\sqrt {10} \cos (x)}{\sqrt {-9-\cos (2 x)}}\right ) \sqrt {-9-\cos (2 x)} \sin (x)+2 \sqrt {10} \arctan \left (\frac {\sqrt {-9-\cos (2 x)}}{\sqrt {10}}\right ) \sqrt {-9-\cos (2 x)} \sin (x)+10 i \sqrt {2} \sqrt {-9-\cos (2 x)} \log \left (i \sqrt {2} \cos (x)+\sqrt {-9-\cos (2 x)}\right ) \sin (x)+5 \sin (3 x)\right )}{5 \sqrt {-9-\cos (2 x)} (-6 \cos (x)-2 \cos (3 x)+2 \sin (x)+2 \sin (2 x)-2 \sin (3 x)+\sin (4 x))} \]
(2*Sqrt[2]*(-2*Cos[x]^3 + Cos[2*x] + 2*Cos[x]^2*Cot[x])*(18 + 2*Cos[2*x] + 20*Sqrt[2]*ArcTanh[(2*Sqrt[2]*Tan[x/2])/Sqrt[-((9 + Cos[2*x])*Sec[x/2]^4) ]]*Cos[x/2]^3*Sqrt[-((9 + Cos[2*x])*Sec[x/2]^4)]*Sin[x/2] + 85*Sin[x] + Sq rt[10]*ArcTan[(Sqrt[10]*Cos[x])/Sqrt[-9 - Cos[2*x]]]*Sqrt[-9 - Cos[2*x]]*S in[x] + 2*Sqrt[10]*ArcTan[Sqrt[-9 - Cos[2*x]]/Sqrt[10]]*Sqrt[-9 - Cos[2*x] ]*Sin[x] + (10*I)*Sqrt[2]*Sqrt[-9 - Cos[2*x]]*Log[I*Sqrt[2]*Cos[x] + Sqrt[ -9 - Cos[2*x]]]*Sin[x] + 5*Sin[3*x]))/(5*Sqrt[-9 - Cos[2*x]]*(-6*Cos[x] - 2*Cos[3*x] + 2*Sin[x] + 2*Sin[2*x] - 2*Sin[3*x] + Sin[4*x]))
Time = 0.70 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.07, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3042, 4901, 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 \frac {\csc ^2(x) \left (\sin (x) \cos (2 x)-2 (\sin (x)-1) \cos ^3(x)\right )}{\sqrt {\sin ^2(x)-5}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (x) \cos (2 x)-2 (\sin (x)-1) \cos (x)^3}{\sin (x)^2 \sqrt {\sin (x)^2-5}}dx\) |
\(\Big \downarrow \) 4901 |
\(\displaystyle \int \left (\frac {\left (\cos (2 x)-2 \cos ^3(x)\right ) \csc (x)}{\sqrt {\sin ^2(x)-5}}+\frac {2 \cos (x) \cot ^2(x)}{\sqrt {\sin ^2(x)-5}}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle 2 \arctan \left (\frac {\cos (x)}{\sqrt {-\cos ^2(x)-4}}\right )-\frac {\arctan \left (\frac {\sqrt {5} \cos (x)}{\sqrt {-\cos ^2(x)-4}}\right )}{\sqrt {5}}-\frac {2 \arctan \left (\frac {\sqrt {-\cos ^2(x)-4}}{\sqrt {5}}\right )}{\sqrt {5}}-2 \text {arctanh}\left (\frac {\sin (x)}{\sqrt {\sin ^2(x)-5}}\right )+2 \sqrt {-\cos ^2(x)-4}+\frac {2}{5} \sqrt {\sin ^2(x)-5} \csc (x)\) |
2*ArcTan[Cos[x]/Sqrt[-4 - Cos[x]^2]] - ArcTan[(Sqrt[5]*Cos[x])/Sqrt[-4 - C os[x]^2]]/Sqrt[5] - (2*ArcTan[Sqrt[-4 - Cos[x]^2]/Sqrt[5]])/Sqrt[5] - 2*Ar cTanh[Sin[x]/Sqrt[-5 + Sin[x]^2]] + 2*Sqrt[-4 - Cos[x]^2] + (2*Csc[x]*Sqrt [-5 + Sin[x]^2])/5
3.5.26.3.1 Defintions of rubi rules used
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Time = 1.76 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.18
method | result | size |
default | \(-2 \ln \left (\sin \left (x \right )+\sqrt {-5+\sin ^{2}\left (x \right )}\right )+2 \sqrt {-5+\sin ^{2}\left (x \right )}+\frac {2 \sqrt {-5+\sin ^{2}\left (x \right )}}{5 \sin \left (x \right )}+\frac {2 \sqrt {5}\, \arctan \left (\frac {\sqrt {5}}{\sqrt {-5+\sin ^{2}\left (x \right )}}\right )}{5}-\frac {\sqrt {\left (-5+\sin ^{2}\left (x \right )\right ) \left (\cos ^{2}\left (x \right )\right )}\, \left (-\sqrt {5}\, \arctan \left (\frac {\left (3 \left (\sin ^{2}\left (x \right )\right )-5\right ) \sqrt {5}}{5 \sqrt {-\left (\cos ^{4}\left (x \right )\right )-4 \left (\cos ^{2}\left (x \right )\right )}}\right )-10 \arcsin \left (1+\frac {\left (\cos ^{2}\left (x \right )\right )}{2}\right )\right )}{10 \cos \left (x \right ) \sqrt {-5+\sin ^{2}\left (x \right )}}\) | \(131\) |
parts | \(-2 \ln \left (\sin \left (x \right )+\sqrt {-5+\sin ^{2}\left (x \right )}\right )+2 \sqrt {-5+\sin ^{2}\left (x \right )}+\frac {2 \sqrt {-5+\sin ^{2}\left (x \right )}}{5 \sin \left (x \right )}+\frac {2 \sqrt {5}\, \arctan \left (\frac {\sqrt {5}}{\sqrt {-5+\sin ^{2}\left (x \right )}}\right )}{5}-\frac {\sqrt {\left (-5+\sin ^{2}\left (x \right )\right ) \left (\cos ^{2}\left (x \right )\right )}\, \left (-\sqrt {5}\, \arctan \left (\frac {\left (3 \left (\sin ^{2}\left (x \right )\right )-5\right ) \sqrt {5}}{5 \sqrt {-\left (\cos ^{4}\left (x \right )\right )-4 \left (\cos ^{2}\left (x \right )\right )}}\right )-10 \arcsin \left (1+\frac {\left (\cos ^{2}\left (x \right )\right )}{2}\right )\right )}{10 \cos \left (x \right ) \sqrt {-5+\sin ^{2}\left (x \right )}}\) | \(131\) |
int((-2*cos(x)^3*(sin(x)-1)+sin(x)*cos(2*x))/sin(x)^2/(-5+sin(x)^2)^(1/2), x,method=_RETURNVERBOSE)
-2*ln(sin(x)+(-5+sin(x)^2)^(1/2))+2*(-5+sin(x)^2)^(1/2)+2/5*(-5+sin(x)^2)^ (1/2)/sin(x)+2/5*5^(1/2)*arctan(5^(1/2)/(-5+sin(x)^2)^(1/2))-1/10*((-5+sin (x)^2)*cos(x)^2)^(1/2)*(-5^(1/2)*arctan(1/5*(3*sin(x)^2-5)*5^(1/2)/(-cos(x )^4-4*cos(x)^2)^(1/2))-10*arcsin(1+1/2*cos(x)^2))/cos(x)/(-5+sin(x)^2)^(1/ 2)
Time = 0.88 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.14 \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=-\frac {\sqrt {5} \arctan \left (\frac {\sqrt {5} \sqrt {-\cos \left (x\right )^{2} - 4}}{\cos \left (x\right ) + 4}\right ) \sin \left (x\right ) - 3 \, \sqrt {5} \arctan \left (\frac {\sqrt {5} \sqrt {-\cos \left (x\right )^{2} - 4}}{\cos \left (x\right ) - 4}\right ) \sin \left (x\right ) + 20 \, \arctan \left (\frac {\sqrt {-\cos \left (x\right )^{2} - 4}}{\cos \left (x\right )}\right ) \sin \left (x\right ) - 10 \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sqrt {-\cos \left (x\right )^{2} - 4} \sin \left (x\right ) + 3\right ) \sin \left (x\right ) - 4 \, \sqrt {-\cos \left (x\right )^{2} - 4} {\left (5 \, \sin \left (x\right ) + 1\right )}}{10 \, \sin \left (x\right )} \]
integrate((-2*cos(x)^3*(-1+sin(x))+cos(2*x)*sin(x))/sin(x)^2/(-5+sin(x)^2) ^(1/2),x, algorithm="fricas")
-1/10*(sqrt(5)*arctan(sqrt(5)*sqrt(-cos(x)^2 - 4)/(cos(x) + 4))*sin(x) - 3 *sqrt(5)*arctan(sqrt(5)*sqrt(-cos(x)^2 - 4)/(cos(x) - 4))*sin(x) + 20*arct an(sqrt(-cos(x)^2 - 4)/cos(x))*sin(x) - 10*log(2*cos(x)^2 + 2*sqrt(-cos(x) ^2 - 4)*sin(x) + 3)*sin(x) - 4*sqrt(-cos(x)^2 - 4)*(5*sin(x) + 1))/sin(x)
Timed out. \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=\text {Timed out} \]
Result contains complex when optimal does not.
Time = 0.32 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.04 \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=\frac {2}{5} \, \sqrt {5} \arcsin \left (\frac {\sqrt {5}}{{\left | \sin \left (x\right ) \right |}}\right ) - \frac {1}{10} i \, \sqrt {5} \operatorname {arsinh}\left (\frac {\cos \left (x\right )}{2 \, {\left (\cos \left (x\right ) + 1\right )}} - \frac {2}{\cos \left (x\right ) + 1}\right ) - \frac {1}{10} i \, \sqrt {5} \operatorname {arsinh}\left (-\frac {\cos \left (x\right )}{2 \, {\left (\cos \left (x\right ) - 1\right )}} - \frac {2}{\cos \left (x\right ) - 1}\right ) + 2 \, \sqrt {\sin \left (x\right )^{2} - 5} + \frac {2 \, \sqrt {\sin \left (x\right )^{2} - 5}}{5 \, \sin \left (x\right )} - 2 i \, \operatorname {arsinh}\left (\frac {1}{2} \, \cos \left (x\right )\right ) - 2 \, \log \left (2 \, \sqrt {\sin \left (x\right )^{2} - 5} + 2 \, \sin \left (x\right )\right ) \]
integrate((-2*cos(x)^3*(-1+sin(x))+cos(2*x)*sin(x))/sin(x)^2/(-5+sin(x)^2) ^(1/2),x, algorithm="maxima")
2/5*sqrt(5)*arcsin(sqrt(5)/abs(sin(x))) - 1/10*I*sqrt(5)*arcsinh(1/2*cos(x )/(cos(x) + 1) - 2/(cos(x) + 1)) - 1/10*I*sqrt(5)*arcsinh(-1/2*cos(x)/(cos (x) - 1) - 2/(cos(x) - 1)) + 2*sqrt(sin(x)^2 - 5) + 2/5*sqrt(sin(x)^2 - 5) /sin(x) - 2*I*arcsinh(1/2*cos(x)) - 2*log(2*sqrt(sin(x)^2 - 5) + 2*sin(x))
\[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=\int { -\frac {2 \, {\left (\sin \left (x\right ) - 1\right )} \cos \left (x\right )^{3} - \cos \left (2 \, x\right ) \sin \left (x\right )}{\sqrt {\sin \left (x\right )^{2} - 5} \sin \left (x\right )^{2}} \,d x } \]
integrate((-2*cos(x)^3*(-1+sin(x))+cos(2*x)*sin(x))/sin(x)^2/(-5+sin(x)^2) ^(1/2),x, algorithm="giac")
Timed out. \[ \int \frac {\csc ^2(x) \left (-2 \cos ^3(x) (-1+\sin (x))+\cos (2 x) \sin (x)\right )}{\sqrt {-5+\sin ^2(x)}} \, dx=\int \frac {\cos \left (2\,x\right )\,\sin \left (x\right )-2\,{\cos \left (x\right )}^3\,\left (\sin \left (x\right )-1\right )}{{\sin \left (x\right )}^2\,\sqrt {{\sin \left (x\right )}^2-5}} \,d x \]