# Thread: Help for solving the differential equation!!

1. ## Help for solving the differential equation!!

The Qs is to solve the differential equation:
$\frac{dy}{dx} = \frac{(x+y)}{(x-y)}$ with y(1) = 1
I have tried to use Homogeneous differential equation rules:
$\frac{dy}{dx} = H(\frac{y}{x})$
Then $y(x) = xu(x); x\frac{du}{dx} + y = H(u)$

Relative to the real Qs, my step is shown below
$\frac{dy}{dx} = \frac{x+y}{x-y} = .... = \frac{1}{1-\frac{y}{x}} + \frac{1}{[\frac{1}{(\frac{y}{x})}-1]} = H(\frac{y}{x})$
By Homogeneous differential equation rules
I got $\frac{du}{dx} = \frac{1+u^2}{(1-u)x}$
and after I antidifferentiate this equation
$arctan(u) - 0.5log(1+u^2) = log|x|+C$
after that, I don't know how to continue, please help!

2. you're making it too complicated.

note the RHS, divide top and bottom by $x$ and then put $y=ux.$

3. even I use your method the answer for du/dx won't change, and so I'll get the same solution as before, the most important thing is the step after I found du/dx.
Please provide more detail for the next step!!

4. $\frac{dy}{dx} = \frac{x+y}{x-y} = \frac{1 + \frac{y}{x}}{1 - \frac{y}{x}}$

Let $u = \frac{y}{x}$ then $dy = x \ du + u \ dx$

Now substitute the above back into the original equation.

$x \frac{du}{dx} + u = \frac{1 + u}{1 - u}$

$x \frac{du}{dx} = \frac{1 + u^2}{1 - u}$

Thus:

$\int \frac{1 - u}{1 + u^2} du = \int \frac{dx}{x}$

$\int \frac{1}{1 + u^2} - \int \frac{u}{1 + u^2} = \ln{(x)} + C$

$\arctan(u) - \frac{1}{2} \ln{(u)} = \ln{(x)} + C$

But $u = \frac{y}{x}$

$\arctan \left( \frac{y}{x} \right) - \frac{1}{2} \ln{\left( \frac{y}{x} \right)} = \ln{(x)} + C$

5. You could solve them simultaneously:

$\frac{dx}{dt}=x+y$

$\frac{dy}{dt}=x-y$

calculte eigenvalues and come up with parametric solutions which because of the complex eigenvalues are:

$x(t)=c_1 e^{t}\cos(t)+c_2e^t\sin(t)$

$y(t)=c_3 e^{t}\cos(t)+c_4e^t\sin(t)$

but the arbitrary constants are related so only have two for an IVP. It's a spirial.

6. Originally Posted by janvdl
$\frac{dy}{dx} = \frac{x+y}{x-y} = \frac{1 + \frac{y}{x}}{1 - \frac{y}{x}}$

Let $u = \frac{y}{x}$ then $dy = x \ du + u \ dx$

Now substitute the above back into the original equation.

$x \frac{du}{dx} + u = \frac{1 + u}{1 - u}$

$x \frac{du}{dx} = \frac{1 + u^2}{1 - u}$

Thus:

$\int \frac{1 - u}{1 + u^2} du = \int \frac{dx}{x}$

$\int \frac{1}{1 + u^2} - \int \frac{u}{1 + u^2} = \ln{(x)} + C$

$\arctan(u) - \frac{1}{2} \ln{(u)} = \ln{(x)} + C$

But $u = \frac{y}{x}$

$\arctan \left( \frac{y}{x} \right) - \frac{1}{2} \ln{\left( \frac{y}{x} \right)} = \ln{(x)} + C$
I think $\arctan(u) - \frac{1}{2} \ln{(1+u^2)} = \ln{(x)} + C$ should be right
But not $\arctan(u) - \frac{1}{2} \ln{(u)} = \ln{(x)} + C$
And so we'll got $\arctan \left( \frac{y}{x} \right) - \frac{1}{2} \ln{\left(1+( \frac{y}{x})^2 \right)} = \ln{(x)} + C$ finally.

Then, the thing make me confused is how to transfer this equation to y=f(x), that looks like hard. Please help!

7. Originally Posted by wsun
I think $\arctan(u) - \frac{1}{2} \ln{(1+u^2)} = \ln{(x)} + C$ should be right
But not $\arctan(u) - \frac{1}{2} \ln{(u)} = \ln{(x)} + C$
And so we'll got $\arctan \left( \frac{y}{x} \right) - \frac{1}{2} \ln{\left(1+( \frac{y}{x})^2 \right)} = \ln{(x)} + C$ finally.

Then, the thing make me confused is how to transfer this equation to y=f(x), that looks like hard. Please help!
Yes you are right. Just swap that (u) for (1 + u^2).

Normally your lecturer would not expect you to put it in the form y = f(x).