# How can I understand the 2nd solution of this equation? (theoretically correct, but doesn't work while being verified)

I'm trying to solve these two equations: $$\cos\left(\frac{\gamma'}{2}\right) = g_0\qquad e^{i\beta'}\sin\left(\frac{\gamma'}{2}\right) = g_1$$ Where $$g_0$$ is real and $$g_1$$ is complex. From the discussions on the math channel, we can find that $$\gamma'=2\cos^{-1}(g_0),\qquad e^{i\beta'}=\pm\frac{g_1}{\sqrt{1-g_0^2}}\qquad\beta'=-i\log\frac{g_1}{\sqrt{1-g_0^2}}+k\pi,\ \text{where}\ k\in\mathbb{Z}$$ However, I'm still having trouble understanding the solution when $$k$$ is an odd number, say if it equals $$1$$, then I'm trying to verify the solution using Mathematica:
Given that

g_0 = 0.8974187611347583, g_1= -0.33540402107889095+0.28660723962849705*I

We can find $$\gamma' = 0.913825694123124 , \beta_1'= 2.434484141132717 , \beta_2'=5.5760767947225105$$ (differ by $$1*\pi$$).

However, when I tried to use Mathematica to verify the solutions, only $$\beta_1'$$ and $$\gamma'$$ works, by which I mean $$e^{i\beta'}\sin\left(\frac{\gamma'}{2}\right)-g_1=0$$.

When I plug $$\beta_2', \gamma'$$ into the equation, it returns 0.670808 - 0.573214 I. Why the second answer doesn't work? Thanks a lot for the help!!

PS: This is what I tried: Exp[I*5.5760767947225105]* Sin[0.913825694123124/2] - (-0.33540402107889095 + 0.28660723962849705*I) // Simplify

• The solution is not correct for odd $k$. Solve reveals this; the general solution involves distinct arbitrary multiples of $4\pi$ and $2\pi$, as well as a coupled choice of sign.
Mar 23 at 5:58
• @Adam Thanks a lot for the comment!! Could you explain a bit more about the coupled choice of sign? Why does the general solution involve distinct arbitrary multiples of $4\pi$ and $2\pi$?
– ZR-
Mar 23 at 6:04

Clear["Global*"]

eqns = {Cos[γ/2] == g0, Exp[I*β] Sin[γ/2] == g1};

sol = Solve[eqns, {β, γ}] // Simplify Alternatively,

sol // TrigToExp Verifying the solutions,

Assuming[Element[{C, C}, Integers],
eqns /. sol // Simplify]

(* {{True, True}, {True, True}} *)


val = {g0 -> 0.8974187611347583,
g1 -> -0.33540402107889095 + 0.28660723962849705*I};

sol2 = sol /. val Assuming[Element[{C, C}, Integers],
eqns /. val /. sol2 // Simplify]

(* {{True, True}, {True, True}} *)

• Thanks a lot for the answer! ! What does the last section mean? (Assuming[Element[{C, C}, Integers], eqns /. val /. sol2 // Simplify])
– ZR-
Mar 23 at 6:24
• Starting with the general equations, substitute your specific values so that g0 and g1 are replaced, then substitute using sol2 so that beta and gamma are replaced with their values, then Simplify using the assumptions that the arbitrary constants (C and C) are integers. Read the documentation on ReplaceAll (i.e., /.). Mar 23 at 6:32
• Thanks!! Could you also explain a little bit about the output? (* {{True, True}, {True, True}} *)
– ZR-
Mar 23 at 6:41
• Look at the output for Clear[x]; x^2 == 4 /. {{x -> -2}, {x -> 2}} Look at documentation for Equal` Mar 23 at 14:41