This is a confusing problem because of bad notation.
It is given that is a function whose domain is , but whose value only depends on . So what is meant, really, is that there is a function such that .
Now by , what is meant is , where is the usual derivative
Essentially, you just have to take the gradient on both sides of the equation relating to , using the chain rule.