I am going over a question, for which I know the answer, but I could not figure out how to get to that.
I am given the line element $ds^2=dx^2-dy^2=dudv$ and I must find the coordinate transformation $u=u(x,y)$ and $v=v(x,y)$.
The answers are $u=x-y$ and $v=y+x$.
I tried with derivatives and using the chain rule, but I was not able to get to the final answer.
The obvious relations $$ \frac{\partial u}{\partial x}=1\,,\quad \frac{\partial u}{\partial y}=-1\,,\quad\frac{\partial v}{\partial x}=1\,,\quad\frac{\partial v}{\partial y}=1 $$ give (using the chain rule) that $$ \frac{du}{dx}=1-\frac{dy}{dx}\,,\quad\frac{du}{dy}=\frac{dx}{dy}-1\,,\quad\frac{dv}{dx}=1+\frac{dy}{dx}\,,\quad\frac{dv}{dy}=\frac{dx}{dy}+1 $$ hold.
These relations can be written as $$ du=dx-dy\,,\quad dv=dx+dy\,,\quad\text{ or, }\quad dx=\frac{du+dv}{2}\,,\quad dy=\frac{dv-du}{2}\,. $$ Therefore, $$ ds^2=dx^2-dy^2=du\,dv\,. $$