You can find here 39 the lines that define tha backward of the pow functions as the pow_backward functions.
If you look for this function, you will find it here 24 with a slightly more general formula for any power.
Also remember that these always compute the backward pass. So if we have o = f(i)and then o is used to compute some loss L. it computes dL/di = dL/do * do/di. dL/do is given in the grad argument of the function.