Step 3: Layer the Dish
Butter the bottom and sides of a deep baking dish generously — a 9-by-13-inch rectangular dish or a similar-sized oval gratin dish both work very well. Arrange a single, slightly overlapping layer of potato slices across the bottom of the dish, covering it completely. If you are using onion, scatter a thin, even layer of sliced onion over the potatoes. Pour approximately one-third of the seasoned cream mixture evenly over this layer, making sure every potato slice is moistened. Sprinkle with a small amount of the grated cheese — roughly a quarter of the total. Repeat this layering process: another layer of potato slices, a layer of onion if using, one-third of the cream, a scattering of cheese. For the final top layer, arrange the remaining potato slices in a neat, overlapping pattern, pour over the remaining cream, and scatter the remaining cheese generously across the entire surface. Dot the small pieces of butter across the top of the cheese layer.
Step 4: Bake Covered
Cover the dish tightly with aluminum foil, making sure the foil is pressed firmly around the edges so that steam cannot escape during the first phase of baking. Place the covered dish in the center of the preheated oven and bake for 45 minutes. During this covered phase, the potatoes steam in the cream and begin to soften, the cream begins to thicken, and the layered structure settles into itself. After 45 minutes, test for doneness by inserting a thin knife or skewer into the center of the dish — the potatoes should offer noticeably less resistance than when raw, though they do not need to be completely tender at this stage as there is more cooking time to come.