\(a,\left(x-1\right)^2+x^2-1-\left(x-1\right)\left(x+5\right)=0\\ \Leftrightarrow\left(x-1\right)^2+\left(x-1\right)\left(x+1\right)-\left(x-1\right)\left(x+5\right)=0\\ \Leftrightarrow\left(x-1\right)\left(x-1+x+1-x-5\right)=0\\ \Leftrightarrow\left(x-1\right)\left(x-5\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x=1\\x=5\end{matrix}\right.\)
\(b,\left(x-3\right)^2+x^2-9-\left(x-3\right)\left(x+2\right)=0\\ \Leftrightarrow\left(x-3\right)^2+\left(x-3\right)\left(x+3\right)-\left(x-3\right)\left(x+2\right)=0\\ \Leftrightarrow\left(x-3\right)\left(x-3+x+3-x-2\right)=0\\ \Leftrightarrow\left(x-3\right)\left(x-2\right)=0\\ \Leftrightarrow\left[{}\begin{matrix}x=3\\x=2\end{matrix}\right.\)