Repairing solutions in ODE

162 Views Asked by At

Recently I encounter something interesting that I hope to hear from your opinions:

Suppose we are given a ODE $\frac{dy}{dx}=y$, with no initial condition.

Naively, we divide both sides by $y$ and use the separation of variables. (This is a very typical mistake that many high school students will commit, I myself did commit such an error back then :P)

We will get a general solution: $y=A\exp(x)$. We can plot the trajectories out by varying the value of $A$.

If the initial condition is to be $y(0)=0$, then again, naively we substitute into the $y=A\exp(x)$, hence yielding $A=0$, which means $y$ is identically equals to $0$.

I know the naive steps involved are incorrect, especially the one that involves division by $y$ throughout. But at the end of the day, the general solution seems to have the ability of "repairing" this mistake by allowing $A=0$.

However, when the ODE changes to the following: $\frac{dy}{dx}=y(y-1)$. Then I encounter difficulty in "repairing" the solution. According to my working, the general solution is $y=\frac{1}{1-A\exp(x)}$. I can "repair" the mistake made for initial condition $y(0)=1$ by setting $A=0$, but I cannot "repair" the result for the initial condition $y(0)=0$.

I have a hunch that these might be related to the attracting/repelling orbits/trajectories. From the plotting of the trajectories for these two questions, I notice that those trajectories that I can "repair" the solution are repelling trajectories. Perhaps I am thinking too much.

Thank you for your suggestion.

2

There are 2 best solutions below

3
On BEST ANSWER

The first thing one should do is to notice that $y=0$ and $y=1$ are constant solutions, and that all other solutions are given by $\int\frac{dy}{y(y-1)}=\int dx$, which leads to $y=1/(1-A e^x)$ where $A \neq 0$ (this condition should follow from your integration if you are careful; when solving for $y$, there's some step where you exponentiate an arbitrary integration constant $C$ to get an arbitrary positive constant $B$, and then when you remove absolute value signs you get $A=\pm B$ which can be anything except zero).

In general you can't expect to be able to write the whole solution with one single formula. In this case you can patch it partially by allowing $A$ to be zero (since you notice that this recovers one the constant solutions that you noticed separately at the beginning): $$ y=0 \qquad\text{or}\qquad y=\frac{1}{1-Ae^x} \quad (A\in \mathbf{R}) . $$ But you might as well first replace the arbitrary nonzero constant $A$ by the equally arbitrary and nonzero constant $a=1/A$, rewrite $1/(1-(1/a)e^x)=a/(a-e^x)$, and then patch by allowing $a$ to be zero: $$ y=1 \qquad\text{or}\qquad y=\frac{a}{a-e^x} \quad (a\in \mathbf{R}) . $$ Both these ways of writing are equally valid ways of describing the set of solutions. So whether you are able to patch or not has nothing to do with repelling or attracting solutions.

0
On

As this question was referenced from Determining $y' = 1 - y^2$ generally excludes $y = \pm 1$ and the reduction to the initial condition was not mentioned in the other answer, here a late remark:


One can always try to reduce the constant to the initial condition. Or to avoid arbitrary constants, when integrating the partial fractions, use definite integrals, not indefinite integrals with arbitrary constants. Its a little more work, but the "repaired" formula appears automatically. $$ x=\int_{y_0}^y\frac{du}{u(u-1)}=\ln\frac{y-1}{y_0-1}-\ln\frac{y}{y_0} $$ transforms into $$ (y-1)y_0=(y_0-1)ye^x\iff y(y_0-(y_0-1)e^x)=y_0 \\~\\ \iff y(x)=\frac{y_0}{y_0+(1-y_0)e^x} $$ which around $x=0$ is valid for all $y_0$ and also includes the constant solutions for $y_0=0$ and $y_0=1$.