Preheat your oven to 400°F (200°C).
Peel and chop the potatoes, then boil them in salted water until tender.
In a skillet, melt 2 tablespoons of butter and sauté the chopped onion until translucent.
Mash the potatoes, then mix in the sautéed onions, remaining butter, salt, pepper, and milk until smooth.
Add the beaten egg to the mixture, stirring well to combine.
Pour the potato mixture into the prepared pie crust, smoothing out the top.
Bake for 30-35 minutes or until the top is golden brown.
Allow the pie to cool for a few minutes before slicing.