I am reading Principles of Ideal-Fluid Aerodynamics by Karamcheti. In section 13.10 paged 400, he says:
In cartesians we are to seek the solution of the equation
$$\frac{\partial^2 f}{\partial x^2}+\frac{\partial^2 f}{\partial y^2}=0\tag{13.20}\label{13.20}$$
where $f(x,y)$ may be either the velocity potential or the stream function. For the reasons outlined above, let us introduce a new set of coordinates $q_1$ and $q_2$ such that
$$ \begin{array}{c} q_1=q_1(x,y) \\ q_2=q_2(x,y) \\ \end{array}\tag{13.21}\label{13.21} $$
Let $g(q_1,q_2)$ correspond to $f(x,y)$. It may be verified that $\ref{13.20}$ then takes the form
$$ \begin{array}{c} \left[\left(\frac{\partial q_1}{\partial x}\right)^2+\left(\frac{\partial q_1}{\partial y}\right)^2\right]\frac{\partial^2 g}{\partial q_1^2} + \left[\left(\frac{\partial q_2}{\partial x}\right)^2+\left(\frac{\partial q_2}{\partial y}\right)^2\right]\frac{\partial^2 g}{\partial q_2^2}\\ +\left(\frac{\partial^2q_1}{\partial x^2}+\frac{\partial^2 q_1}{\partial y^2} \right)\frac{\partial g}{\partial q_1} +\left(\frac{\partial^2q_2}{\partial x^2}+\frac{\partial^2 q_2}{\partial y^2} \right)\frac{\partial g}{\partial q_2}\\ +2\left(\frac{\partial q_1}{\partial x}\frac{\partial q_2}{\partial x}+\frac{\partial q_1}{\partial y}\frac{\partial q_2}{\partial y}\right)\frac{\partial^2 g}{\partial q_1\partial q_2}=0 \end{array}\tag{13.22}\label{13.22} $$
I am trying to verify equation $\ref{13.22}$. I believe when he says "let $g(q_1,q_2)$ correspond to $f(x,y)$" that it means the following:
$$ f(x,y) = f(x(q_1,q_2),y(q_1,q_2))=g(q_1,q_2)\tag{1}\label{1}$$
Then, from here I can substitute equation $\ref{1}$ into equation $\ref{13.20}$. I think my problem starts when I try to take $\frac{\partial f}{\partial x}$ because the following seems wrong:
$$ \frac{\partial f}{\partial x}=\frac{\partial g}{\partial x}=\frac{\partial g}{\partial q_1}\frac{\partial q_1}{\partial x}\tag{2}\label{2}$$
I think I'm missing some form of the chain rule and believe $\ref{2}$ should really be something like
$$ \frac{\partial f}{\partial x}=\frac{\partial g}{\partial x}=\frac{\partial g}{\partial q_1}\frac{\partial q_1}{\partial x}+\frac{\partial g}{\partial q_2}\frac{\partial q_2}{\partial x}\tag{3}\label{3}$$
because if I make a small change in x, it may cause small changes in $q_1$ and $q_2$ as well. but I don't know how to prove this or if it is true.
Any help appreciated and thanks in advance!