Solving a differential equation via variable substitution Consider the following differential equation
$$
\dot{x}(t) = f(x(t))+g(u(t)), \ \ t\ge 0,
$$
where $x(0)\in\mathbb{R}$ and $u(t)$ is an external input. Suppose that the functions $f$ and $g$ are such that the solution to the above equation exists and is unique.

Q. By means of variable substitution $x(t)\mapsto z$, is it always possible to rewrite the above equation as
  $$
t=\int_{x(0)}^{x(t)}\frac{\mathrm{d}z}{f(z)+g(\tilde{u}(z))},
$$
  where $\tilde{u}(z)$ is some suitable function depending on $z$? If not, under which conditions is it possible?

My guess is that this is false since the external term $u(t)$ cannot in general be expressed as a function of $x(t)$, but I would like to have a confirmation by someone that has more experience than me on differential equations. Many thanks!
 A: Despite what it seems, the answer to your question is affirmative outside the vanishing points and under some mild regularity conditions (customarily assumed to guarantee uniqueness of the solution) on the 1-dimensional vector field at the right side of your equation. To see why, let's consider the following Cauchy problem for a more general first order non autonomous ordinary differential equation: 
\begin{equation}
\begin{cases}
\dot{x}(t)=v(t,x) \\
x(t_0)=x_0\in \mathbb{R}
\end{cases}\tag{1}\label{1}
\end{equation}
A standard sufficient condition for the uniqueness of the solution $x(t)$ of \eqref{1} is 
$$
v\in C^1(\mathbb{R}_+\times\mathbb{R}), \tag{2}\label{2}
$$
as mentioned in [1], §2.3 p. 38, problem 5. If a non vanishing condition
$$
v(t_0,x_0)\neq 0 
$$
holds for some point $(t_0,x_0)\in\mathbb{R}_+\times\mathbb{R}$, condition \eqref{2} implies that it holds for a neighborhood $U(t_0,x_0)$ of that point, thus
$$
v(t,x)>0\, \text{ or }\,v(t,x)<0 \quad\forall (t,x)\in U(t_0,x_0).
$$
Since $v$ the first derivative of $x$ according to the equation in \eqref{1}, this implies that $x(t)$ is strictly monotonically increasing or decreasing and thus is injective and locally invertible on $U_{t_0}=\{t\in \mathbb{R}_+|(t,x)\in U(t_0,x_0)\}$, with values in $U_{x_0}=\{x\in \mathbb{R}|(t,x)\in U(t_0,x_0)\}$. 
Its inverse function 
$$
x^{-1}:U_{x_0} \to U_{t_0}
$$
is such that
$$
x^{-1}(z)=t\in U_{t_0} \text{ for } z\in U_{x_0}\iff v(t,z)=v\big(x^{-1}(z),z\big),\tag{3}\label{3}
$$
and by using it is possible to prove the following analogue of the standard Barrow's formula ([1], §1.5 p. 19):
$$
t-t_0=\int\limits_{x_0}^{x(t)}\frac{\mathrm{d}z}{v\big(x^{-1}(z),z\big)}.
\tag{4}\label{4}
$$
In your specific case, \eqref{3} leads to the following general formula for $\tilde{u}$:
$$
\tilde{u}(z)=u\circ x^{-1}(z)=u\big(x^{-1}(z)\big).
$$
A few notes


*

*Following your indication, I have left out any consideration about the existence and uniqueness of the solution to Cauchy problem \eqref{1} (and thus on your original problem): however the requirements on $v$ needed for proving existence and uniqueness play a role in deciding whether there exists or not formula \eqref{4}. Probably it is possible to prove it under even milder condition, i.e. $v\in C^{(0,1)}(\mathbb{R}_+\times\mathbb{R})$ (Lipschitz continuity).

*The above method is an adaption of the one that scholars of continuous mechanics use to make explicit the structure of some functionals by requiring their material frame indifference.


[1] Vladimir Igorevic Arnol'd, "Ordinary differential equations", various editions from MIT Press and from Springer-Verlag, MR1162307 Zbl 0744.34001.
