derivative of (w-3)^2 with respect to w