## dimension of a multivariate polynomial space

Consider the space of all polynomials in n variables of degree at most d. The dimension of that space is C(n+d,d). How do I calculate the dimension of that same space when I restrict the domain of the polynomials to the unit ball? In that case all the polynomials (sum(i=1..n) x_i^2)^p with p a natural number are identical to the polynomial 1. One professor agrees with me that you have to subtract the cardinality of the set {(sum(i=1..n) x_i^2)^p | p in N} from C(n+d,d). But in my course text (written by another professor) sais that the correct formula is C(n+d,d)-C(n+d-2,d-2)
 I think the issue is that there are actually more polynomials that "vanish" when you restrict to the unit sphere (FYI, mathematicians use the word "ball" to include the interior of the sphere, where $\sum x^2 \leq 1$). For example, if n=2 you know that x^2 + y^2 - 1 = 0 (on the unit sphere), but also, (x^2 + y^2 - 1)x = 0. In general, (x^2 + y^2 - 1)f(x) = 0 for any polynomial f(x). Since you're only looking at polynomials of degree d or less, you'll only want to f(x) to be of degree d-2 or less (so that (x^2 + y^2 -1)f(x) is of degree d or less). So the dimension of the space of "vanishing polynomials" is C(n+d-2,d-2), which is why you need to subtract this amount.
 hi, how to calculate the dimensionality of a polynomial space which has d variables and degree n? I googled but cannot find any answer. What kind of book should I read?

## dimension of a multivariate polynomial space

Just out of curiosity, does the mapping of x to f(x) have to be for all real numbers or just a particular subset?