In the classroom, maleic acid is transformed into Fumaric acid through the process of heating the maleic acid to a high temperature in a 12mol HCl solution. The heated molecule loses a water molecule and becomes an acid anhydride while in the heated solution. Once the heat is removed, the acid anhydride takes back the water molecule, but reforms as fumaric acid, the more stable isomer of butenedioic acid. This isomer is more stable because the carboxyl groups are no longer on the same side of the molecule, but are now on opposite sides, causing the molecule to become non-polar. That is why it comes out of the polar HCl solution, as a polar solvent will not dissolve a non-polar solute.