Possible bug in Solve function?
Thanks for asking! In version 9.0 only 16 solutions are returned and they are all valid. In version 10.2 there are 20 solutions, with the extra 4 all being invalid. Contragulations! I think you found a bug. You may want to click "Help", then "Give Feedback...", and then fill out the form in your browser to report.
As another answer notes, you can always try Reduce[]
instead which may give better results in some cases, but Solve[]
is usually what you want.
You can use Reduce
f[w_, x_, y_, z_] := w*x^2*y^3 - z*(w^2 + x^2 + y^2 - 1)
eqn = {D[f[w, x, y, z], w] == 0, D[f[w, x, y, z], x] == 0,
D[f[w, x, y, z], y] == 0, D[f[w, x, y, z], z] == 0};
red = Reduce[eqn, Backsubstitution -> True]
$\left(z=0\land x=0\land w=-\sqrt{1-y^2}\right)\lor \left(z=0\land x=0\land w=\sqrt{1-y^2}\right)\lor \left(z=0\land y=0\land w=-\sqrt{1-x^2}\right)\lor \left(z=0\land y=0\land w=\sqrt{1-x^2}\right)\lor (z=0\land y=-1\land x=0\land w=0)\lor (z=0\land y=0\land x=0\land w=-1)\lor (z=0\land y=0\land x=0\land w=1)\lor (z=0\land y=1\land x=0\land w=0)\lor \left(z=-\frac{1}{4 \sqrt{3}}\land y=-\frac{1}{\sqrt{2}}\land x=-\frac{1}{\sqrt{3}}\land w=\frac{1}{\sqrt{6}}\right)\lor \left(z=-\frac{1}{4 \sqrt{3}}\land y=-\frac{1}{\sqrt{2}}\land x=\frac{1}{\sqrt{3}}\land w=\frac{1}{\sqrt{6}}\right)\lor \left(z=-\frac{1}{4 \sqrt{3}}\land y=\frac{1}{\sqrt{2}}\land x=-\frac{1}{\sqrt{3}}\land w=-\frac{1}{\sqrt{6}}\right)\lor \left(z=-\frac{1}{4 \sqrt{3}}\land y=\frac{1}{\sqrt{2}}\land x=\frac{1}{\sqrt{3}}\land w=-\frac{1}{\sqrt{6}}\right)\lor \left(z=\frac{1}{4 \sqrt{3}}\land y=-\frac{1}{\sqrt{2}}\land x=-\frac{1}{\sqrt{3}}\land w=-\frac{1}{\sqrt{6}}\right)\lor \left(z=\frac{1}{4 \sqrt{3}}\land y=-\frac{1}{\sqrt{2}}\land x=\frac{1}{\sqrt{3}}\land w=-\frac{1}{\sqrt{6}}\right)\lor \left(z=\frac{1}{4 \sqrt{3}}\land y=\frac{1}{\sqrt{2}}\land x=-\frac{1}{\sqrt{3}}\land w=\frac{1}{\sqrt{6}}\right)\\ \lor \left(z=\frac{1}{4 \sqrt{3}}\land y=\frac{1}{\sqrt{2}}\land x=\frac{1}{\sqrt{3}}\land w=\frac{1}{\sqrt{6}}\right)$
First@eqn //. {ToRules[red]}
{True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True}