$$u_y(x,y) - g(y)f(x)u_x(x,y)=0$$
Charpit-Lagrange characteristic ODEs :
$$\frac{dy}{1}=\frac{dx}{- g(y)f(x)}=\frac{du}{0}$$
A first characteristic equation comes from $\frac{du}{0}\quad\implies\quad du=0\quad $ thus :
$$u=c_1$$
A second characteristic equation comes from solving $\frac{dy}{1}=\frac{dx}{- g(y)f(x)}\quad\implies\quad g(y)dy+\frac{dx}{f(x)}=0$
$$\int g(y)dy+\int\frac{dx}{f(x)}=c_2$$
The general solution of the PDE on the form of implicit equation $c_1=\Phi(c_2)$ is :
$$\boxed{u(x,y)=\Phi\left(\int_{y_0}^y g(\mu)d\mu+\int_{x_0}^x\frac{d\nu}{f(\nu)}\right)}$$
$\Phi$ is an arbitrary function (to be determined according to the specified condition).
Condition : $u(x,0)=h(x)$
We set $y_0=0$ into the above general solution without loss of generality.
$$h(x)=\Phi\left(\int_{0}^0 g(\mu)d\mu+\int_{x_0}^x\frac{d\nu}{f(\nu)}\right)$$
$$h(x)=\Phi\left(\int_{x_0}^x\frac{d\nu}{f(\nu)}\right)$$
Let $X(x)=\int_{x_0}^x\frac{d\nu}{f(\nu)}$
Supposing that $\frac{d\nu}{f(\nu)}$ is integrable and that the inverse function of $X(x)$ can be expressed on the form of $x=\Psi(X)$, then :
$$\Phi(X)=h\bigg(\Psi(X)\bigg)$$
Now $\Phi(X)$ is a known function since $\Psi(X)$ has been expressed. We put $\Phi(X)$ into the above general solution where $X=\int_{0}^y g(\mu)d\mu+\int_{x_0}^x\frac{d\nu}{f(\nu)}$
$$\boxed{u(x,y)=h\left(\Psi\left(\int_{0}^y g(\mu)d\mu+\int_{x_0}^x\frac{d\nu}{f(\nu)}\right)\right)}$$
This is the particular solution which satisfies both the PDE and the condition.
Note that obtaining the function $\Psi$ from the function $1/f(x)$ involves an integration and then an inversion which is the most difficult part of the task. The most often this is problematic. Certainly few functions $f(x)$ are nice enough to finally get an analytical result.
Comment:
One might be surprised that an arbitrary constant $x_0$ seems to remains in the final equation. As a matter of fact the final result doesn't depends on the choice of starting point $x_0$ for the integration. Try with some examples of explicit functions $f(x)$. You will obseved that $x_0$ vanishes along the process of inversion.
First : One can see directly from the PDE that $u(x,y)=$constant is a particular solution. This is also a characteristic equation $u=c_1$.
Second : $dx=dy=dz$ is not true in generaL In the present case you wrote $ 1 = \frac{dy}{ds}, \ g(y)f(x) = \frac{dx}{ds}, \ 0 = z(x(s),y(s)) .$ This is equivalent to $ds=\frac{dy}{1}=\frac{dx}{- g(y)f(x)}=\frac{du}{0}$.
Third : Yes, $\Psi$ is the inverse of $\int 1/f$ .
Fourth : $c_1=\Phi(c_2)$ is a form of general solution $F(c_1,c_2)=0$ with arbitrary functions $F$ and $\Phi$ : (meaning arbitrary relationship).
– JJacquelin Jan 23 '22 at 08:30