just remember to attach y' = dy/dx when you differentiate a y-term, since you are taking the derivative of y with respect to x. when we are taking the derivative of an x-term, we don't have to attach anything, since we would have dx/dx which cancels to 1. also note that we differentiate xy by the product rule
we want the slope to be -1, so set and solve for the resulting function