What is the solution for the differential equation $\frac{dy}{dx} = -\frac{y}{x}, y(-2) = -2$

98 Views Asked by At

Given $\dfrac{dy}{dx} = -\dfrac{y}{x}, y(-2) = -2$

I wish to solve for $y(x)$.

Separating the variables, I have,

$\dfrac{1}{y} dy = -\dfrac{1}{x} dx$

So

$\ln(|y|) = -\ln(|x|) + c$

So

$|y| = \exp({-\ln(|x|)+ c)}) = K \exp({\ln(\dfrac{1}{|x|})}) = K\dfrac{1}{|x|}$

At this step, I am unsure how to deal with the absolute value sign. Does anyone have idea as to how to proceed?

2

There are 2 best solutions below

0
On BEST ANSWER

Note that you can solve it without absolute value $$\dfrac{dy}{dx} = -\dfrac{y}{x}, y(-2) = -2$$ $$y'x+y=0$$ $$(xy)'= 0\implies xy=K \implies K=4$$ Therefore $$y=\frac 4x$$

3
On

Per comment,

$\dfrac{1}{y} dy = -\dfrac{1}{x} dx$

So

$\ln(|y|) = -\ln(|x|) + c$

So

$|y| = \exp({-\ln(|x|)+ c)}) = K \exp({\ln(\dfrac{1}{|x|})}) = K\dfrac{1}{|x|}$

$|yx| = K \implies yx = \pm K$

At initial condition, $(-2)(-2) = \pm K \implies K = \pm 4$

Therefore, $y = \pm 4\dfrac{1}{x}$

But since the only solution that passes through $y(-2) = -2$ is $y = 4 \dfrac{1}{x}$, therefore, it is the solution of this ODE.

Is this correct? Seems I am still off.