Perhaps an easier way will be to use the Lagrange Interpolation Formula. Given $n$ points such that no two of them lies on a same vertical line, the formula guarantee the existence of a polynomial $P(x)$ such that $P(x)$ passes through these $n$ points and the degree of $P(x)$ is at most $n-1$.
Since 3 points are given, by using the formula, the polynomial formed will be at most degree of 2. Here is how the formula works:
Suppose the 3 points are $p_1 = (x_1 = 40, y_1 = 30), p_2 = (x_2 = 60, y_2 = 28), p_3 = (x_3 = 20, y_3 = 25)$. Now, form 3 polynomial $R_1(x), R_2(x), R_3(x)$ such that $R_1(x_1)=1, R_1(x_2)=R_1(x_3)=0$, $R_2(x_2)=1, R_2(x_1)=R_2(x_3)=0$ and $R_3(x_3)=1, R_3(x_1)=R_3(x_2)=0$. It is easy to see that
$R_1(x)=\frac{(x-60)(x-20)}{(40-60)(40-20)}=-\frac{x^2-80x+1200}{400}$ $R_2(x)=\frac{(x-40)(x-20)}{(60-40)(60-20)}=\frac{x^2-60x+800}{800}$ $R_3(x)=\frac{(x-40)(x-60)}{(20-40)(20-60)}=\frac{x^2-100x+2400}{800}$ This $P(x)$ that we want to find is
$P(x)=30R_1(x)+28R_2(x)+25R_3(x)$ And the rest are just algebra.
Generally, given $n$ points, $p_1, p_2, \cdots, p_n$, such that $p_i=(x_i, y_i)$, a polynomial $P(x)$ that passes through all these points is
$P(x)=\sum^n_{i=0}y_i\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}$