Malonic and acetoacetic syntheses
The malonic ester synthesis is a reaction in which an ester of malonic acid is alkylated at the carbon between the carbonyl groups and then converted into a substituted acetic acid by final hydrolysis and decarboxylation.

Enolate formation
The hydrogens on the carbon between the carbonyl groups are quite acidic because the negative charge of the conjugate-base carbanion is stabilized by both C=O groups. An alkoxide is enough to form the enolate completely.

Mechanism
The resulting carbanion is very nucleophilic and can perform a nucleophilic substitution on a compound with a good leaving group, such as an alkyl halide or sulfonate. The alkylated diester is then saponified and, on heating, the substituted malonic acid easily loses CO2 through a six-membered cyclic transition state, giving an alkylated acetic acid:

Think retrosynthetically! The malonic diester can be regarded as a synthetic equivalent of the −CH2COOH synthon (see the synthon).
Double alkylation
If the alkylation is done twice, the outcome is a dialkylated acetic acid:

Cycloalkanecarboxylic acids can be obtained in this way by using alkyl dihalides of different lengths: the second alkylation is intramolecular.

Meldrum’s acid

A very interesting malonate-related molecule is Meldrum’s acid, named after its discoverer (1908): it is a cyclic diester of malonic acid with acetone hydrate. Meldrum’s acid is even more acidic than malonate; its pKa, close to that of acetic acid, is due to the ring holding both carbonyls in a conformation that stabilizes the charge very well.

The resulting carbanion is also very nucleophilic and undergoes alkylation and acylation; after hydrolysis, an alkylated or acylated acetic acid is obtained (with release of acetone and CO2):


Acetoacetic ester synthesis
The acylacetates obtained from Meldrum’s acid can be used further in synthesis because, as happens with malonic derivatives and with Meldrum’s acid itself, the hydrogens on the carbon between the carbonyls are relatively acidic and the resulting anion can take part in nucleophilic reactions. The simplest one, ethyl acetoacetate, is alkylated just like malonate; depending on how the product is hydrolysed, a methyl ketone (ketonic cleavage) or an ester (acid cleavage) is obtained:

The Knoevenagel reaction
The carbanions of dicarbonyl compounds such as malonic esters, Meldrum’s acid, acetoacetates and many other related compounds can react with aldehydes or ketones, lose a molecule of water and give, after (hydrolysis and) decarboxylation, an α,β-unsaturated acid. This is the Knoevenagel condensation, named after its discoverer; it is studied in more detail in topic 7.

In the Doebner modification malonic acid itself is used in pyridine: condensation is followed by spontaneous decarboxylation and the α,β-unsaturated acid is obtained directly.

The Knoevenagel condensation of benzaldehydes with nitroalkanes is a classic general method for preparing nitroalkenes, which are very valuable synthetic intermediates (see the Henry reaction):
