You can treat dy/dx as though it is a function of three variables, d, x and y, and evaluate that way.