  We study four dimensional N=2 G_2 supersymmetric gauge theory on R^3\times
S^1 deformed by a tree level superpotential. We will show that the exact
superpotential can be obtained by making use of the Lax matrix of the
corresponding integrable model which is the periodic Toda lattice based on the
dual of the affine G_2 Lie algebra. At extrema of the superpotential the
Seiberg-Witten curve typically factorizes, and we study the algebraic equations
underlying this factorization. For U(N) theories the factorization was closely
related to the geometrical engineering of such gauge theories and to matrix
model descriptions, but here we will find that the geometrical interpretation
is more mysterious. Along the way we give a method to compute the gauge theory
resolvent and a suitable set of one-forms on the Seiberg-Witten curve. We will
also find evidence that the low-energy dynamics of G_2 gauge theories can
effectively be described in terms of an auxiliary hyperelliptic curve.
