You’ll find hard-boiled eggs in many composed salads. There are few ingredients that are simpler, but there are few that bedevil cooks more. Theories about how to cook them abound, but, like the eggs themselves, the answer is deceptively simple.

Perhaps the most common problem with hard-boiled eggs is overcooking. That’s what happens when the yolks are pale yellow with that familiar green band around the outside. There is frequently the odor of sulfur. This is due to a reaction between traces of iron in the yolk and sulfur in the white. It happens only when the eggs have been overcooked. Perfectly cooked yolks are moist and deep orange. Needless to say, there is no chemical smell.

The second-biggest problem is cracked shells that leak yolk and white out into the cooking water. This is caused by too-rapid heating. All eggs contain an air pocket at the base (the wide, rather than the pointed, end). When this air pocket is heated, it expands. If it is heated too quickly, it more like explodes, cracking the shell.

How do you avoid these problems? There’s one very simple method. Place the eggs in a pan just big enough to hold them in a single layer. Cover them with cold water and bring them to a rolling boil. Cook for one minute, then remove them from the heat. When the water has cooled enough that you can put your hand in (about 20 minutes), the eggs will be perfectly cooked.

How does this work? It’s actually a neat bit of science. The eggs don’t overcook because you’re taking advantage of a heating curve. Rather than holding them at 212 degrees (the temperature of boiling water), you start them toward that temperature and then, before the interior reaches it, you remove them from the heat. The inside doesn’t get hotter than the perfect temperature of 160 degrees before the water cools enough to stop the cooking.

The cracking problem is avoided by heating the egg gradually by starting it in cold water. Though egg shells are remarkably fragile, they are also porous. When the air pocket is heated gradually, it expands slowly enough that the air can escape through the microscopic holes in the shell (look closely: you’ll see a trail of tiny bubbles coming from the base).

Another problem people have with hard-boiled eggs is peeling them. Again, the solution is simple: Use older eggs, such as those stored as little as a week in your refrigerator. Two things happen while an egg sits around. First, it becomes more alkaline, which results in an increase in the thin part of the egg white. Also, the air pocket gets bigger as air is absorbed through the porous shell. The combination of these things makes the egg shell easier to remove.

Some cooks claim that chilling a hard-boiled egg in an ice-water bath makes it easier to peel. But when we tested that theory with two identical eggs cooked exactly the same way, the one from the ice-water bath was actually harder to peel. Some things just can’t be fixed.