# Change of variables and the partial derivative

From time to time, I suddenly get confused with a change of variables in a partial derivative.

Here, I am trying to perform a change of variables $$(x,t) \mapsto (\xi, \eta)$$ where

$$\xi = t \qquad \qquad \text{and} \qquad \qquad \eta = x+t$$

The question is, how to compute $$\frac{\partial u}{\partial t}$$ in the new coordinate system?

Intuitively, since $$\xi = t$$ (or rather $$t=\xi$$), we should have

$$\frac{\partial u}{\partial t} = \frac{\partial u}{\partial \xi}$$

However, applying the chain rule for partial derivatives, we instead get

$$\frac{\partial u}{\partial t} = \frac{\partial u}{\partial \xi}\frac{\partial \xi}{\partial t} + \frac{\partial u}{\partial \eta}\frac{\partial \eta}{\partial t} = \frac{\partial u}{\partial \xi}(1) + \frac{\partial u}{\partial \eta}(1) = \frac{\partial u}{\partial \xi} + \frac{\partial u}{\partial \eta}$$

So which one is correct?

The second one is correct. Why is the other one wrong? Well when you write $$\frac{\partial u}{\partial \xi}$$what you really are saying is $$\frac{\partial u}{\partial \xi}{\huge|}_\eta$$, i.e. taking the derivative with respect to $$\xi$$, but keeping $$\eta$$ fixed. If we do this, we are restricting ourselves to the path $$x=-t$$, where $$t$$ varies. But we wanted to represent $$\frac{\partial u}{\partial t}{\huge|}_x$$with a fixed $$x$$. So this expression fails to express the same quantity. Using the chain rule works to ensure this error does not happen.

What follows is not only the correct way to handle this issue (most of the time people resort to what are to me confusing notational abuses and artifacts from a time when it was hard to be a bit more rigorous), it's a sketch of the answer that I'd like to be given.

To simplify, in what's below I will only consider the whole spaces as domains, but it can be generalized to any open subset of these spaces.

Theorem. Let $$m, n$$ and $$p$$ be natural numbers, and $$F\colon \mathbb R^n\to \mathbb R^m$$ and $$G\colon\mathbb R^m\to \mathbb R^p$$ differentiable functions. If $$H=G\circ F$$, then $$H$$ is differentiable and for all $$X$$ in $$\mathbb R^n$$ it holds that $$(DH)_X=(DG)_{F(X)}(DF)_X \tag 1$$

Considering that $$F, G$$ and $$H$$ can be written as $$F=(f_1, \ldots, f_m),\\ G=(g_1, \ldots, g_p),\\ H=(h_1, \ldots , h_p)$$ where:

• $$f_1, \ldots, f_m$$ are real functions whose domain is $$\mathbb R^n$$ and whose partial derivatives all exist,
• $$g_1, \ldots, g_p$$ are real functions whose domain is $$\mathbb R^m$$ and whose partial derivatives all exist,
• $$h_1, \ldots, h_p$$ are real functions whose domain is $$\mathbb R^n$$ and whose partial derivatives all exist,

$$(1)$$ can be rewritten as

$$\begin{bmatrix} \partial _1h_1 & \ldots & \partial_nh_1\\ \vdots & \ddots & \vdots\\ \partial_1h_p & \ldots & \partial_nh_p \end{bmatrix}_X = \begin{bmatrix} \partial _1g_1 & \ldots & \partial_mg_1\\ \vdots & \ddots & \vdots\\ \partial_1g_p & \ldots & \partial_mg_p \end{bmatrix}_{F(X)} \begin{bmatrix} \partial _1f_1 & \ldots & \partial_nf_1\\ \vdots & \ddots & \vdots\\ \partial_1f_m & \ldots & \partial_nf_m \end{bmatrix}_X \tag{2}$$

Armed with this formulation of this standard theorem, all that's left is to look at the problem through this lens.

As I understand it you have a differentiable function $$u\colon \mathbb R^2\to \mathbb R$$, a function $$\varphi \colon \mathbb R^2\to\mathbb R^2, (x,t)\mapsto (t, x+t)$$ (which is also differentiable) and you're asked to find $$\partial _2(u\circ \varphi)$$.

Now it's easy. In the notation above we have $$m=2=n$$, $$p=1$$, $$G=u$$, $$F=\varphi$$, $$f_1\colon \mathbb R^2\to \mathbb R, (x,t)\mapsto t$$ and $$f_2\colon \mathbb R^2\to \mathbb R, (x,t)\mapsto x+t$$. Set $$H=u\circ \varphi$$ and conclude that for all $$(x,t)$$ in $$\mathbb R^2$$ it holds that \begin{align} \begin{bmatrix} \partial _1h_1 & \partial_2h_1 \end{bmatrix}_{(x,t)} &= \begin{bmatrix} \partial _1u & \partial_2u \end{bmatrix}_{F(x,t)} \begin{bmatrix} \partial _1f_1 & \partial_2f_1\\ \partial_1f_2 & \partial_2f_2 \end{bmatrix}_{(x,t)}\\ &= \begin{bmatrix} \left(\partial _1u\right)(t,x+t) & \left(\partial_2u\right)(t,x+t) \end{bmatrix} \begin{bmatrix} 0& 1\\ 1 & 1 \end{bmatrix}\\ &= \begin{bmatrix} \left(\partial _2u\right)(t,x+t) & \left(\partial _1u\right)(t,x+t)+\left(\partial_2u\right)(t,x+t) \end{bmatrix}_. \end{align}

Consider $$u(x,t)=x^2+t^2$$ and $$\xi=t, \eta=x+t$$.

Then: $$u(\xi(x,t),\eta(x,t))=(\eta-\xi)^2+\xi^2$$. We get: $$u_t=2(\eta-\xi)\cdot (\eta_t-\xi_t)+2\xi\cdot \xi_t=\\ 2(x+t-t)\cdot (1-1)+2t\cdot 1=\\ 2t,$$ which is true: $$u_t=(x^2+t^2)_t=2t.$$