Preheat the oven to 375°F (190°C).
Grease a baking dish with butter.
Slice the potatoes thinly, about 1/8 inch thick.
In a bowl, mix heavy cream, garlic, salt, and pepper.
Layer half of the sliced potatoes in the baking dish.
Pour half of the cream mixture over the potatoes.
Sprinkle with half of the cheddar and Parmesan cheese.
Repeat layers with the remaining potatoes, cream, and cheese.
Cover the dish with foil and bake for 45 minutes.
Remove foil and bake for an additional 15 minutes until golden and bubbly.