3.4.92 \(\int \frac {1}{\sqrt {1+\cos (2 x)}} \, dx\) [392]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2728, 212} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sin (2 x)}{\sqrt {2} \sqrt {\cos (2 x)+1}}\right )}{\sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/Sqrt[1 + Cos[2*x]],x]

[Out]

ArcTanh[Sin[2*x]/(Sqrt[2]*Sqrt[1 + Cos[2*x]])]/Sqrt[2]

Rule 212

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

Rule 2728

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2/d, Subst[Int[1/(2*a - x^2), x], x, b*(C
os[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 47, normalized size = 1.74 \begin {gather*} -\frac {\cos (x) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )\right )}{\sqrt {1+\cos (2 x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/Sqrt[1 + Cos[2*x]],x]

[Out]

-((Cos[x]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]]))/Sqrt[1 + Cos[2*x]])

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.05, size = 9, normalized size = 0.33

method result size
default \(\frac {\sqrt {2}\, \mathrm {am}^{-1}\left (x | 1\right )}{2}\) \(9\)
risch \(\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )}{\sqrt {\left ({\mathrm e}^{2 i x}+1\right )^{2} {\mathrm e}^{-2 i x}}}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )}{\sqrt {\left ({\mathrm e}^{2 i x}+1\right )^{2} {\mathrm e}^{-2 i x}}}\) \(67\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(2*x)+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*2^(1/2)*InverseJacobiAM(x,1)

________________________________________________________________________________________

Maxima [A]
time = 5.65, size = 41, normalized size = 1.52 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \sin \left (x\right ) + 1\right ) - \frac {1}{4} \, \sqrt {2} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \sin \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (23) = 46\).
time = 1.38, size = 55, normalized size = 2.04 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {\cos \left (2 \, x\right )^{2} - 2 \, \sqrt {2} \sqrt {\cos \left (2 \, x\right ) + 1} \sin \left (2 \, x\right ) - 2 \, \cos \left (2 \, x\right ) - 3}{\cos \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(2*x))**(1/2),x)

[Out]

Integral(1/sqrt(cos(2*x) + 1), x)

________________________________________________________________________________________

Giac [A]
time = 0.86, size = 41, normalized size = 1.52 \begin {gather*} \frac {\sqrt {2} \log \left ({\left | \frac {1}{\sin \left (x\right )} + \sin \left (x\right ) + 2 \right |}\right )}{8 \, \mathrm {sgn}\left (\cos \left (x\right )\right )} - \frac {\sqrt {2} \log \left ({\left | \frac {1}{\sin \left (x\right )} + \sin \left (x\right ) - 2 \right |}\right )}{8 \, \mathrm {sgn}\left (\cos \left (x\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.05, size = 13, normalized size = 0.48 \begin {gather*} \frac {\sqrt {2}\,\mathrm {asinh}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(2*x) + 1)^(1/2),x)

[Out]

(2^(1/2)*asinh(sin(x)/cos(x)))/2

________________________________________________________________________________________