Let $D \subseteq \mathbb{R}^{2}$ be a simply connected domain. Furthermore, let $f, g: D \longrightarrow \mathbb{R}$ be two continuously differentiable functions with $ \frac{\frac{\partial}{\partial y} g(x, y)-\frac{\partial}{\partial x} h(x, y)}{h(x, y)}=f(x) $ for all $(x, y) \in D$.
- show that $ \mu(x):=\exp \left(\int f(x) \mathrm{d} x\right) $ is an integrating factor.
- under what conditions is there an integrating factor that depends only on y and what is it?
The theory says that for an ordinary differential equation of the form $p(x, y)+q(x, y) \frac{\mathrm{dy}}{\mathrm{dx}}=0$, which does not fulfil the integrability condition $\frac{\partial p}{\partial y}=\frac{\partial q}{\partial x}$, there is (under certain regularity conditions) always a zero-free continuously differentiable function $\mu(x, y) \neq 0$ such that $$ \mu(x, y) p(x, y)+\mu(x, y) q(x, y) \frac{\mathrm{d} y}{\mathrm{~d} x}=0 $$ becomes an exact differential equation.
Edit 2 (answer from Salamo):
So I have to show the reverse direction of the following: $$ \frac{\partial(\mu g)}{\partial y}=\frac{\partial(\mu h)}{\partial x} $$ also with product rule $$ \mu \frac{\partial g}{\partial y}+g \frac{\partial \mu}{\partial y}=\mu \frac{\partial h}{\partial x}+h \frac{\partial \mu}{\partial x} $$ or slightly rewritten $$ \frac{1}{\mu}\left(h \frac{\partial \mu}{\partial x}-g \frac{\partial \mu}{\partial y}\right)=\frac{\partial g}{\partial y}-\frac{\partial h}{\partial x} . $$
If $\mu$ now only depends on $x$, this becomes $$ \frac{1}{\mu} \frac{d \mu}{d x}=\frac{1}{h}\left(\frac{\partial g}{\partial y}-\frac{\partial h}{\partial x}\right)=: f(x) . $$
Due to $\frac{1}{\mu} \frac{d \mu}{d x}=\frac{d}{d x} \log \mu$, it then follows that $\mu(x)=\exp \left(\int f(x) d x\right)$.
But now it is still unclear to me how to solve the second part of the problem regarding the y?
Substituting $\mu(x)=\exp\left(\int f(x)\, dx\right)$ into $$ \frac{\partial (\mu g)}{\partial y}=\frac{\partial (\mu h)}{\partial x}\tag{1} $$ yields $f(x)h(x,y)=\frac{\partial g}{\partial y}-\frac{\partial h}{\partial x}$ which holds by definition of your $f(x)$. Thus, $\mu(x)$ is an integrating factor for your differential equation.
As to the second task, note that $(1)$ is equivalent to $$ \frac{1}{\mu(x,y)}\left(h(x,y)\frac{\partial\mu(x,y)}{\partial x}-g(x,y)\frac{\partial\mu(x,y)}{\partial y}\right)=\frac{\partial g(x,y)}{\partial y}-\frac{\partial h(x,y)}{\partial x}\tag{2}. $$ Assume that $\mu=\mu(y)$. This will give you a right-hand side which depends on $y$ only, call it $q(y)$. Then, $\mu(y):=\exp\left(\int q(y)\, dy\right)$ is your integrating factor.