Can margarine be substituted for butter when boiling?

Margarine cannot be substituted for butter when boiling. Butter has a higher water content than margarine, so when it is boiled it creates a smoother and creamier emulsion. Margarine, on the other hand, is made up of mostly solid fats, so it does not emulsify as well and will result in a greasy texture when boiled. Additionally, the flavor and aroma of margarine are not as pronounced as those of butter, making it a poor substitute for boiling applications.