3.385 \(\int \sec (2 x) \sin ^2(x) \, dx\)

Optimal. Leaf size=17 \[ \frac{1}{4} \tanh ^{-1}(2 \sin (x) \cos (x))-\frac{x}{2} \]

[Out]

-x/2 + ArcTanh[2*Cos[x]*Sin[x]]/4

________________________________________________________________________________________

Rubi [A]  time = 0.0417367, antiderivative size = 17, normalized size of antiderivative = 1., 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]

Int[Sec[2*x]*Sin[x]^2,x]

[Out]

-x/2 + ArcTanh[2*Cos[x]*Sin[x]]/4

Rule 298

Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[-(a/b), 2]], s = Denominator[Rt[-(a/b),
2]]}, Dist[s/(2*b), Int[1/(r + s*x^2), x], x] - Dist[s/(2*b), Int[1/(r - s*x^2), x], x]] /; FreeQ[{a, b}, x] &
&  !GtQ[a/b, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

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.0145743, 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]

Integrate[Sec[2*x]*Sin[x]^2,x]

[Out]

-x/2 - Log[Cos[x] - Sin[x]]/4 + Log[Cos[x] + Sin[x]]/4

________________________________________________________________________________________

Maple [A]  time = 0.037, size = 19, normalized size = 1.1 \begin{align*}{\frac{\ln \left ( 1+\tan \left ( x \right ) \right ) }{4}}-{\frac{\ln \left ( -1+\tan \left ( x \right ) \right ) }{4}}-{\frac{x}{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^2/cos(2*x),x)

[Out]

1/4*ln(1+tan(x))-1/4*ln(-1+tan(x))-1/2*x

________________________________________________________________________________________

Maxima [B]  time = 1.53131, size = 173, normalized size = 10.18 \begin{align*} -\frac{1}{2} \, x - \frac{1}{8} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt{2} \cos \left (x\right ) + 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) + \frac{1}{8} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt{2} \cos \left (x\right ) - 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) + \frac{1}{8} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt{2} \cos \left (x\right ) + 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) - \frac{1}{8} \, \log \left (2 \, \cos \left (x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt{2} \cos \left (x\right ) - 2 \, \sqrt{2} \sin \left (x\right ) + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/cos(2*x),x, algorithm="maxima")

[Out]

-1/2*x - 1/8*log(2*cos(x)^2 + 2*sin(x)^2 + 2*sqrt(2)*cos(x) + 2*sqrt(2)*sin(x) + 2) + 1/8*log(2*cos(x)^2 + 2*s
in(x)^2 + 2*sqrt(2)*cos(x) - 2*sqrt(2)*sin(x) + 2) + 1/8*log(2*cos(x)^2 + 2*sin(x)^2 - 2*sqrt(2)*cos(x) + 2*sq
rt(2)*sin(x) + 2) - 1/8*log(2*cos(x)^2 + 2*sin(x)^2 - 2*sqrt(2)*cos(x) - 2*sqrt(2)*sin(x) + 2)

________________________________________________________________________________________

Fricas [A]  time = 2.20918, size = 96, normalized size = 5.65 \begin{align*} -\frac{1}{2} \, x + \frac{1}{8} \, \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) - \frac{1}{8} \, \log \left (-2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/cos(2*x),x, algorithm="fricas")

[Out]

-1/2*x + 1/8*log(2*cos(x)*sin(x) + 1) - 1/8*log(-2*cos(x)*sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 1.23341, size = 22, normalized size = 1.29 \begin{align*} - \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} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)**2/cos(2*x),x)

[Out]

-x/2 - log(sin(2*x) - 1)/8 + log(sin(2*x) + 1)/8

________________________________________________________________________________________

Giac [A]  time = 1.11681, size = 27, normalized size = 1.59 \begin{align*} -\frac{1}{2} \, x + \frac{1}{4} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) - \frac{1}{4} \, \log \left ({\left | \tan \left (x\right ) - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^2/cos(2*x),x, algorithm="giac")

[Out]

-1/2*x + 1/4*log(abs(tan(x) + 1)) - 1/4*log(abs(tan(x) - 1))