Optimal. Leaf size=41 \[ \frac {1}{2} \tan ^{-1}\left (\sqrt {-1+\sec (x)}\right )-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {4420, 5311, 12,
248, 44, 65, 209} \begin {gather*} \frac {1}{2} \text {ArcTan}\left (\sqrt {\sec (x)-1}\right )-\cos (x) \text {ArcTan}\left (\sqrt {\sec (x)-1}\right )+\frac {1}{2} \cos (x) \sqrt {\sec (x)-1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 44
Rule 65
Rule 209
Rule 248
Rule 4420
Rule 5311
Rubi steps
\begin {align*} \int \tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \sin (x) \, dx &=-\text {Subst}\left (\int \tan ^{-1}\left (\sqrt {-1+\frac {1}{x}}\right ) \, dx,x,\cos (x)\right )\\ &=-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\text {Subst}\left (\int -\frac {1}{2 \sqrt {-1+\frac {1}{x}}} \, dx,x,\cos (x)\right )\\ &=-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)-\frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {-1+\frac {1}{x}}} \, dx,x,\cos (x)\right )\\ &=-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {-1+x} x^2} \, dx,x,\sec (x)\right )\\ &=-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)}+\frac {1}{4} \text {Subst}\left (\int \frac {1}{\sqrt {-1+x} x} \, dx,x,\sec (x)\right )\\ &=-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)}+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {-1+\sec (x)}\right )\\ &=\frac {1}{2} \tan ^{-1}\left (\sqrt {-1+\sec (x)}\right )-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 2.92, size = 283, normalized size = 6.90 \begin {gather*} -\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)}-\frac {1}{2} \left (-3-2 \sqrt {2}\right ) \cos ^2\left (\frac {x}{4}\right ) \left (1-\sqrt {2}+\left (-2+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \cot \left (\frac {x}{4}\right ) \left (F\left (\sin ^{-1}\left (\frac {\tan \left (\frac {x}{4}\right )}{\sqrt {3-2 \sqrt {2}}}\right )|17-12 \sqrt {2}\right )-2 \Pi \left (-3+2 \sqrt {2};\sin ^{-1}\left (\frac {\tan \left (\frac {x}{4}\right )}{\sqrt {3-2 \sqrt {2}}}\right )|17-12 \sqrt {2}\right )\right ) \sqrt {\left (7-5 \sqrt {2}+\left (10-7 \sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \sec ^2\left (\frac {x}{4}\right )} \sqrt {\left (-1-\sqrt {2}+\left (2+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \sec ^2\left (\frac {x}{4}\right )} \sqrt {-1+\sec (x)} \sec (x) \sqrt {3-2 \sqrt {2}-\tan ^2\left (\frac {x}{4}\right )} \sqrt {1+\left (-3+2 \sqrt {2}\right ) \tan ^2\left (\frac {x}{4}\right )} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 42, normalized size = 1.02
method | result | size |
derivativedivides | \(-\frac {\arctan \left (\sqrt {-\left (\frac {1}{\sec \left (x \right )}-1\right ) \sec \left (x \right )}\right )}{\sec \left (x \right )}+\frac {\sqrt {-1+\sec \left (x \right )}}{2 \sec \left (x \right )}+\frac {\arctan \left (\sqrt {-1+\sec \left (x \right )}\right )}{2}\) | \(42\) |
default | \(-\frac {\arctan \left (\sqrt {-\left (\frac {1}{\sec \left (x \right )}-1\right ) \sec \left (x \right )}\right )}{\sec \left (x \right )}+\frac {\sqrt {-1+\sec \left (x \right )}}{2 \sec \left (x \right )}+\frac {\arctan \left (\sqrt {-1+\sec \left (x \right )}\right )}{2}\) | \(42\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.59, size = 60, normalized size = 1.46 \begin {gather*} -\arctan \left (\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}\right ) \cos \left (x\right ) - \frac {\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}}{2 \, {\left (\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )} - 1\right )}} + \frac {1}{2} \, \arctan \left (\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.06, size = 32, normalized size = 0.78 \begin {gather*} -\frac {1}{2} \, {\left (2 \, \cos \left (x\right ) - 1\right )} \arctan \left (\sqrt {\sec \left (x\right ) - 1}\right ) + \frac {1}{2} \, \sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}} \cos \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sin {\left (x \right )} \operatorname {atan}{\left (\sqrt {\sec {\left (x \right )} - 1} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.42, size = 60, normalized size = 1.46 \begin {gather*} -\mathrm {atan}\left (\sqrt {\frac {1}{\cos \left (x\right )}-1}\right )\,\cos \left (x\right )-\frac {\cos \left (x\right )\,\left (\frac {3\,\mathrm {asin}\left (\sqrt {\cos \left (x\right )}\right )}{2\,{\cos \left (x\right )}^{3/2}}-\frac {3\,\sqrt {1-\cos \left (x\right )}}{2\,\cos \left (x\right )}\right )\,\sqrt {1-\cos \left (x\right )}}{3\,\sqrt {\frac {1}{\cos \left (x\right )}-1}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________