I have been given a set of points $(x_i,y_i)$ for $i = 1...N$. I am trying to fit a general line model onto the points with the following constraint:
$a^2+b^2+c^2 = 1$
I have also been given that using the Algebraic distance function $d = ax_i+by_i+c$ we are defining the error function as $E = \sum_{i=0}^N (ax_i+by_i+c)^2 -λ(a^2+b^2+c^2-1)$ where $\lambda$ is the Lagrange multiplier.
Finally, I am asked to derive the line equation for the parameters $a,b,c$.
I know that my solution will be in the following form:

I know I need to compute the partial derivative of E with respect to something, however, computing the partial derivative with respect to $a,b,c$ would only give me three solutions. How am I supposed to get 9 solutions to fill the 3x3 matrix?
You have 4 unknowns and 4 equations (first order conditions):
$E_a = \sum_{i=0}^N 2x_i(ax_i+by_i+c)-2λa=0$
$E_b = \sum_{i=0}^N 2y_i(ax_i+by_i+c)-2λb=0$
$E_c = \sum_{i=0}^N 2(ax_i+by_i+c)-2λc=0$
$E_\lambda=a^2+b^2+c^2-1=0$
In matrix form:
$\begin{bmatrix}\sum x_i^2& \sum x_iy_i & \sum x_i\\ \sum y_ix_i& \sum y_i^2 & \sum y_i\\ \sum x_i& \sum y_i & \sum 1\end{bmatrix}\begin{bmatrix}a\\b\\c\end{bmatrix}=\lambda\begin{bmatrix}a\\b\\c\end{bmatrix}$
and
$a^2+b^2+c^2=1$