Hi,
The result looks correct to me no? if you write b = x*y.
Then f = x+y - b and df/db = -1. So df/dxy = -1.
I don’t know how you print the function? But f(x, y) and f(x, y, b) are two completely different functions so you can extrapolate from knowing the first one how the second one will behave.