Solve (y- a(y))^2 + c da(y)/dy = r