Formally, x and t are independent variables. As written, g is a function of x, but is not a function of t. Therefore, the meaning of (d (g (x)))/(dt) is not defined. If you mean something else, then this "else" should be written in the post in an explicit, clear and proper form.