We consider the data set $(1,2), (2,3), (3,5), (4,4)$ and we determine the equation of the regression line corresponding to these observations.

Hence, we have to minimize the following function:
$$\begin{align}z(a,b)&=[2- (a \cdot 1 + b)]^2 + [3- (a \cdot 2 + b)]^2 +[5- (a \cdot 3 + b)]^2+[4- (a \cdot 4 + b)]^2\end{align}$$

Consequently, we determine the partial derivative with respect to $a$ of $z(a,b)$,

z'_a(a,b)&=-2(2-a-b)-4(3-2a-b)-6(5-3a-b)-8(4-4a-b)\\
& = -78+60a+20b,
\end{align}$$
and the partial derivative with respect to $b$ of $z(a,b)$,
$$\begin{align}
z'_b(a,b)&=-2(2-a-b)-2(3-2a-b)-2(5-3a-b)-2(4-4a-b)\\
&=-28+20a+8b,
\end{align}$$
The stationary points of $z(a,b)$ are found by solving the following system of equations:
$$\begin{align}
z'_a(a,b)&=0\\
z'_b(a,b)&=0.
\end{align}$$
Hence, $20a=28-8b$, which gives $a=1\frac{2}{5}-\frac{2}{5}b$. Therefore, $-78+60(1\frac{2}{5}-\frac{2}{5}b)+20b=0$ gives $b=1\frac{1}{2}$. Finally, $a=\frac{4}{5}$.

Since $z''_{aa}(a,b)=60$, $z''_{bb}(a,b)=8$ and $z''_{ab}(a,b)=20$ it holds that $C(a,b)=60\cdot 8-20^2=80$. Hence, $C(\frac{4}{5},1\frac{1}{2})=80>0$ and $z''_{aa}(\frac{4}{5},1\frac{1}{2})=60>0$, which implies that $(a,b)=(\frac{4}{5},1\frac{1}{2})$ is a minimum location.

Consequently, $y=\frac{4}{5}x+1\frac{1}{2}$.