Using the Lagrange interpolation formula to find a polynomial f with $f(-1)=-6, f(0)=2, ...$ The exercise goes as follows: 
Use the Lagrange interpolation formula to find a polynomial $f$ with real coefficients such that $f$ has degree $\leq3$ and $f(-1)=-6, f(0)=2, f(1)=-2, f(2)=6$.
So to start, I wrote down the formula $$f=\sum^n_{i=0}f(t_i)P_i$$
But I didn't manage to get much further than that. I understand that $P_i$ are polynomials of degree $i$, but I'm not sure how I can do anything with that information.
 A: Your data pairs $(x_i, f_i)$, $0\leq i\leq 3$ are $(-1, -6), (0, 2), (1, -2)$ and $(2, 6)$. The $3$-degree polynomial $P_3(x)$ that you would get using Lagrange's interpolation is $$P_3(x)=\sum_{i=0}^3f_iL_i(x)$$ where $$L_i(x)=\prod_{j=0\\ j\neq i}^3\dfrac{x-x_j}{x_i-x_j}$$ are the basis polynomials. For example, $$L_0(x)=\dfrac{x(x-1)(x-2)}{(-1)(-1-1)(-1-2)}.$$ Similarly find $L_1(x), L_2(x), L_3(x)$ and then calculate $P_3(x)$.
A: I would like to propose an alternative way to solve the problem. Coefficients of Lagrange interpolation polynomial can be found if one uses a determinant form of Lagrange interpolation presented in "Beginner's guide to mapping simplexes affinely", section "Lagrange interpolation" (you may check for concrete example in "Workbook on mapping simplexes affinely"). General formula looks as follows
$$
f(x) = (-1)
\frac{
    \det
    \begin{pmatrix}
        0       & f_0       & f_1       & \cdots & f_n       \\
        x^n     & x_0^n     & x_1^n     & \cdots & x_n^n     \\
        x^{n-1} & x_0^{n-1} & x_1^{n-1} & \cdots & x_n^{n-1} \\
        \cdots  & \cdots    & \cdots    & \cdots & \cdots    \\
        1       & 1         & 1         & \cdots & 1         \\
    \end{pmatrix}
}{
    \det
    \begin{pmatrix}
        x_0^n     & x_1^n     & \cdots & x_n^n     \\
        x_0^{n-1} & x_1^{n-1} & \cdots & x_n^{n-1} \\
        \cdots    & \cdots    & \cdots & \cdots    \\
        1         & 1         & \cdots & 1         \\
    \end{pmatrix}
}.
$$
EXAMPLE
Let's consider your case: $f(-1) = -6$, $f(0) = 2$, and $f(2) = 6$. Previous equation should be written as
$$
f(x) = (-1)
\frac{
    \det
    \begin{pmatrix}
        0       & -6       & 2       & 6       \\
        x^2     & (-1)^2   & 0^2     & 2^2     \\
        x       & -1       & 0       & 2       \\
        1       & 1        & 1       & 1       \\
    \end{pmatrix}
}{
    \det
    \begin{pmatrix}
        (-1)^2   & 0^2     & 2^2     \\
        -1       & 0       & 2       \\
        1        & 1       & 1       \\
    \end{pmatrix}
} = 2 + 6 x - 2 x^2.
$$
Now it is easy to check that
$$
\begin{aligned}
    f(-1) &= 2 - 6 - 2(-1)^2 = -6,\\
    f(0)  &= 2 + 0 - 0 = 2,\\
    f(2)  &= 2 + 12 - 2\, (2)^2 = 6
\end{aligned}
$$
