3.1.1 \(\int \frac {1}{\sqrt {2}+\cos (z)+\sin (z)} \, dz\) [1]

Optimal. Leaf size=22 \[ -\frac {1-\sqrt {2} \sin (z)}{\cos (z)-\sin (z)} \]

[Out]

(-1+sin(z)*2^(1/2))/(cos(z)-sin(z))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3193} \begin {gather*} -\frac {1-\sqrt {2} \sin (z)}{\cos (z)-\sin (z)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sqrt[2] + Cos[z] + Sin[z])^(-1),z]

[Out]

-((1 - Sqrt[2]*Sin[z])/(Cos[z] - Sin[z]))

Rule 3193

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Simp[-(c - a*Sin
[d + e*x])/(c*e*(c*Cos[d + e*x] - b*Sin[d + e*x])), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[a^2 - b^2 - c^2, 0]

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {2}+\cos (z)+\sin (z)} \, dz &=-\frac {1-\sqrt {2} \sin (z)}{\cos (z)-\sin (z)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.05, size = 77, normalized size = 3.50 \begin {gather*} \frac {-\left (\left ((1+3 i)+\sqrt {2}\right ) \cos \left (\frac {z}{2}\right )\right )+\left ((1+i)-i \sqrt {2}\right ) \sin \left (\frac {z}{2}\right )}{\left ((1+i)+\sqrt {2}\right ) \cos \left (\frac {z}{2}\right )+i \left ((-1-i)+\sqrt {2}\right ) \sin \left (\frac {z}{2}\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[2] + Cos[z] + Sin[z])^(-1),z]

[Out]

(-(((1 + 3*I) + Sqrt[2])*Cos[z/2]) + ((1 + I) - I*Sqrt[2])*Sin[z/2])/(((1 + I) + Sqrt[2])*Cos[z/2] + I*((-1 -
I) + Sqrt[2])*Sin[z/2])

________________________________________________________________________________________

Mathics [A]
time = 6.10, size = 32, normalized size = 1.45 \begin {gather*} \frac {-198+140 \sqrt {2}}{99-70 \sqrt {2}-239 \text {Tan}\left [\frac {z}{2}\right ]+169 \sqrt {2} \text {Tan}\left [\frac {z}{2}\right ]} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[1/(Sqrt[2] + Sin[z] + Cos[z]),z]')

[Out]

(-198 + 140 Sqrt[2]) / (99 - 70 Sqrt[2] - 239 Tan[z / 2] + 169 Sqrt[2] Tan[z / 2])

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 21, normalized size = 0.95

method result size
default \(-\frac {2}{\left (\sqrt {2}-1\right ) \left (\tan \left (\frac {z}{2}\right )+\sqrt {2}+1\right )}\) \(21\)
norman \(\frac {\left (-2-2 \sqrt {2}\right ) \tan \left (\frac {z}{2}\right )+2}{\tan ^{2}\left (\frac {z}{2}\right )+2 \tan \left (\frac {z}{2}\right )-1}\) \(32\)
risch \(-\frac {2}{\sqrt {2}+2 \,{\mathrm e}^{i z}+i \sqrt {2}}+\frac {2 i}{\sqrt {2}+2 \,{\mathrm e}^{i z}+i \sqrt {2}}\) \(45\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(z)+sin(z)+2^(1/2)),z,method=_RETURNVERBOSE)

[Out]

-2/(2^(1/2)-1)/(tan(1/2*z)+2^(1/2)+1)

________________________________________________________________________________________

Maxima [A]
time = 0.41, size = 20, normalized size = 0.91 \begin {gather*} -\frac {2}{\frac {{\left (\sqrt {2} - 1\right )} \sin \left (z\right )}{\cos \left (z\right ) + 1} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(z)+sin(z)+2^(1/2)),z, algorithm="maxima")

[Out]

-2/((sqrt(2) - 1)*sin(z)/(cos(z) + 1) + 1)

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 25, normalized size = 1.14 \begin {gather*} \frac {\sqrt {2} \cos \left (z\right ) + \sqrt {2} \sin \left (z\right ) - 2}{2 \, {\left (\cos \left (z\right ) - \sin \left (z\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(z)+sin(z)+2^(1/2)),z, algorithm="fricas")

[Out]

1/2*(sqrt(2)*cos(z) + sqrt(2)*sin(z) - 2)/(cos(z) - sin(z))

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (15) = 30\)
time = 4.14, size = 61, normalized size = 2.77 \begin {gather*} - \frac {198}{- 239 \tan {\left (\frac {z}{2} \right )} + 169 \sqrt {2} \tan {\left (\frac {z}{2} \right )} - 70 \sqrt {2} + 99} + \frac {140 \sqrt {2}}{- 239 \tan {\left (\frac {z}{2} \right )} + 169 \sqrt {2} \tan {\left (\frac {z}{2} \right )} - 70 \sqrt {2} + 99} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(z)+sin(z)+2**(1/2)),z)

[Out]

-198/(-239*tan(z/2) + 169*sqrt(2)*tan(z/2) - 70*sqrt(2) + 99) + 140*sqrt(2)/(-239*tan(z/2) + 169*sqrt(2)*tan(z
/2) - 70*sqrt(2) + 99)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 24, normalized size = 1.09 \begin {gather*} \frac {2 \left (-\sqrt {2}-1\right )}{\tan \left (\frac {z}{2}\right )+\sqrt {2}+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(z)+sin(z)+2^(1/2)),z)

[Out]

-2*(sqrt(2) + 1)/(sqrt(2) + tan(1/2*z) + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.14, size = 16, normalized size = 0.73 \begin {gather*} -\frac {2}{\mathrm {tan}\left (\frac {z}{2}\right )\,\left (\sqrt {2}-1\right )+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(z) + sin(z) + 2^(1/2)),z)

[Out]

-2/(tan(z/2)*(2^(1/2) - 1) + 1)

________________________________________________________________________________________