Question: 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$

Answer: 
$\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}$. 
> 
> 
>
```
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

```