Construct the Lagrange polynomial $p_1$ of degree $1$ for a continuous function $f$ on $[-1, 1]$ using the points $x_0 = -1$ and $x_1 = 1$.
My attempt (note: I am using the notation that is used on the wikipedia page https://en.wikipedia.org/wiki/Lagrange_polynomial)
Here, we have $k = 1$. So,
$$\ell_{0}(x) = \prod_{0 \leq m \leq 1 \\ m \neq 0} \frac{x - x_{m}}{x_{0} - x_{m}} = \frac{x - x_{1}}{x_{0} - x_{1}} = \frac{x - 1}{-2} = -\frac{x - 1}{2}.$$
and
$$\ell_{1}(x) = \prod_{0 \leq m \leq 1 \\ m\neq 1} \frac{x - x_{m}}{x_{1} - x_{m}} = \frac{x - x_{0}}{x_{1} - x_{0}} = \frac{x + 1}{2}.$$
Hence, our interpolation polynomial is
$$L(x) = \sum_{j=0}^{1} y_{j} \ell_{j}(x) = - y_{0} \cdot \frac{x - 1}{2} + y_{1} \cdot \frac{x + 1}{2}.$$
This is my first time doing this. I wanted to have someone check if I have done this correctly?