Solution (source code)

= Solution

Let $h=x^2+y^2+z-x$. Using <Lagrange multipliers> with $\nabla f=\lambda\nabla h$ gives
$$
ay=\lambda(2x-1),\qquad ax=2\lambda y,\qquad1=\lambda.
$$
The third equation fixes $\lambda=1$. The first two then reduce to $2x-ay=1$ and $2y=ax$. If $a^2\ne4$, their solution and the constraint give
$$
\boxed{x=\frac2{4-a^2},\qquad y=\frac a{4-a^2},\qquad
z=\frac{4-3a^2}{(4-a^2)^2}.}
$$
At $a=2$, the second equation requires $y=x$ and makes the first inconsistent; at $a=-2$, it requires $y=-x$ and gives the same inconsistency. Thus \b[there is no constrained stationary point when $a=\pm2$]. The constraint <gradient> never vanishes because its vertical component is one, so the multiplier condition has not excluded any regular constrained <stationary points>.