# How to solve this set of equation in complex domain?

First, I got a real version of equation set

Solve[{d u^2 - d v^2 == 2 e u v, (u u + v v) == 1}, {u, v}]


This can be correctly solved in the blink of an eye.

Now I want to solve this complex version

Solve[{d u^2 - d\[Conjugate] v^2 - 2 e u v ==
0, (u u\[Conjugate] + v v\[Conjugate]) == 1}, {u, v}]


mathematica can not be solve the above code.

But I can show how this set of equation can be easily solved.

take

$$- {v^2}{d^*} + d{u^2} - 2euv = 0$$

multiply both side by $\frac{{{d^*}}}{{{u^2}}}$, we got $$- {\left( {{d^*}\frac{v}{u}} \right)^2} - 2e\left( {{d^*}\frac{v}{u}} \right) + {\left| d \right|^2} = 0$$ we can see this is a simple quadratic equation relative to ${d^*}\frac{v}{u}$, and got $${d^*}\frac{v}{u} = e \pm \sqrt {{e^2} + {{\left| d \right|}^2}}$$ define $$\xi \equiv \sqrt {{e^2} + {{\left| d \right|}^2}}$$ then $$v = \frac{u}{{{d^*}}}\left( {e + \xi } \right)$$ and $${\left| v \right|^2} = \frac{{{{\left| u \right|}^2}}}{{{{\left| d \right|}^2}}}{\left( {e + \xi } \right)^2}$$ plug this back into $${\left| u \right|^2} + {\left| v \right|^2} = 1$$ we got $${\left| u \right|^2}\left[ {1 + \frac{1}{{{{\left| d \right|}^2}}}{{\left( {e + \xi } \right)}^2}} \right] = 1$$ at this step, we can say we solved the absolute value of u and v. their relative phase is determined by previous $v = \frac{u}{{{d^*}}}\left( {e + \xi } \right)$

After I solved the equation, I notice that I missed a condition in Solve. Because there is phase uncertainty, if we restrict that u is real, then v should be also fixed.

So I thought this can be solved

Solve[{d u^2 - d\[Conjugate] v^2 - 2 e u v ==
0, (u u\[Conjugate] + v v\[Conjugate]) == 1, Im[u]==0}, {u, v}]


With Im[u] condition added.

But mathematica still can not give an answer. Am I missing something here? How to solve this set of equation?

Supose, only v and d are complex, ComplexExpand gives a fast result:

ce = ComplexExpand[{d u^2 - d\[Conjugate] v^2 - 2 e u v ==
0, (u u\[Conjugate] + v v\[Conjugate]) == 1}, {v, d},
TargetFunctions -> {Re, Im}] /. {Re[d] -> d1, Im[d] -> d2,
Re[v] -> v1, Im[v] -> v2}

(*   {d1 u^2 - 2 e u v1 - d1 v1^2 - 2 d2 v1 v2 + d1 v2^2 +
I (d2 u^2 + d2 v1^2 - 2 e u v2 - 2 d1 v1 v2 - d2 v2^2) == 0,
u^2 + v1^2 + v2^2 == 1}   *)


Both, real and imaginary part have to be zero.

Solve[{d1 u^2 - 2 e u v1 - d1 v1^2 - 2 d2 v1 v2 + d1 v2^2 ==
0, (d2 u^2 + d2 v1^2 - 2 e u v2 - 2 d1 v1 v2 - d2 v2^2) == 0,
u^2 + v1^2 + v2^2 == 1}, {u, v1, v2}] // Simplify


• Great +1, Thank you so much, Akku14. There is one thing I don't understand. It seems that "to real and imaginary part zero" is essential in the second step. But I don't understand why Mathematica can not directly handle Solve[ce, {u, v1, v2}] to give the same answer? As I tested Solve[ce, {u, v1, v2}] gives quite complicated answer contains imaginary I and cannot simplified to the same form as your post. Feb 27, 2018 at 1:14
• Directy Solve[ce, {u, v1, v2}] searches for solutions, that are also valid for complex variables and constants, which is much more difficult. Adding the domain Reals Solve[ce, {u, v1, v2},Reals] gives an error message, since then all variables and constants have to be real and imaginary I is regarded as a constant. I didn't restrict my version of Solve[...],. to Reals, because Real test take a lot of time. So you have to pay attention, if the d1 and d2 yield complex u or v1 or v2, the assumptions of ComplexExpand are not valid and you have to take the more complicated answers you found. Feb 27, 2018 at 15:28

Substituting

u = \[Rho]u Exp[I \[Alpha]u];
v = \[Rho]v Exp[I \[Alpha]v];
d = \[Rho]d Exp[I \[Alpha]d];
gln = Simplify[{d u^2 - d\[Conjugate] v^2 - 2 e u v ==0, (u u\[Conjugate] + v v\[Conjugate]) == 1},Assumptions ->Element[{\[Rho]u, \[Rho]v, \[Rho]d, \[Alpha]u,\[Alpha]v, \\[Alpha]d}, Reals]]


you can solve directly

sol = FullSimplify[Solve[gln, {\[Rho]u, \[Rho]v(*,\[Alpha]u,\[Alpha]v*)}],Assumptions ->Element[{\[Rho]u, \[Rho]v, \[Rho]d, \[Alpha]u, \[Alpha]v, \\[Alpha]d}, Reals]]

• Thank you so much,Ulrich Neumann. The solution is complicated. Do you have a good way to transforming the solution back to a form represented by original variables? Feb 27, 2018 at 1:24
• Sorry, no idea... One point I didn't understand yet is the following: There are three equations to determine the four unknowns \[Rho]u, \[Rho]v, \[Alpha]u,\[Alpha]v, so your system seems to be under-determined . Do you expect a unique solution? Feb 27, 2018 at 8:47
• I had exactly the same doubt when I made the post. But I think Akku14's approach somewhat answer this question. Because the equation is complex, so a single equation is actually two equations which corresponds to real and imaginary parts both to be zero. Feb 27, 2018 at 9:18
• But it is a strong restriction to force u \[Element] Reals . Which solution domain you are expecting? Feb 27, 2018 at 9:49
• Just one remark: In your derivation of an analytic solution you solved for the absolute value |u|,|v|. Substituting this result you get Exp[I ( \[Alpha]v + \[Alpha]u + \[Alpha]d)] == Abs[u]/(Abs[v] Abs[d]) (e \[PlusMinus] Sqrt[e^2 + Abs[d]^2]), right side is real, so the phase difference must be \[Alpha]v + \[Alpha]u + \[Alpha]d== k 2Pi ( k=Integers ) Feb 27, 2018 at 10:04