Optimizes a simple quadratic problem