Differential equation

Solve the differential equation: $$x \frac{dy}{dx} = y(3-y)$$ where x=2 when y=2, giving y as a function of x.

Can someone solve this and then explain what the second line about $x=2$, $y=2$ means?

-
Solutions of differential equations generally depend on a specified initial value. (Compare to the case of taking antiderivatives of a function: you have to write $+C$ because there is a free constant in the expression. By specifying the value of the antiderivative you want at a point, you fix that constant uniquely.) –  Willie Wong Mar 25 '11 at 22:19
The second line just tells you that $y(2) = 2$. –  Arturo Magidin Mar 26 '11 at 3:14

So you want to "solve" the initial value problem:

$\begin{cases} x y^\prime (x) = y(x)\ (3-y(x)) \\ y(2)=2 \end{cases}$.

Your ODE has a singular point in $x=0$ (for the coefficient of the $y^\prime (x)$ term vanishes), hence if the IVP has a solution it will have not to be defined in $x=0$.

Put the ODE in normal form, i.e. rewrite:

$\displaystyle y^\prime (x) =\frac{y(x)\ (3-y(x))}{x}$;

the function $f(x,y):= \frac{y (3-y)}{x}$ is of class $C^\infty$ in $(x,y)\in \Big(]-\infty ,0[\cup ]0,+\infty[\Big)\times \mathbb{R}$, hence the existence and uniqueness theorem applies and your IVP has unique local solution $y(x)$ whose graph passes through the point $(2,2)$.

The solution $y(x)$ is continuous in a neighbourhood $I_1$ of $x=2$ (because it has to be differentiable to satisfy the ODE), hence the composite function $f(x,y(x))$ is continuous in $I_1$; as $y^\prime (x)=f(x,y(x))$, then $y^\prime (x)$ is continuous in $I_1$, therefore $y(x)$ is a $C^1$ function in $I_1$. But then $y^\prime (x)$ is of class $C^1$ in $I_1$, for the composite function $f(x,y(x))$ is of class $C^1$ (apply the chain rule); therefore $y(x)$ is of class $C^2$... Bootstrapping, you see that $y(x)$ is of class $C^\infty$ in the neighbourhood $I_1$ of the initial point $2$.

Moreover, the solution $y(x)$ is also strictly increasing in a neighbourhood of $2$: in fact, $y(2)=2>0$ hence by continuity you can find a neighbourhood $I_2\subseteq I_1$ of $2$ in which $0<y(x)<3$, so:

$\displaystyle y^\prime (x)=\frac{y(x)\ (3-y(x))}{x} >0$,

thus $y(x)$ increases strictly.

Now you have all the ingredients to properly solve your problem: in fact, in $I_2$ you can divide both sides of the ODE by $y(x)\ (3-y(x))$ and rewrite:

$\displaystyle \frac{y^\prime (x)}{y(x)\ (3-y(x))} =\frac{1}{x}$;

now fix a point $x \in I_2$ and integrate both sides from $2$ to $x$:

$\displaystyle \int_2^x \frac{y^\prime (t)}{y(t)\ (3-y(t))}\ \text{d} t =\int_2^x \frac{1}{t}\ \text{d} t$

(I've introduced a dummy variable in the integrals); now the RHside gives you $\ln x -\ln 2$, hence you have to work on the LHside. Keeping in mind that $y(t)$ is strictly monotone hence invertible in $I_2$, we can make the change of variable $\theta =y(t)$: as $y(2)=2$ and $\text{d} \theta = y^\prime (t)\ \text{d} t$, you get:

$\displaystyle \begin{split}\int_2^x \frac{y^\prime (t)}{y(t)\ (3-y(t))}\ \text{d} t &= \int_2^{y(x)} \frac{1}{\theta (3-\theta)}\ \text{d} \theta \\ &=\frac{1}{3} \ln \theta - \frac{1}{3} \ln (3-\theta) \Big|_2^{y(x)} \\ &=\frac{1}{3} \left(\ln y(x) -\ln (3-y(x)) -\ln 2\right)\end{split}$.

Therefore the solution to your problem is implicitly determined by the equation:

$\displaystyle \ln \left( \frac{y(x)}{3-y(x)}\right) = \ln \frac{x^3}{4}$,

i.e.:

$\displaystyle \frac{4y(x)}{3-y(x)}=x^3$.

The latter equation is a rational algebraic equation w.r.t. $y(x)$ and can be solved with the usual tools, which yield:

$\displaystyle y(x)=\frac{3x^3}{4+x^3}$.

There is more that can be said, e.g. how the local solution $y(x)$ can be extended to a maximal solution... But that's another story.

-
another story indeed! Despite the overkill, I am grateful for a formal discussion and solution. +1 –  The Chaz 2.0 Mar 26 '11 at 13:40
@The Chaz: My two cents: I don't think it's an overkill... It is just the correct way of doing the exercise. –  Pacciu Mar 26 '11 at 15:53
This belief is evident by the nature of your answer! I'll continue to appreciate your rigor while "monkeying around" in my own way ;) –  The Chaz 2.0 Mar 26 '11 at 16:07
@The Chaz: Thank you! And watch your steps while "monkeying around" ;D –  Pacciu Mar 26 '11 at 16:25

This is easy because it's separable variables. So solve $dy/(y(3-y))=dx/x$.

-
... by integrating both sides, and then use the initial value to determine the constant of integration –  Henry Mar 25 '11 at 22:45
The method you adopted for separating variables is usually called urang-utang© method by some funny mathematicians. They mock: "People using this method whitout knowing its fomal justification (if any!) resemble Orangutans using thing to make rudimental tools and messing with them"; in fact, the method is based on a totally unformal algebraic manipulation of differentials which is hard to formalize (hence it's almost meaningless). –  Pacciu Mar 25 '11 at 23:56
@Pacciu: See this question, and in particular, Mike Spivey's answer there. –  Rahul Mar 26 '11 at 2:29
@pac its not meaningless, just leave $y'$ alone, two functions (of $x$) are equal, so are their integrals (wrt $x$). –  yoyo Mar 26 '11 at 14:31
@Rahul: Thanks for the reference, but I already know the story ;D @yoyo: There are people believing that, say, one can pass from $\frac{\text{d} y}{\text{d} x} =f(y)$ to $\text{d} y=f(x)\ \text{d} x$ by multiplying both sides by $\text{d} x$... But what's the meaning of this? How can a differential be considered as a number when it is not a number (for, it is just a symbol or a linear map)? This is what I was referring to when I wrote unformal algebraic manipulation of differentials which is [...] almost meaningless. –  Pacciu Mar 26 '11 at 15:46

This is just an Initial Value Problem. You use the techniques you know to solve for the general solution. Here is a good resource: http://tutorial.math.lamar.edu/Classes/DE/Linear.aspx. More specifically, you should look at "Separable Equations"

The general solution in this case will have one arbitrary constant. You use the I.V.P to solve for this constant.

-