TITLE: Partitions of $\mathbb{R}^d$ by implicit polynomial equations
QUESTION [17 upvotes]: Given a polynomial
$p(x_1,x_2,\ldots,x_d)$ 
in $d$ variables, with maximum degree $k$,
what is the maximum number of 
components of $\mathbb{R}^d$ minus $p(\ldots)=0$?
In other words, into how many pieces can an implicit 
polynomial equation partition $\mathbb{R}^d$?
For example, the following three equations partition
$\mathbb{R}^2$ or $\mathbb{R}^3$ into $3$, $4$, and $2$ pieces
respectively
(I think!):
$$x^3 y^2+x^3 -3 x^2 y -y^2 +4 x y+x=0$$
$$x^6 y^8+x^3+4 x y-y=0$$
$$x^4+3
   \left(x^2+y^4+z\right)-
\left(x^2+y^2+z^2\right)^2+y^3+z^5 + 2 xy=3$$

   

Of course the answer is $k+1$ in $\mathbb{R}^1$.
I suspect this is well known for $\mathbb{R}^d$; 
if so, I would appreciate a pointer.  Thanks!
Update. Greg Martin's idea (from the comments), using the 5th Chebyshev polynomial of the first kind:

         

As Aaron Meyerowitz points out, here the degree $k=10$, and the plane is partitioned into $28$ pieces. But using Pietro Majer's line-arrangement idea leads to (now corrected:) $56$ pieces for a degree $10$ polynomial.

REPLY [7 votes]: A slightly more general result -- namely on the number of connected components of the non-zeros of a polynomial, restricted to the zeros of another polynomial -- where the degrees of the two polynomials could be different, can be deduced from the main theorem in the paper titled  
"Refined Bounds on the Number of Connected Components of Sign Conditions on a Variety" by Barone and Basu, 
DISCRETE & COMPUTATIONAL GEOMETRY
Volume 47, Number 3 (2012), 577-597, DOI: 10.1007/s00454-011-9391-3
Note that this is a bound only on the number of connected components and not on he higher Betti numbers. I don't know if the added generality is helpful to the original poster.