Solution (source code)

= Solution

If $e_1,\ldots,e_n$ are <orthonormal>, any relation $\sum_i c_ie_i=0$ gives $c_j=0$ on taking the <dot product> with $e_j$. Thus the vectors are <linearly independent>. A linearly independent set of $n$ vectors in the $n$-dimensional <vector space> $\mathbb R^n$ is a <basis>, proving the claim.

Expand both $x$ and $f$ in this <orthonormal basis>, writing $f_i=e_i\cdot f$. Since $Ae_i=\lambda_ie_i$, the linear equation becomes
$$
\sum_i(\lambda_i-\mu)a_ie_i=\sum_if_ie_i.
$$
Comparing the unique <basis> coefficients gives, when $\mu$ is not an <eigenvalue>,
$$
\boxed{a_i=\frac{e_i\cdot f}{\lambda_i-\mu},\qquad
x=\sum_i\frac{e_i\cdot f}{\lambda_i-\mu}e_i.}
$$
If $\mu=\lambda_1$, the equation is solvable exactly when $e_i\cdot f=0$ for every $i$ with $\lambda_i=\mu$. For those indices $a_i$ is arbitrary; for all other indices the displayed formula still applies. Thus repeated <eigenvalues> require orthogonality to the entire corresponding <eigenspace>, not merely to one chosen <eigenvector>. This is the finite-dimensional <Fredholm solvability condition for a self-adjoint operator>.

For the specific real <symmetric matrix>, choose
$$
e_1=\frac1{\sqrt2}(1,-1,0),\quad\lambda_1=1;\qquad
e_2=\frac1{\sqrt2}(1,1,0),\quad\lambda_2=3;\qquad
e_3=(0,0,1),\quad\lambda_3=3.
$$
Their <dot products> with $f$ are $-1/\sqrt2$, $3/\sqrt2$ and $3$. At $\mu=2$ this gives
$$
\boxed{a_1=1/\sqrt2,\quad a_2=3/\sqrt2,\quad a_3=3,\qquad x=(2,1,3).}
$$
One can check $(A-2I)x=f$ directly. At $\mu=1$, the first coefficient equation would require $0\cdot a_1=-1/\sqrt2$, which is impossible. Hence \b[there is no solution when $\mu=1$]; the nonzero projection onto its <eigenspace> is the obstruction.