We have two variables $u_{1}$ and $u_{2}$ which are functions of $x,t$. That is, $u_{1}=u_{1}(x,t)$ and $u_{2}=u_{2}(x,t)$. Consider the the system of partial differential equations $$\frac{\partial u_{1}}{\partial x}=u_{2},\\\frac{\partial u_{2}}{\partial x}=\frac{\partial u_{1}}{\partial t}.$$
Next, consider the transformation $$w_{11}=u_{1},\quad w_{12}=\frac{u_{1}}{u_{2}}.$$ We need to compute $\frac{\partial w_{1k}}{\partial x}$ for $k=1,2$.
In Mathematica my process is very manual. I am basically using Mathematica to simplify the partial derivatives that I have found using pen and paper. The code is as follows.
(*f[k] denotes the partial derivative of u[k] with respect to x*)
(*g[1] denotes the partial derivative of u[1] with respect to t*)
f[1] = u[2];
f[2] = g[1];
trans = {u[1] -> w[1, 1], u[2] -> w[1, 1] w[1, 2]};
(*Denote y[1,1] as the partial derivative of w[1,1] with respect to x*)
z[1, 1] = f[1] /. trans
(*Denote y[1,2] as the partial derivative of w[1,2] with respect to x*)
(*Denote z[1,1] as the partial derivative of w[1,1] with respect to t*)
z[1, 2] = Factor[(u[2]^2 - u[1] g[1])/u[2]^2 /. trans] /. g[1]->g[1,1]
I would like to compute the partial derivatives of $w_{1k}$ using a single code as opposed to doing it separately. I tried using the built-in function $D[\;]$, but run into problems when defining, for example, $\frac{\partial u_{1}}{\partial x}=u_{2}$ using $D[\;]$. In Mathematica:
D[u[1][x, t], x] = u[2][x, t];
Set::write: Tag D in \!\(\*SubscriptBox[\(\[PartialD]\), \(x\)]\(\(u[1]\)[x, t]\)\) is Protected. >>
I guess my main problem is how to define the system $\frac{\partial u_{1}}{\partial x}=u_{2},\;\;\frac{\partial u_{2}}{\partial x}=\frac{\partial u_{1}}{\partial t}$ in Mathematica that will allow me to use $D[\;]$. Any help/suggestions will be appreciated.