5
$\begingroup$

The following equation in $\mathbb{C}$:

$4z^2+8|z|^2-3=0$

is not algebraic and has 4 solutions : $\pm\frac{1}{2}$ and $\pm i\frac{\sqrt{3}}{2}$. The Solve function in Mathematica only returns the 2 real values :

Solve[4 z^2 + 8 Abs[z]^2 - 3 == 0, Complexes]

(* {{z -> -(1/2)}, {z -> 1/2}} *)

What am I missing ?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Nov 13 '15 at 19:06
  • $\begingroup$ This discussion on Reduce vs Solve may be helpful $\endgroup$ – tba Nov 14 '15 at 2:08
5
$\begingroup$
Solve[4 z^2 + 8 Abs[z]^2 - 3 == 0 && z \[Element] Complexes, z]

{{z -> -(1/2)}, {z -> 1/2}, {z -> -((I Sqrt[3])/2)}, {z -> ( I Sqrt[3])/2}}

$\endgroup$
  • $\begingroup$ Why isn't this equivalent to the code in the question? I can't find anything in the documentation to imply otherwise. $\endgroup$ – tba Nov 14 '15 at 2:07
4
$\begingroup$

Actually, Reduce did it :

Reduce[4 z^2 + 8 Abs[z]^2 - 3 == 0,z, Complexes]

z == -(1/2) || z == 1/2 || z == -((I Sqrt[3])/2) || z == (I Sqrt[3])/2

Or using the option Method-> Reduce in Solve :

Solve[ 4 z^2 + 8 Abs[z]^2 - 3 == 0, z, Complexes, Method -> Reduce]

{{z -> -(1/2)}, {z -> 1/2}, {z -> -((I Sqrt[3])/2)}, {z -> ( I Sqrt[3])/2}}

Or using an option introduced in version 8 :

Solve[ 4 z^2 + 8 Abs[z]^2 - 3 == 0, z, Complexes, MaxExtraConditions -> All]

{{z -> -(1/2)}, {z -> 1/2}, {z -> -((I Sqrt[3])/2)}, {z -> ( I Sqrt[3])/2}}

This way one gets replacement rules in the usual Solve way instead of a boolean expression, in case the former is more useful.

I discovered that the variable name can be omitted both in Solve and Reduce. But it cannot be considered good practice. The mention of the domain (complexes) is also superfluous.

$\endgroup$
2
$\begingroup$

A pedestrian approach, overkill in this case, is to separate into explicit real and imaginary parts both for the expression(s) and variable(s).

expr = 4 z^2 + 8  Abs[z]^2 - 3;
{re, im} = 
 ComplexExpand[{Re[expr], Im[expr]}, z] /. {Re[z] -> rez, Im[z] -> imz}
solns = Solve[{re, im} == 0];
rez + I*imz /. solns

(* Out[380]= {-3 + 4 imz^2 + 12 rez^2, 8 imz rez}

Out[382]= {-(1/2), 1/2, -((I Sqrt[3])/2), (I Sqrt[3])/2} *)
$\endgroup$
  • $\begingroup$ Overkill, indeed in this simple case. $\endgroup$ – Georges Perros Nov 13 '15 at 19:58
1
$\begingroup$

Specifying Complexes for Solveor Reduce suffices as does just doing it yourself (as alluded to by Daniel:Lichtblau):

x + I y /.Solve[{4 (x^2 - y^2) + 8 (x^2 + y^2) - 3 == 0, 8 x y == 0}, {x, y}]

yield:

 {-((I Sqrt[3])/2), (I Sqrt[3])/2, -(1/2), 1/2}
$\endgroup$
0
$\begingroup$
   Solve[4 z^2 + 8 z Conjugate[z] - 3 == 0, z]
(* {z -> -1/2}, {z -> 1/2}, {z -> (-I/2)*Sqrt[3]}, {z -> (I/2)*Sqrt[3]}} *)
$\endgroup$
  • $\begingroup$ Yes, that works also. It's even simpler than adding options to Solve in this case. Thanks. $\endgroup$ – Georges Perros Nov 17 '15 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.