Solve for d 2n^2d=fd+m