The acid found in apples is known as malic acid. Malic acid, which is a dicarboxylic acid, is also found in wine, rhubarb and grapes. It is used as a flavoring agent to impart a tart taste to foods.
The formula for malic acid is HO2CCH2CHOHCO2H. Carl Scheele first isolated malic acid from apple juice in 1785, and it was named in 1787, based on "malum," the Latin word for apple. The sourness of green apples is due primarily to malic acid, and the flavor of rhubarb is almost pure malic acid. Malic acid is used to create the extremely sour taste in some candies.