Integrand size = 21, antiderivative size = 69 \[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\frac {\cos (x)}{2 \sqrt {\sin (2 x)}}+\frac {\cos (x) \cot (x)}{3 \sqrt {\sin (2 x)}}-\frac {5 \text {arctanh}\left (\frac {\sqrt {\tan (x)}}{\sqrt {2}}\right ) \sin (x)}{2 \sqrt {2} \sqrt {\sin (2 x)} \sqrt {\tan (x)}} \]
1/2*cos(x)/sin(2*x)^(1/2)+1/3*cos(x)*cot(x)/sin(2*x)^(1/2)-5/4*arctanh(1/2 *tan(x)^(1/2)*2^(1/2))*sin(x)*2^(1/2)/sin(2*x)^(1/2)/tan(x)^(1/2)
Time = 1.81 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.16 \[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\frac {1}{4} \sqrt {\sin (2 x)} \left (\left (1+\frac {2 \cot (x)}{3}\right ) \csc (x)-\frac {5 \arctan \left (\frac {\sqrt {\tan \left (\frac {x}{2}\right )}}{\sqrt {-1+\tan ^2\left (\frac {x}{2}\right )}}\right ) \sqrt {-\frac {\cos (x)}{2+2 \cos (x)}} \sec (x)}{\sqrt {\tan \left (\frac {x}{2}\right )}}\right ) \]
(Sqrt[Sin[2*x]]*((1 + (2*Cot[x])/3)*Csc[x] - (5*ArcTan[Sqrt[Tan[x/2]]/Sqrt [-1 + Tan[x/2]^2]]*Sqrt[-(Cos[x]/(2 + 2*Cos[x]))]*Sec[x])/Sqrt[Tan[x/2]])) /4
Time = 0.57 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.80, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4890, 25, 4889, 518, 1585, 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) \sec (x)}{\sqrt {\sin (2 x)} (\tan (x)-2)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (x)}{\sin (x)^2 \sqrt {\sin (2 x)} (\tan (x)-2)}dx\) |
\(\Big \downarrow \) 4890 |
\(\displaystyle \frac {\sin (x) \int -\frac {\csc (x) \sec (x) \sqrt {\tan (x)}}{\sin (x)^2 (2-\tan (x))}dx}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\sin (x) \int \frac {\csc (x) \sec (x) \sqrt {\tan (x)}}{\sin (x)^2 (2-\tan (x))}dx}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle -\frac {\sin (x) \int \frac {\tan ^2(x)+1}{(2-\tan (x)) \tan ^{\frac {5}{2}}(x)}d\tan (x)}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
\(\Big \downarrow \) 518 |
\(\displaystyle -\frac {2 \sin (x) \int \frac {\cot ^4(x) \left (\tan ^2(x)+1\right )}{2-\tan (x)}d\sqrt {\tan (x)}}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
\(\Big \downarrow \) 1585 |
\(\displaystyle -\frac {2 \sin (x) \int \left (\frac {\cot ^4(x)}{2}+\frac {\cot ^2(x)}{4}-\frac {5}{4 (\tan (x)-2)}\right )d\sqrt {\tan (x)}}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 \sin (x) \left (\frac {5 \text {arctanh}\left (\frac {\sqrt {\tan (x)}}{\sqrt {2}}\right )}{4 \sqrt {2}}-\frac {1}{6} \cot ^3(x)-\frac {\cot (x)}{4}\right )}{\sqrt {\sin (2 x)} \sqrt {\tan (x)}}\) |
(-2*((5*ArcTanh[Sqrt[Tan[x]]/Sqrt[2]])/(4*Sqrt[2]) - Cot[x]/4 - Cot[x]^3/6 )*Sin[x])/(Sqrt[Sin[2*x]]*Sqrt[Tan[x]])
3.7.34.3.1 Defintions of rubi rules used
Int[((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[2/e^(n + 2*p + 1) Subst[Int[x^(2*m + 1)*(e*c + d*x^2)^ n*(a*e^2 + b*x^4)^p, x], x, Sqrt[e*x]], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && ILtQ[n, 0] && IntegerQ[m + 1/2]
Int[((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (c_.)*(x_)^4)^(p _.), x_Symbol] :> Int[ExpandIntegrand[(f*x)^m*(d + e*x^2)^q*(a + c*x^4)^p, x], x] /; FreeQ[{a, c, d, e, f, m, q}, x] && IGtQ[p, 0] && IGtQ[q, -2]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Int[(u_)*((c_.)*sin[v_])^(m_), x_Symbol] :> With[{w = FunctionOfTrig[u*(Sin [v/2]^(2*m)/(c*Tan[v/2])^m), x]}, Simp[(c*Sin[v])^m*((c*Tan[v/2])^m/Sin[v/2 ]^(2*m)) Int[u*(Sin[v/2]^(2*m)/(c*Tan[v/2])^m), x], x] /; !FalseQ[w] && FunctionOfQ[NonfreeFactors[Tan[w], x], u*(Sin[v/2]^(2*m)/(c*Tan[v/2])^m), x ]] /; FreeQ[c, x] && LinearQ[v, x] && IntegerQ[m + 1/2] && !SumQ[u] && Inv erseFunctionFreeQ[u, x]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 1.62 (sec) , antiderivative size = 396, normalized size of antiderivative = 5.74
method | result | size |
default | \(-\frac {\sqrt {-\frac {\tan \left (\frac {x}{2}\right )}{\tan \left (\frac {x}{2}\right )^{2}-1}}\, \left (-140 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \operatorname {EllipticF}\left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right ) \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \tan \left (\frac {x}{2}\right )+240 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \operatorname {EllipticE}\left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right ) \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \tan \left (\frac {x}{2}\right )+\sqrt {2}\, \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}\, \sqrt {\tan \left (\frac {x}{2}\right )^{3}-\tan \left (\frac {x}{2}\right )}\, \left (\munderset {\underline {\hspace {1.25 ex}}\alpha =\operatorname {RootOf}\left (\textit {\_Z}^{4}+\textit {\_Z}^{3}+2 \textit {\_Z}^{2}-\textit {\_Z} +1\right )}{\sum }\frac {\left (14 \underline {\hspace {1.25 ex}}\alpha ^{3}+3 \underline {\hspace {1.25 ex}}\alpha ^{2}+14 \underline {\hspace {1.25 ex}}\alpha -11\right ) \left (\underline {\hspace {1.25 ex}}\alpha ^{3}+2 \underline {\hspace {1.25 ex}}\alpha -3\right ) \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {1-\tan \left (\frac {x}{2}\right )}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \operatorname {EllipticPi}\left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, -\frac {1}{4} \underline {\hspace {1.25 ex}}\alpha ^{3}-\frac {1}{2} \underline {\hspace {1.25 ex}}\alpha +\frac {3}{4}, \frac {\sqrt {2}}{2}\right )}{\sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}}\right ) \tan \left (\frac {x}{2}\right )+40 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}\, \tan \left (\frac {x}{2}\right )^{4}+120 \tan \left (\frac {x}{2}\right )^{3} \sqrt {\tan \left (\frac {x}{2}\right )^{3}-\tan \left (\frac {x}{2}\right )}-120 \sqrt {\tan \left (\frac {x}{2}\right )^{3}-\tan \left (\frac {x}{2}\right )}\, \tan \left (\frac {x}{2}\right )-40 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )}\right )}{480 \tan \left (\frac {x}{2}\right )^{2} \sqrt {\tan \left (\frac {x}{2}\right )^{3}-\tan \left (\frac {x}{2}\right )}}\) | \(396\) |
-1/480*(-tan(1/2*x)/(tan(1/2*x)^2-1))^(1/2)/tan(1/2*x)^2*(-140*(tan(1/2*x) *(tan(1/2*x)^2-1))^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*EllipticF((tan(1/2*x)+1)^ (1/2),1/2*2^(1/2))*(tan(1/2*x)+1)^(1/2)*(-tan(1/2*x))^(1/2)*tan(1/2*x)+240 *(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*EllipticE((ta n(1/2*x)+1)^(1/2),1/2*2^(1/2))*(tan(1/2*x)+1)^(1/2)*(-tan(1/2*x))^(1/2)*ta n(1/2*x)+2^(1/2)*(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/2)*(tan(1/2*x)^3-tan(1/2 *x))^(1/2)*sum((14*_alpha^3+3*_alpha^2+14*_alpha-11)*(_alpha^3+2*_alpha-3) *(tan(1/2*x)+1)^(1/2)*(1-tan(1/2*x))^(1/2)*(-tan(1/2*x))^(1/2)/(tan(1/2*x) *(tan(1/2*x)^2-1))^(1/2)*EllipticPi((tan(1/2*x)+1)^(1/2),-1/4*_alpha^3-1/2 *_alpha+3/4,1/2*2^(1/2)),_alpha=RootOf(_Z^4+_Z^3+2*_Z^2-_Z+1))*tan(1/2*x)+ 40*(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/2)*tan(1/2*x)^4+120*tan(1/2*x)^3*(tan( 1/2*x)^3-tan(1/2*x))^(1/2)-120*(tan(1/2*x)^3-tan(1/2*x))^(1/2)*tan(1/2*x)- 40*(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/2))/(tan(1/2*x)^3-tan(1/2*x))^(1/2)
Leaf count of result is larger than twice the leaf count of optimal. 120 vs. \(2 (50) = 100\).
Time = 0.26 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.74 \[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=-\frac {4 \, \sqrt {2} \sqrt {\cos \left (x\right ) \sin \left (x\right )} {\left (2 \, \cos \left (x\right ) + 3 \, \sin \left (x\right )\right )} - 4 \, \cos \left (x\right )^{2} - 15 \, {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \sqrt {2} \sqrt {\cos \left (x\right ) \sin \left (x\right )} {\left (4 \, \cos \left (x\right ) + 3 \, \sin \left (x\right )\right )} + \frac {1}{2} \, \cos \left (x\right )^{2} + \frac {7}{2} \, \cos \left (x\right ) \sin \left (x\right ) + \frac {1}{2}\right ) + 15 \, {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right )^{2} + \frac {1}{2} \, \sqrt {2} \sqrt {\cos \left (x\right ) \sin \left (x\right )} \sin \left (x\right ) - \frac {1}{2} \, \cos \left (x\right ) \sin \left (x\right ) + \frac {1}{2}\right ) + 4}{48 \, {\left (\cos \left (x\right )^{2} - 1\right )}} \]
-1/48*(4*sqrt(2)*sqrt(cos(x)*sin(x))*(2*cos(x) + 3*sin(x)) - 4*cos(x)^2 - 15*(cos(x)^2 - 1)*log(-1/2*sqrt(2)*sqrt(cos(x)*sin(x))*(4*cos(x) + 3*sin(x )) + 1/2*cos(x)^2 + 7/2*cos(x)*sin(x) + 1/2) + 15*(cos(x)^2 - 1)*log(1/2*c os(x)^2 + 1/2*sqrt(2)*sqrt(cos(x)*sin(x))*sin(x) - 1/2*cos(x)*sin(x) + 1/2 ) + 4)/(cos(x)^2 - 1)
\[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\int \frac {\csc ^{2}{\left (x \right )} \sec {\left (x \right )}}{\left (\tan {\left (x \right )} - 2\right ) \sqrt {\sin {\left (2 x \right )}}}\, dx \]
Exception generated. \[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\text {Exception raised: RuntimeError} \]
\[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\int { \frac {\csc \left (x\right )^{2} \sec \left (x\right )}{{\left (\tan \left (x\right ) - 2\right )} \sqrt {\sin \left (2 \, x\right )}} \,d x } \]
Timed out. \[ \int \frac {\csc ^2(x) \sec (x)}{\sqrt {\sin (2 x)} (-2+\tan (x))} \, dx=\int \frac {1}{\sqrt {\sin \left (2\,x\right )}\,\cos \left (x\right )\,{\sin \left (x\right )}^2\,\left (\mathrm {tan}\left (x\right )-2\right )} \,d x \]