Optimal. Leaf size=17 \[ \frac {1}{4} \tanh ^{-1}(2 \sin (x) \cos (x))-\frac {x}{2} \]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {298, 203, 206} \[ \frac {1}{4} \tanh ^{-1}(2 \sin (x) \cos (x))-\frac {x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 206
Rule 298
Rubi steps
\begin {align*} \int \sec (2 x) \sin ^2(x) \, dx &=\operatorname {Subst}\left (\int \frac {x^2}{1-x^4} \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\tan (x)\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=-\frac {x}{2}+\frac {1}{4} \tanh ^{-1}(2 \cos (x) \sin (x))\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 28, normalized size = 1.65 \[ -\frac {x}{2}-\frac {1}{4} \log (\cos (x)-\sin (x))+\frac {1}{4} \log (\sin (x)+\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \sec (2 x) \sin ^2(x) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.81, size = 26, normalized size = 1.53 \[ -\frac {1}{2} \, x + \frac {1}{8} \, \log \left (2 \, \cos \relax (x) \sin \relax (x) + 1\right ) - \frac {1}{8} \, \log \left (-2 \, \cos \relax (x) \sin \relax (x) + 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.65, size = 20, normalized size = 1.18 \[ -\frac {1}{2} \, x + \frac {1}{4} \, \log \left ({\left | \tan \relax (x) + 1 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | \tan \relax (x) - 1 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.14, size = 21, normalized size = 1.24
method | result | size |
default | \(-\frac {\ln \left (\tan \relax (x )-1\right )}{4}-\frac {\arctan \left (\tan \relax (x )\right )}{2}+\frac {\ln \left (1+\tan \relax (x )\right )}{4}\) | \(21\) |
risch | \(-\frac {x}{2}-\frac {\ln \left ({\mathrm e}^{2 i x}-i\right )}{4}+\frac {\ln \left ({\mathrm e}^{2 i x}+i\right )}{4}\) | \(27\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.02, size = 128, normalized size = 7.53 \[ -\frac {1}{2} \, x - \frac {1}{8} \, \log \left (2 \, \cos \relax (x)^{2} + 2 \, \sin \relax (x)^{2} + 2 \, \sqrt {2} \cos \relax (x) + 2 \, \sqrt {2} \sin \relax (x) + 2\right ) + \frac {1}{8} \, \log \left (2 \, \cos \relax (x)^{2} + 2 \, \sin \relax (x)^{2} + 2 \, \sqrt {2} \cos \relax (x) - 2 \, \sqrt {2} \sin \relax (x) + 2\right ) + \frac {1}{8} \, \log \left (2 \, \cos \relax (x)^{2} + 2 \, \sin \relax (x)^{2} - 2 \, \sqrt {2} \cos \relax (x) + 2 \, \sqrt {2} \sin \relax (x) + 2\right ) - \frac {1}{8} \, \log \left (2 \, \cos \relax (x)^{2} + 2 \, \sin \relax (x)^{2} - 2 \, \sqrt {2} \cos \relax (x) - 2 \, \sqrt {2} \sin \relax (x) + 2\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.24, size = 9, normalized size = 0.53 \[ \frac {\mathrm {atanh}\left (\mathrm {tan}\relax (x)\right )}{2}-\frac {x}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.13, size = 22, normalized size = 1.29 \[ - \frac {x}{2} - \frac {\log {\left (\sin {\left (2 x \right )} - 1 \right )}}{8} + \frac {\log {\left (\sin {\left (2 x \right )} + 1 \right )}}{8} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________