3.4.84 \(\int \sec (2 x) \sin (x) \, dx\) [384]

Optimal. Leaf size=15 \[ \frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}} \]

[Out]

1/2*arctanh(cos(x)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4442, 213} \begin {gather*} \frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[Sqrt[2]*Cos[x]]/Sqrt[2]

Rule 213

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

Rule 4442

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, Dist[-d/(
b*c), Subst[Int[SubstFor[1, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a
+ b*x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])

Rubi steps

\begin {align*} \int \sec (2 x) \sin (x) \, dx &=-\text {Subst}\left (\int \frac {1}{-1+2 x^2} \, dx,x,\cos (x)\right )\\ &=\frac {\tanh ^{-1}\left (\sqrt {2} \cos (x)\right )}{\sqrt {2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.26, size = 174, normalized size = 11.60 \begin {gather*} \frac {2 i \tan ^{-1}\left (\frac {\cos \left (\frac {x}{2}\right )-\left (-1+\sqrt {2}\right ) \sin \left (\frac {x}{2}\right )}{\left (1+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}\right )-2 i \tan ^{-1}\left (\frac {\cos \left (\frac {x}{2}\right )-\left (1+\sqrt {2}\right ) \sin \left (\frac {x}{2}\right )}{\left (-1+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )}\right )+4 \tanh ^{-1}\left (\sqrt {2}+\tan \left (\frac {x}{2}\right )\right )-\log \left (2-\sqrt {2} \cos (x)-\sqrt {2} \sin (x)\right )+\log \left (2+\sqrt {2} \cos (x)-\sqrt {2} \sin (x)\right )}{4 \sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((2*I)*ArcTan[(Cos[x/2] - (-1 + Sqrt[2])*Sin[x/2])/((1 + Sqrt[2])*Cos[x/2] - Sin[x/2])] - (2*I)*ArcTan[(Cos[x/
2] - (1 + Sqrt[2])*Sin[x/2])/((-1 + Sqrt[2])*Cos[x/2] - Sin[x/2])] + 4*ArcTanh[Sqrt[2] + Tan[x/2]] - Log[2 - S
qrt[2]*Cos[x] - Sqrt[2]*Sin[x]] + Log[2 + Sqrt[2]*Cos[x] - Sqrt[2]*Sin[x]])/(4*Sqrt[2])

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 13, normalized size = 0.87

method result size
default \(\frac {\arctanh \left (\cos \left (x \right ) \sqrt {2}\right ) \sqrt {2}}{2}\) \(13\)
risch \(\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}\) \(47\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/cos(2*x),x,method=_RETURNVERBOSE)

[Out]

1/2*arctanh(cos(x)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (12) = 24\).
time = 1.53, size = 129, normalized size = 8.60 \begin {gather*} \frac {1}{8} \, \sqrt {2} \log \left (2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) + 2 \, {\left (\sqrt {2} \cos \left (x\right ) + 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) - \frac {1}{8} \, \sqrt {2} \log \left (-2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) - 2 \, {\left (\sqrt {2} \cos \left (x\right ) - 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (12) = 24\).
time = 1.06, size = 33, normalized size = 2.20 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {2 \, \cos \left (x\right )^{2} + 2 \, \sqrt {2} \cos \left (x\right ) + 1}{2 \, \cos \left (x\right )^{2} - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*sqrt(2)*log(-(2*cos(x)^2 + 2*sqrt(2)*cos(x) + 1)/(2*cos(x)^2 - 1))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sin {\left (x \right )}}{\cos {\left (2 x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (12) = 24\).
time = 0.78, size = 49, normalized size = 3.27 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\frac {{\left | -4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} - 6 \right |}}{{\left | 4 \, \sqrt {2} - \frac {2 \, {\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} - 6 \right |}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*sqrt(2)*log(abs(-4*sqrt(2) - 2*(cos(x) - 1)/(cos(x) + 1) - 6)/abs(4*sqrt(2) - 2*(cos(x) - 1)/(cos(x) + 1)
- 6))

________________________________________________________________________________________

Mupad [B]
time = 0.13, size = 12, normalized size = 0.80 \begin {gather*} \frac {\sqrt {2}\,\mathrm {atanh}\left (\sqrt {2}\,\cos \left (x\right )\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2^(1/2)*atanh(2^(1/2)*cos(x)))/2

________________________________________________________________________________________