Finding the coefficients of the block diagram I was looking at the question from a textbook of mine and it doesn't make too much sense to me:

Design a ﬁrst-order ﬁlter, linearly extrapolating the current and
previous measurement. This is equivalent to the assumption that the
upcoming measurement will be on a straight line connecting the current
and previous measurement. The output of the ﬁlter shall anticipate
this by giving this output now.

The coefficients (2 and -1) are given in the answer, but I still don't understand how they were found.
I know that the general equation of a digital filter is given as:
\begin{equation}
    y[k] = \sum_{i=0}^{N} b_i u[k-i] - \sum_{j=1}^{N} a_i y[k-j]
\end{equation}
How does one go from that, using the description of the problem, to:
\begin{equation}
    y[k] = 2 x[k] - x[k-1]
\end{equation}
This is the answer given in the book:
If you assume that the samples lie on a line then the current sample is related to the previous sample by
$$x[n]=x[n-1]+c\tag{1}$$
with some unknown constant $c$. If there are two past samples given, then $c$ is simply determined by the difference between these two samples:
$$c= x[n-1]-x[n-2]\tag{2}$$
Combining $(1)$ and $(2)$ gives
$$x[n]=2x[n-1]-x[n-2]\tag{3}$$