Hi,
Theoretically, yes.
By the argument:
d(a+ b)/dx = da/dx + db/dx
where, a = f(x) and b = g(x)
This is true for partial derivatives as well (which is generally the case in gradient computation of loss wrt an input).
Are you not getting the same values? Ofcourse, the values output by a computer will not be exactly same, but they should be nearly same.