Solve for f d=2/3*(f+g)