Reconstructing an ODE From Its Solution I am trying to understand how precisely we can reverse engineer an ordinary differential equation from a function.
First, suppose we are given only a general solution with arbitrary constant(s) to work with.  One example would be the general solution $y = Ae^{-2x} + Be^{3x}$.  In this example, there are two unique values of $\lambda$, $-2$ and $3$, and thus one unique characteristic equation, $\lambda^2 - \lambda - 6 = 0$, implying the ODE $y'' - y' - 6y = 0$.  If the solution had an extra term, i.e. $y = Ae^{-2x} + Be^{3x} - e^x$, we could perform the above analysis, and then plug $-e^x$ into the LHS of the ODE to find its inhomogeneous term, in this case $6e^x$, yielding the ODE $y'' - y' - 6y = 6e^x$.  This seems to suggest that $y'' - y' - 6y = 6e^x$ is the only linear ODE with constant coefficients to have the solution $y = Ae^{-2x} + Be^{3x} - e^x$.  However, it's unclear whether or not there are other types of ODEs, where the model of a characteristic equation doesn't apply, which could have the same solution.
On the other hand, consider an investment where interest and deposits are continuous and can vary as functions of time (or stay fixed as a special case), modeled by $P' = r(t)P + D(t)$, where $P$ is the balance at time $t$, $r$ is the rate of interest, and $D$ is the rate of deposit.  Intuitively, it seems that if I give you my balance as a function of time, $P$, you should be unable to mathematically separate $P$ into a unique interest-deposit pair, $r$ and $D$.  There should be a theoretically infinite number of ways to "distribute" a balance function between an interest function and a deposit function (perhaps finite in light of practical considerations, i.e., discrete divisibility of currency), despite the ODE relating them even being linear.  Perhaps this is because an intuitively construed balance function is a particular solution to an IVP, whereas the prior example considered general solutions.
On still another hand, this professor's language seems to imply that there is a single ODE which functions such as $y = sin(5t)$ satisfy, even though such a function is a particular solution with no arbitrary constants (the professor's $5$ was an $n$, but that had a different meaning).
I'm a bit fuzzy on all of this.  Given which of the following resources can a unique ODE be reconstructed, and how is it done?


*

*General Solution

*Particular Solution to IVP

*General Solution + Particular Solution to IVP

*Particular Solution to IVP + Initial Condition


Do any of these cases change if the ODE is restricted to be linear?
 A: Let's do the simpler case of a first-order equation. Consider a function of two variables $g(\alpha, x)$, where we will consider $\alpha$ as the parameter and $x$ the independent variable of our differential equation.  We want a function $f(x,y)$ such that $y = g(\alpha, x)$ is the general solution of the differential equation $\dfrac{dy}{dx} = f(x, y)$.  That is, we want
$$ \dfrac{\partial}{\partial x} g(\alpha, x) = f(x, g(\alpha, x))$$
If the right side of the differential equation is to be a smooth function of $x$ and $y$ and to give all the solutions, the existence and uniqueness theorem applies, so the function $\alpha \to g(\alpha, x)$ should be one-to-one and onto.  Thus there should be a function $A(x,y)$ such that $A(x,g(\alpha,x))=\alpha$.  Taking the partial derivative of this with respect to $x$ gives us
$$ A_1(x, g(\alpha,x)) + A_2(x,g(\alpha,x)) \dfrac{\partial }{\partial x} g(\alpha, x)= 0$$
(where $A_1$ and $A_2$ are the partial derivatives of $A$ with respect to the first and second variables), i.e. our differential equation can be
$$ \dfrac{dy}{dx} = - \frac{A_1(x,y)}{A_2(x,y)} $$
Similarly, consider a function of three variables $g(\alpha, \beta, x)$, and suppose we want $y = g(\alpha, \beta, x)$ to be the general solution of a second-order equation.  It should be possible in principle to solve
the equations $y = g(\alpha, \beta, x), \; y' = \partial g(\alpha,\beta,x)/\partial x$ for $\alpha$ and $\beta$ in terms of $x, y, y'$.
Thus there should be a function $A$ such that $\alpha = A(x, g(\alpha,\beta, x), \partial g(\alpha, \beta, x)/\partial x)$.  Taking the partial derivative of this equation with respect to $x$, we get
$$ A_1(x,g(\alpha, \beta, x), \partial g(\alpha,\beta,x)/\partial x) + A_2(x,g(\alpha, \beta, x), \partial g(\alpha,\beta,x)/\partial x) \dfrac{\partial g(\alpha,\beta, x)}{\partial x} +
A_3(x,g(\alpha, \beta, x), \partial g(\alpha,\beta,x)/\partial x)
\dfrac{\partial^2 g(\alpha, \beta, x)}{\partial x^2} = 0$$
so the differential equation can be
$$ y'' = -\frac{A_1(x,y,y') + A_2(x,y,y') y'}{A_3(x,y,y')} $$
For example, suppose the general solution is to be 
$$y = g(\alpha, \beta, x) = \frac{x}{\alpha + \beta x}$$
Note that $$\frac{\partial g}{\partial x}= \frac{\alpha}{(\alpha + \beta x)^2}$$
The equations $$y =  \frac{x}{\alpha + \beta x},\ y' = \frac{\alpha}{(\alpha + \beta x)^2}$$
can be solved for $\alpha$ and $\beta$ as
$$ \alpha = \frac{x^2 y'}{y^2},\ \beta = \frac{1}{y} - \frac{x y'}{y^2} $$
so we get $$A(x,y,y') = \frac{x^2 y'}{y^2},\ A_1 = \frac{2x y'}{y^2},\ A_2 = -\frac{2x^2 y'}{y^3}, \ A_3 = \frac{x^2}{y^2}$$
and the differential equation (after some simplification) is
$$y'' = \frac{2  (x y' - y) y'}{xy} $$
