I looked up spermaceti, the high quality oil the whalers extract from the heads of sperm whales. I was surprised by just how much of the whale was made up of the stuff.
Wikipedia says there are two theories about what it is for. The first is that it is used in echo location. Spermaceti has a higher speed of sound than water, but I don't know how that helps. In one of Melville's chapters on cetology, he talks about the whales' eyes being so far on either side of its head, that it must make forward vision rather difficult. I think he mentions the whales' ears. IIRC he says he does not think they have a sense of smell, or maybe just no nostrils. He does not seem to know about whale sonar. When I read about the harpooners blinding the whales, I thought: poor things, even if they survive the hunt they will starve and die. However, maybe they do not actually need their eyesight that much. Their eyes are relatively small while their echo location organs are huge.
Wikipedia's other theory is that the spermaceti is used for buoyancy control. By heating or cooling it, they can change its density. Counting against the theory is research that the whales do not have the biological apparatus to perform the heat exchange, and that the change of density is too low to make much of a change to buoyancy until the organ gets to a very large size. However, spermaceti would appear to be a phase change material at useful temperature. It melts and solidifies between 25°C and 35°C/ 77°C to 95°F. I am not saying we definitely should resume hunting sperm whales so we can use their spermaceti in high efficiency central heating systems; I am just airing the possibility for discussion