The optimal values of the parameters in the least-squares line are given in a compact form by the expressions
and
where , , , .
These results are obtained by differentiating with respect to and to form the equations
and
which become
An application of Cramer's rule then gives
=
and
= =