When solving an ODE it is very common to get factors like $e^C$ where $C$ had been an arbitrary constant. Then, if one is being rigorous, $e^C$ could be replaced by $A$ where $A>0$. However, in the end, it seems like it usually turns out that the constant, in the end, can be any real number.
If helpful, let's see a full example. Let's solve $y'=-2y$ via separation of variables. We have $$ \begin{align*} \int \frac{dy}{y} &= \int -2 dt\\ \ln|y|&=-2t+C \\ |y| &= e^{-2t+C} \\ |y| &= e^Ce^{-2t} \end{align*} $$
At this point we can replace $e^C$ with $A$ where $A$ is an arbitrary constant greater than zero. But since $|y|=d$ in general means $y=\pm d$ we have that $y=\pm Ae^{-2t}$. But then it turns out that $y=0$ is a solution (which we implicitly lost when we divided by $y$ in the first step), so in the end we can just write $y=Ce^{-2t}$ where $C$ is, as usual, any real number.
From the perspective of a student, I think it is annoying to be told to be careful tracking the constant when in the end all the examples always end up involving a constant of any sign. I am using a number of textbooks as a reference in the ODE course I am teaching, and I have yet to find one that motivates carefully following the constraints on a constant by showing an example where there are ultimately restrictions on the constant, and I find this lack of a motivating example quite surprising!
So here is my question, what is an example of a 1st order ODE (ideally solvable via separation of variables) where there is a restriction on the constant in the general family of solutions?
edit
A couple of things, first in relation to Chan Hee's answer, to be more explicit I really would like an example where clear restrictions on the parameter $C$ arise during separation of variable rather than inspection of the final solutions. Admittedly, this might just be splitting hairs.
In your example, unless I am missing something, the restrictions only come up by inspection of your final answer. In fact, from the student perspective I think it would be natural to square everything where you left your answer and then it would be tempting to think there are no possible issues for and $C$ when looking at $y=(-2x^2+c)^2$.
If it helps explain what I am looking for, I want an example that illustrates to the students that we should take the time to keep track of things like that $e^C$, for any real number $C$ can be replaced with $A$ where $A>0$, and that in the end we actually get a family of solutions with such a restriction, e.g. the constant must be positive, or cannot be 0 or something like that. So ideally, I would love an example that involves $e^C=A>0$ and that it turns out that the solutions really does only involve this $A>0$. I upvoted your answer, but I didn't accept it because I'm hoping to get an example like this.
Finally, @Angel, I enjoyed the discussion from your answer and I'm sad you deleted it (or somebody deleted it?). For one thing, it never occurred to me that an antiderivative of 1/x could be defined piece-wise with constants of different signs. For a second thing, I never got to know your final opinion. Do you agree that separation of variables only requires an antiderivative, rather than the most general antiderivative?