Integrand size = 7, antiderivative size = 28 \[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\arctan (\cos (x)+\sin (x))-\frac {\text {arctanh}\left (\frac {\cos (x)-\sin (x)}{\sqrt {3}}\right )}{\sqrt {3}} \]
[Out]
\[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\int \frac {1}{\sec (x)+\sin (x)} \, dx \]
[In]
[Out]
Rubi steps \begin{align*} \text {integral}& = \int \frac {1}{\sec (x)+\sin (x)} \, dx \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(93\) vs. \(2(28)=56\).
Time = 1.25 (sec) , antiderivative size = 93, normalized size of antiderivative = 3.32 \[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\arctan \left (1-\left (-1+\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )\right )+\arctan \left (1+\left (1+\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )\right )+\frac {-\log \left (\sec ^2\left (\frac {x}{2}\right ) \left (\sqrt {3}+\cos (x)-\sin (x)\right )\right )+\log \left (-\sec ^2\left (\frac {x}{2}\right ) \left (\sqrt {3}-\cos (x)+\sin (x)\right )\right )}{2 \sqrt {3}} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.21 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.04
method | result | size |
default | \(\munderset {\textit {\_R} =\operatorname {RootOf}\left (\textit {\_Z}^{4}-2 \textit {\_Z}^{3}+2 \textit {\_Z}^{2}+2 \textit {\_Z} +1\right )}{\sum }\frac {\left (-\textit {\_R}^{2}+1\right ) \ln \left (\tan \left (\frac {x}{2}\right )-\textit {\_R} \right )}{2 \textit {\_R}^{3}-3 \textit {\_R}^{2}+2 \textit {\_R} +1}\) | \(57\) |
risch | \(-\frac {i \ln \left ({\mathrm e}^{i x}+\frac {1}{2}-\frac {i}{2}+\frac {i \sqrt {3}}{2}-\frac {\sqrt {3}}{2}\right )}{2}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {1}{2}-\frac {i}{2}+\frac {i \sqrt {3}}{2}-\frac {\sqrt {3}}{2}\right ) \sqrt {3}}{6}-\frac {i \ln \left ({\mathrm e}^{i x}+\frac {1}{2}-\frac {i}{2}-\frac {i \sqrt {3}}{2}+\frac {\sqrt {3}}{2}\right )}{2}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {1}{2}-\frac {i}{2}-\frac {i \sqrt {3}}{2}+\frac {\sqrt {3}}{2}\right ) \sqrt {3}}{6}+\frac {i \ln \left ({\mathrm e}^{i x}-\frac {1}{2}+\frac {i}{2}+\frac {i \sqrt {3}}{2}-\frac {\sqrt {3}}{2}\right )}{2}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {1}{2}+\frac {i}{2}+\frac {i \sqrt {3}}{2}-\frac {\sqrt {3}}{2}\right ) \sqrt {3}}{6}+\frac {i \ln \left ({\mathrm e}^{i x}-\frac {1}{2}+\frac {i}{2}-\frac {i \sqrt {3}}{2}+\frac {\sqrt {3}}{2}\right )}{2}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {1}{2}+\frac {i}{2}-\frac {i \sqrt {3}}{2}+\frac {\sqrt {3}}{2}\right ) \sqrt {3}}{6}\) | \(202\) |
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.29 (sec) , antiderivative size = 165, normalized size of antiderivative = 5.89 \[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=-\frac {1}{12} \, \sqrt {3} \sqrt {2 i \, \sqrt {3} - 2} \log \left (-\frac {1}{2} \, {\left ({\left (\sqrt {3} - i\right )} \sin \left (x\right ) + 2 i \, \cos \left (x\right )\right )} \sqrt {2 i \, \sqrt {3} - 2} + 2\right ) + \frac {1}{12} \, \sqrt {3} \sqrt {2 i \, \sqrt {3} - 2} \log \left (-\frac {1}{2} \, {\left ({\left (\sqrt {3} - i\right )} \sin \left (x\right ) + 2 i \, \cos \left (x\right )\right )} \sqrt {2 i \, \sqrt {3} - 2} - 2\right ) + \frac {1}{12} \, \sqrt {3} \sqrt {-2 i \, \sqrt {3} - 2} \log \left (\frac {1}{2} \, {\left ({\left (\sqrt {3} + i\right )} \sin \left (x\right ) - 2 i \, \cos \left (x\right )\right )} \sqrt {-2 i \, \sqrt {3} - 2} + 2\right ) - \frac {1}{12} \, \sqrt {3} \sqrt {-2 i \, \sqrt {3} - 2} \log \left (\frac {1}{2} \, {\left ({\left (\sqrt {3} + i\right )} \sin \left (x\right ) - 2 i \, \cos \left (x\right )\right )} \sqrt {-2 i \, \sqrt {3} - 2} - 2\right ) \]
[In]
[Out]
\[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\int \frac {1}{\sin {\left (x \right )} + \sec {\left (x \right )}}\, dx \]
[In]
[Out]
\[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\int { \frac {1}{\sec \left (x\right ) + \sin \left (x\right )} \,d x } \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (25) = 50\).
Time = 0.29 (sec) , antiderivative size = 81, normalized size of antiderivative = 2.89 \[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=\frac {1}{2} \, \pi + \frac {1}{6} \, \sqrt {3} \log \left ({\left (\sqrt {3} + \tan \left (\frac {1}{2} \, x\right ) - 1\right )}^{2} + \tan \left (\frac {1}{2} \, x\right )^{2}\right ) - \frac {1}{6} \, \sqrt {3} \log \left ({\left (\sqrt {3} - \tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{2} + \tan \left (\frac {1}{2} \, x\right )^{2}\right ) + \arctan \left ({\left (\sqrt {3} + 1\right )} \tan \left (\frac {1}{2} \, x\right ) + 1\right ) + \arctan \left (-{\left (\sqrt {3} - 1\right )} \tan \left (\frac {1}{2} \, x\right ) + 1\right ) \]
[In]
[Out]
Time = 16.06 (sec) , antiderivative size = 233, normalized size of antiderivative = 8.32 \[ \int \frac {1}{\sec (x)+\sin (x)} \, dx=-\mathrm {atan}\left (\frac {96\,\mathrm {tan}\left (\frac {x}{2}\right )}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64-\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}+\frac {\sqrt {3}\,32{}\mathrm {i}}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64-\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}+\frac {32}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64-\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}+\frac {\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,32{}\mathrm {i}}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64-\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}\right )\,\left (-1+\frac {\sqrt {3}\,1{}\mathrm {i}}{3}\right )-\mathrm {atan}\left (-\frac {96\,\mathrm {tan}\left (\frac {x}{2}\right )}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64+\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}+\frac {\sqrt {3}\,32{}\mathrm {i}}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64+\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}-\frac {32}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64+\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}+\frac {\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,32{}\mathrm {i}}{64\,\mathrm {tan}\left (\frac {x}{2}\right )+64+\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )\,64{}\mathrm {i}}\right )\,\left (1+\frac {\sqrt {3}\,1{}\mathrm {i}}{3}\right ) \]
[In]
[Out]