Sommerfeld has given an apparent case of a perpetual motion machine of the second kind. This consists of a Carnot engine employing liquid water and operating between the normal and anomalous regions of thermal expansion. His explanation of the paradox is shown to be incomplete when the temperature of maximum density is pressure-dependent. To analyze this case a simple thermodynamic model for a substance with a density extremum is given; this model yields a reasonable approximation to the data for water. Standard thermodynamic properties of the system are computed and useful approximate forms given. Various Carnot cycles and a non-trivial "two-process" cycle are then shown in the p-T, T-s, and p-v planes. Sommerfeld's paradox is resolved by showing that a Carnot cycle qualitatively similar to that in his problem involves expansions for both isothermal processes. Theoretical implications of the analysis and applications to sound waves and shock waves are briefly discussed.