  We consider 4d and 5d N=2 supersymmetric theories and demonstrate that in
general their Seiberg-Witten prepotentials satisfy the
Witten-Dijkgraaf-Verlinde-Verlinde (WDVV) equations. General proof for the
Yang-Mills models (with matter in the first fundamental representation) makes
use of the hyperelliptic curves and underlying integrable systems. A wide class
of examples is discussed, it contains few understandable exceptions. In
particular, in perturbative regime of 5d theories in addition to naive field
theory expectations some extra terms appear, like it happens in heterotic
string models. We consider also the example of the Yang-Mills theory with
matter hypermultiplet in the adjoint representation (related to the elliptic
Calogero-Moser system) when the standard WDVV equations do not hold.
