# Thread: separable first order ODE using y = vx, but all is not well

1. ## separable first order ODE using y = vx, but all is not well

Hi folks,

I am trying to solve the following ordinary differential equation. I am using the substitution y = vx to make it separable.

$\dfrac{dy}{dx} = \dfrac{(x^2 + y^2)}{x(x + y)}$ ...............(1)

so substituting $y = vx$ and $\dfrac{dy}{dx} = v + x \dfrac{dv}{dx}$ into (1) gives:

$v + x \dfrac{dv}{dx} = \dfrac{x^2 (1 + v^2)}{x^2 (1 + v)}$

such that

$\int \dfrac {(1 + v)}{(1 - v)} dv = \int \dfrac{dx}{x}$ ............... (2)

and

$- \int \dfrac{-1. dv}{(1 - v)} + \int \dfrac{v}{(1 - v)} dv = \int \dfrac{dx}{x}$

the left hand side can be split, giving:

$- \ln (1 - v) + \int \dfrac{v}{(1 - v)} dv = \ln |x| + c$ ..................(3) (c can be ln A)

Now, use substitution $w = 1 - v, \dfrac{dw}{dv} = -1$

$\int \dfrac{v}{(1 - v)} dv = \int \dfrac{(w - 1)}{w} \dfrac{dv}{dw} dw = \int dw - \int \dfrac{1}{w} dw = w - \ln |w|$

such that

$\int \dfrac{v}{(1 - v)} dv = (1 - v) - \ln (1 - v)$

from (3) we get

$- \ln (1 - v) + (1 - v) - \ln (1 - v) = \ln |x| + c$ ...................(4)

and

$- 2 \ln (1 - v) + 1 - v = \ln |Ax|$

Now using the substitution $v = \frac{y}{x}$

$1 - \dfrac{y}{x} = \ln |Ax| + 2 \ln (1 - \dfrac{y}{x} )$

which gives

$1 - \dfrac{y}{x} = \ln |Ax| (\dfrac{x - y}{x})^2$

and

$y = x(1 - \ln |Ax| (\dfrac{x - y}{x})^2 )$

this is the wrong answer. Correct is

$y = x \ln ( \dfrac{|Ax|}{(x - y)^2})$

I thought these might be equivalent forms, but I can't get them to match. Can anyone find the error?

2. ## Re: separable first order ODE using y = vx, but all is not well

\begin{align*}
- \ln |1 - v| + (1 - v) - \ln |1 - v| &= \ln |x| + c \\
-2\ln |1-v| -v &= \ln|x| + c_1 &\text{where $c_1 = c-1$, a constant} \\
v &= - \ln |Ax| - \ln 2|1-v| &\text{where $\ln A = \ln (c-1)$, a constant$^*$} \\
&= -\ln \left(|Ax|(1-v)^2\right) \\
&= -\ln \left(|Ax|\left(1-\frac{y}{x}\right)^2\right) \\
&= -\ln \left(|Ax|\frac{1}{x^2}\left(x-y\right)^2\right) \\
&= -\ln \left(\left|\frac{A}{x}\right|\left(x-y\right)^2\right) \\
&= -\ln \frac{\left(x-y\right)^2}{|A_1 x|} &\text{where $A_1 = \frac1A$} \\
&= \ln \frac{|A_1 x|}{\left(x-y\right)^2} \\
\end{align*}

$^*$ There's a possibility that we are losing some solutions here, because there are some values of $c$ that lead to a negative constant $c_1$ of which we can't take the logarithm. I'll leave that for you to unpick.

3. ## Re: separable first order ODE using y = vx, but all is not well

I think if you know what the answer is then by choosing the constants carefully, you can get there. I found the 1 term, that you absorbed into the constant, caused by answer to go off in its own direction. This means there is quite some scope for getting different answers! I see what you did and it certainly works. The problem is I cannot see what I have done wrong! Is there any way I can claim that my answer is right?

4. ## Re: separable first order ODE using y = vx, but all is not well

They are the same answer (for suitably chosen values of the constants).

$$y = x\left(1 - \ln |Ax| \left(\dfrac{x - y}{x}\right)^2 \right) \iff - \ln |1 - v| + (1 - v) - \ln |1 - v| = \ln |x| + c \iff \ln \frac{|A_1 x|}{\left(x-y\right)^2}$$

The first $\iff$ is from your working (assuming that it's correct) and the second from mine (again assuming it's correct). I have no reason to doubt either derivation although I haven't checked yours in detail (although it looks OK at a quick scan).

If you pick the same value for both constants, you will almost certainly get a different graph, because you are looking at two distinct members of the solution family.