Constructing a linear first order ODE with convergent solutions. I am studying for a test and cannot figure out for the life of me how to do this problem. I need to construct a first order linear ODE in the form of $y'+p(t)y=g(t)$ such that all of the solutions of the ODE satisfy the condition that the limit as $t$ approaches infinity, $y(t)=4-t^2$.
Now I know one such solution to be $y'+(y/t)=(4/t)-3t$. I understand why that is a solution, because the general solution to the ODE is $y(t)=4-t^2+e/t$.
What I don't understand is how they came to that solution in the first place. How does one work backwards to find the ODE?
 A: Your condition on the solution is not that clear, as y(t) is clearly different from 4-t² near infinity. Close, sure, but different. So the question is : does it means that y(t)-(4-t^2) converge to 0, or that y(t)/(4-t^2) converge to 1, or another asymptotic "closeness" definition.
Assuming that it means that  $y(t)-(4-t^2)$ converge to 0, you get that $y(t) = (4-t^2)+\epsilon(t)$, with $\epsilon(t)$ that converge to $0$ at infinity
You plug it into the equation and you get :
$$-2t + \epsilon'(t) + p(t)(4-t^2) + p(t) \epsilon(t) = g(t)$$
$$ \epsilon'(t) +  p(t) \epsilon(t)  = g(t) - p(t)(4-t^2) + 2t$$
Then you say : what if $p(t) = 1$ and $g(t) - p(t)(4-t^2) + 2t = 0$, we would then have $\epsilon(t) = Ce^{-t}$ that converge indeed to 0
This is of course one possibility, and there can be many others. Note that it works not only for 4-t^2, but for any derivable function (assuming this particular definition of "closeness")

Now what if I find p(t) = 1 boring? How to spice things a little, while still getting an $\epsilon(t)$ that converge to 0?
Simple : take a function A(t) that is derivable with $\lim_{t\to +\infty} A(t) = - \infty$, and choose $p(t) = -A'(t)$ and $g(t) = -A'(t)(4−t^2)+2t$
Now the equation that verify $\epsilon$ become 
$$\epsilon'(t) - A'(t) \epsilon(t) = 0$$
Hence $\epsilon(t) = C \exp(A(t) )$, and by definition of $A$, the limit of epsilon is indeed 0.
