I would sincerely appreciate your help on an integral-related question.
I have two real-valued functions $x(t): \mathbb{R} \rightarrow \mathbb{R}$ and $y(t): \mathbb{R} \rightarrow \mathbb{R}$, and three other functions $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ , $g: \mathbb{R}^2 \rightarrow \mathbb{R}$, $h: \mathbb{R}^2 \rightarrow \mathbb{R}$.
Case 1: I have the following equation $$\dfrac{d}{dt}f(x(t),y(t)) = g(x(t),y(t))\dfrac{dx(t)}{dt} + h(x(t),y(t))\dfrac{dy(t)}{dt}$$ How can I express $f$ in terms of $g$ and $h$?
I initially figured that I could do something like $$f(x(t),y(t)) = \int_{0}^{x(t)}g(r,y(t))\,dr + \int_{0}^{y(t)}h(x(t),s)\,ds$$ But then I realized I probably didn't correctly handle $dy/dt$ and $dx/dt$ in the first and second terms.
Case 2: In a more general case where $x(t): \mathbb{R} \rightarrow \mathbb{R}^D, f: \mathbb{R}^D \rightarrow \mathbb{R}, g: \mathbb{R}^D \rightarrow \mathbb{R}^D$, and $$\frac{d}{dt}f(x(t)) = \sum_{i=1}^D g_i(x_i(t),x_{-i}(t))\frac{dx_i(t)}{dt}$$ How can I express $f$ in terms of $g$?
Update:
I figured that for Case 1, the following might be correct $$f(x(t),y(t)) = f(x(0),y(0)) + \int_{0}^{t}g(x(r),y(r)) \frac{d x(r)}{dr} dr + \int_{0}^{t}h(x(s),y(s)) \frac{d y(s)}{ds} ds$$
Then for the more general Case 2, we have $$ f(x(t)) = f(x(0)) + \int_{0}^t \sum_{i} g_i(x_i(r), x_{-i}(r)) \frac{d x_i(r)}{dr} dr $$
Please correct my mistakes, thank you.
Too long for a comment. Some hints:
We cannot play around with the notation and derive from $$\tag{1} \frac{d}{dt}f(x,y) = g(x,y)\frac{dx}{dt} + h(x,y)\frac{dy}{dt} $$ "something like" $$\tag{2} f(x,y) = \int_0^xg(r,y)\,dr + \int_0^yh(x,s)\,ds\,. $$ I recommend to express in the notation correctly that $x,y$ are functions of $t$ (otherwise the LHS of (1) is zero) and study the tractable example $$ \frac{d}{dt}f(x,y)=f_x(x,y)\,\dot x+f_y(x,y)\,\dot y $$ that follows simply from the chain rule. In that case we have obviously $$ g(x,y)=f_x(x,y)\,,\quad h(x,y)=f_y(x,y) $$ and, quite miraculously, an equation for $f$ that does not involve the function $h\,:$ $$ f(x,y)=\int_0^x f_x(r,y)\,dr=\int_0^xg(r,y)\,dr\,. $$ To understand more general cases limit yourself to 2D and study some basic material about exact, inexact ordinary differential equations or one-forms.