Find a second degree polynomial that goes through 3 points I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points;
for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$.
I can only guess that the curve is upwards and that I may create the system:
$$
y_1 = ax^2_1 + bx_1 + c\\
y_2 = ax^2_2 + bx_2 + c\\
y_3 = ax^2_3 + bx_3 + c
$$
assuming that the points are in the format $A(x,y)$ and from this point what do I do?
Do I build a matrix and use the Gaussian eliminations?
EDIT: I also know that $f(4) = 120$
 A: The matrix you are about to build is a Vandermonde Matrix:
$$
\vec y = \pmatrix{1&x_1&x_1^2\\1&x_2&x_2^2\\1&x_3&x_3^2\\}\pmatrix{c\\b\\a}
$$
A square Vandermonde matrix is thus invertible if and only if the $x_i$ are distinct; an explicit formula for the inverse is known.$^{\text[2]}$
A: Each of the points (1,3), (-1,-5) and (-2,12) satisfies the equation $y = ax^2 + bx + c$ for some unknown a,b,c. The task is to find a,b and c. Start by substituting each of the points into the equation, we have
$$
\begin{align}
3 &= a(1)^2 + b(1) + c \\
-5 &= a(-1)^2 + b(-1) + c \\
12 &= a(-2)^2 + b(-2) + c
\end{align}$$
 We can write this more compactly as a matrix equation
$$
\begin{bmatrix} 1 & 1 & 1\\ 1 & -1 & 1\\ 4 & -2 & 1 
\end{bmatrix} \begin{bmatrix}a\\ b\\ c \end{bmatrix} = \begin{bmatrix} 3\\ -5\\ 12\end{bmatrix}
$$
Write the augmented matrix and do elementary row operations 
$$
\begin{bmatrix} 1 & 1 & 1 & 3\\ 1 & -1 & 1& -5\\ 4 & -2 & 1 & 12
\end{bmatrix} \Rightarrow \begin{bmatrix} 1 & 1 & 1 & 3\\ 0 & -2 & 0 & -8\\ 0 & -6 & -3 & 0
\end{bmatrix} \Rightarrow \begin{bmatrix} 1 & 1 & 1 & 3\\ 0 & -2 & 0 & -8\\ 0 & 0 & -3 & 24
\end{bmatrix} 
$$
and now, back substitution.
starting with the last row, 
$$\begin{align}-3c &= 24 \\ c &= -8 \end{align} $$
and then the second row
$$\begin{align} -2b &= -8 \\ b &= 4 \end{align}$$
and finally back substituting these into the first row
$$\begin{align}a + b + c &= 3 \\ a + (4) + (-8) &= 3 \\ a &= 7\end{align}$$
So, I think the equation is:
$$ y = 7x^2 + 4x -8 $$
Please check my work, I did this in a hurry.
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left( #1 \right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{A\pars{1,3},\ B\pars{-1,-5},\ C\pars{-2,12}}$
$$
{\rm y}\pars{x} \equiv A\pars{x + 1}\pars{x + 2} + B\pars{x - 1}\pars{x + 2} + C\pars{x - 1}\pars{x + 1}\tag{1} 
$$

$$
\begin{array}{rcrcrcrcrcl}
{\rm y}\pars{1} & = & 3 & \imp & 6A & = & 3 & \imp & A & = & \half
\\[3mm]
{\rm y}\pars{-1} & = & -5 & \imp & -2B & = & -5 & \imp & B & = & {5\over 2}  
\\[3mm]
{\rm y}\pars{-2} & = & 12 & \imp & 3C & = & 12 & \imp & C & = &  4  
\end{array}
$$
  Reduce , if desired, expression $\pars{1}$. 

A: You don't need matrices to calculate the answer
$$a=((y_1-y_2)-(y_2-y_3)(x_1-x_2)/(x_2-x_3))/((x_1^2-x_2^2)-(x_2^2-x_3^2)(x_1-x_2)/(x_2-x_3))$$ 
$$b=((y_1-y_2)-a(x_1^2-x_2^2))/(x_1-x_2)$$ 
$$c=y_1-ax_1^2-bx_1$$ 
If you want to check you got the correct result then 
$$c=y_2-ax_2^2-bx_2$$ 
and 
$$c=y_3-ax_3^2-bx_3$$ 
should give the same values of c
A: For the three points
P1=(x1,y1), 
P2=(x2,y2), 
P3=(x3,y3), 

use the coefficients a, b and c,

a = y1/(x1*x1 - x1*x2 - x1*x3 + x2*x3) + y2/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) + y3/(x1*x2 - x1*x3 - x2*x3 + x3*x3)

b = - (x2*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x3*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) - (x1*y2)/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) - (x3*y2)/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) - (x1*y3)/(x1*x2 - x1*x3 - x2*x3 + x3*x3) - (x2*y3)/(x1*x2 - x1*x3 - x2*x3 + x3*x3)

c = (x2*x3*y1)/(x1*x1 - x1*x2 - x1*x3 + x2*x3) + (x1*x3*y2)/(-x1*x2 + x1*x3 + x2*x2 - x2*x3) + (x1*x2*y3)/(x1*x2 - x1*x3 - x2*x3 + x3*x3)

for the polynomial
y = a*x² + b*x + c

