A new rapid and low-cost preparation of the (3E,5Z)-3,5-alkadienyl system, encountered in several insect pheromone constituents, was developed. Knoevenagel condensation of (E)-2-alkenals with ethyl hydrogen malonate in dimethyl sulfoxide, in the presence of a catalytic amount of piperidinium acetate, led to a mixture of geometrical isomers of ethyl 3,5-alkadienoates and ethyl 2,4-alkadienoates, from which the (3E,5Z)-3,5-alkadienoate was conveniently separated, by the use of urea inclusion complex formation. The importance of this procedure has been illustrated by the preparation of the (3E,5Z)-3,5-tetradecadienoic acid (megatomoic acid) 1, the (3E,5Z)-3,5-dodecadienyl acetate 2, and the (3E,5Z)-3,5-tetradecadienyl acetate 3. These compounds are the main components of insect sex pheromones and constitute synthetic targets of considerable interest for the semiochemical community.