Gradient Lagrangian systems and semilinear PDE