Check that two function $f(x,y)$ and $g(x,y)$ are identical Given that $f(x)$ and $g(x)$ are two polynomials of degree $n$, we know that if we can find $n+1$ distinct numbers $x_i$, $i=1,\cdots,n+1$ such that $f(x_i)=g(x_i)$ then $f(x)$ and $g(x)$ are identical.
However I don't know how to do this with two variable functions. How can I check if a function $f(x,y)$ has the form $g(x,y) = Ax^2+Bxy+Cy^2+Dx+Ey+F$ or not? How many pairs $(x_i,y_i)$ do I have to check to make sure that $f(x,y)$ is identical to $g(x,y)$?
Regards.
 A: If $f$ and $g$ are two polynomials of degree $n$, and there are distinct points $x_1, \dots, x_{n+1}$ such that $f(x_i) = g(x_i)$ for $i = 1, \dots, n+1$, then $f = g$. One way to see this is that a generic degree $n$ polynomial has the form 
$$a_nx^n + a_{n-1}x^{n-1} + \dots + a_1x + a_0$$
which contains $n+1$ coefficients. Given $n+1$ points $(x_i, y_i)$ which satisfy the polynomial equation, we obtain $n+1$ equations in $n+1$ unknowns which uniquely determine the coefficients, and hence the polynomial.
If now $f$ and $g$ are polynomials in two variables of degree $n$. A generic such polynomial has the form
$$\sum_{i=0}^n\sum_{j=0}^ia_{ij}x^jy^{i-j}$$
which contains $N:=\frac{(n+1)(n+2)}{2}$ coefficients. Given the situation for one variable polynomials, you may guess that if there are distinct points $(x_1, y_1), \dots, (x_N, y_N)$ with $f(x_i, y_i) = g(x_i, y_i)$ for $i = 1, \dots, N$, then $f = g$. Your guess would be wrong. While it is true that $N$ points of agreement is enough to show that $f = g$, it is not true that any $N$ points will do. Each point will still give an equation so that you obtain $N$ equations in $N$ unknowns, you might get some redundancy which means the system will not have a unique solution.
A: I'm sorry to tell you that it gets quite difficult once you start with higher number of variables. Just checking points isn't enough. For instance, if $f(x, y) = x - y$ and $g(x, y) = x + y$, then for any point $(a, 0)$ the two functions evaluate to the same value, yet they are unequal otherwise.
There are some ways of handling this, though. This is, I believe, the most common one. First of all, define a new polynomial $h = f - g$. We want to know at how many different inputs $h$ can be evaluated to $0$ without the polynomial itself being $0$. If $h$ is an $n$th degree polynomial in one variable, then you are quite correct that if $h$ is zero at $n + 1$ different points, then it has to be zero everywhere.
In the two variable case, the polynomial $h$ can be zero at an infinite number of points (as discussed above). The possibilities are still limited to a finite number of distinct curves in the plane (the "finite number" being the degree og $h$). The study of these curves is the basis of the field known as algebraic geometry.
So if you have, for instance, a polynomial of two variables and degree (no more than) $3$ that you have confirmed to be $0$ at the two coordinate axes, and the two lines $x = y$ and $x = -y$, then the polynomial has to be $0$ everywhere.
In three variables you go from checking curves to checking surfaces, and so on.
A: I'll expand on my grid idea: We will show that if a polynomial $f$ in $A[X,Y]$ with both degree in $X$ and $Y$ are at most $n$ is zero on $\Gamma=\{\ (i,j)\ |\ 0\leq i,j\leq n\ \}$, then it is zero everywhere.
It uses the fact that ${\mathbb R}[X,Y]={\mathbb R}[X][Y]$, where ${\mathbb R}[X][Y]$ is the ring of polynomials in one variable Y and coefficients in ${\mathbb R}[X]$. As a consequence, every polynomial $f$ in ${\mathbb R}[X,Y]$ with both degree in $X$ and $Y$ are at most $n$ can be written as $f=\sum_{k=0}^n a_k(X)Y^k$, where $a_k(X)$ is a polynomial of degree at most $n$ for every $k=0,\dots,n$.
Then, every $f_i=f(i,\cdot)=\sum_{k=0}^n a_k(i)Y^k$ is a (one variable) polynomial of degree at most $n$ which vanishes on $(n+1)$ points, so is zero. Hence the coefficient $a_k(i)$ are zero for any $k=0,\dots,n$ and any $i=0,\dots,n$. Since $a_k$ is itself a polynomial of degree at most $n$, then $a_k=0$ for any $k=0,\dots,n$. Finally, we have $f=0$.
It can be easily generalized to more than two variables. The grid $\Gamma$ can be deformed to adapt to a precise situation (cf. the comment of Julien Godawatta to the OP's post).  
A: I explain how the grid idea generalizes to any number of variables. Let $F$ be any field.
The Alon-Tarsi lemma, easily proved by induction by writing $f$ as a polynomial in $X_1$, says:
If $f\in F[X_1,\ldots,X_n]$ and $S_1,\ldots,S_n\subseteq F$ are such that $|S_i|>\deg_{X_i}f$ and $f$ vanishes on all of $S_1\times\ldots\times S_n$ then $f=0$.
The previous result is bettered by Alon's combinatorial nullstellensatz, that relaxes the degree condition:
Let $f\in F[X_1,\ldots,X_n]$ and choose any of its (nonzero) monomials of maximal total degree, $X_1^{t_1}\ldots X_n^{t_n}$. Let $S_i\subseteq F$ be such that $|S_i|>t_i$ for $1\leq i\leq n$. Then there exist $s_i\in S_i$ such that $f(s_1,\ldots,s_n)\neq 0$.
Actually, it is enough to take a monomial which is not majored by any other, meaning that there exists no other monomial $X_1^{r_1}\ldots X_n^{r_n}$ in $f$ such that $r_i> t_i$ for every $1\leq i\leq n$.
A: Here is the basic idea.
Same idea for polynomial in two variables. See how many coefficients they have. This is just a matter of counting. Let us say this number is $N$. Then if the polynomials match at $N$ distinct points which meet some requirements (to be explored below), then they have to be equal.
If the degree is 1, then N=3.
If degree is 2 then N=6
and so on.
Note, if you take the view of the coefficients, then the value of the polynomial at some point gives a linear equation in the coefficients. So if the $N$ points are chosen so that these are linearly independent equations, then if two polynomials match at these points, then they are equal.
I have found that choosing the grid points, so that no more than 2 are in a straight line works (I don't have a proof for this).
** Based on comment from  Michael Albanese**
I want to emphasize, that I do not have a proof and I hope someone would improve my answer. This is just the basic idea.
