The solution is the malonic ester synthesis:
Intramolecular malonic ester synthesis occurs when reacted witha .
It is a common reaction using dialkyl malonates, mostly , as starting material, and is known as malonic ester synthesis. The reaction mechanism shows that the reaction proceeds via the participation of the α-methylene protons of dialkyl malonates, which usually undergo nucleophilic substitutions and nucleophilic additions. It has been found that the alkylation rate is related to the acidity of α-proton. During the alkylation of malonic acid ester, the reversible cleavage of formed alkyl malonic acid ester or dialkyl malonic acid ester gives a simple alkyl ester. These alkylated malonic acid esters are used to synthesize barbiturates. The reaction has been modified for traceless synthesis on solid support and after the desired reaction, one of the ester groups can be removed. This reaction has been found useful in organic synthesis.
Malonic ester synthesis - Wikipedia
An improved procedure for the preparation and purification of labeled fatty acids by malonic ester synthesis has been developed. This method uses the different hydrolysis rates of the monoalkylmalonic ester intermediate and its dialkylmalonic ester side product. A convenient GC-MS monitoring technique allows performing this 3-step procedure without isolation of intermediates and gives a good yield.