Separable Differential Equation with Initial Value?

#x^2(dy/dx)=y-xy#

Initial condition : y(-1)=-1

This is what I separated it to

#(dy/y)=(1-x)/(x^(2))dx#

After integration, I have:

#ln(y)=(-xln(x)-1)/(x)#

I know that I will have to introduce "e," but I am getting tripped up here.

Any help would be appreciated.

Thanks!

1 Answer
Jun 3, 2018

# |y| = (e^(-1/x-1))/(|x|) #

Explanation:

We have:

# x^2 \ dy/dx = y-xy # with Initial condition #y(-1)=-1#

Which we can write as:

# x^2 \ dy/dx = y(1-x) => 1/y \ dy/dx = (1-x)/x^2 #

So, as indicated, the ODE is separable, so we can "separate the variables" to get:

# int \ 1/y \ dy = int \ 1/x^2 - 1/x \ dx #

Both integrals are of standard functions, so we can directly integrate, to get:

# ln |y| = -1/x - ln |x| + A #

Using the initial condition #y(-1)=-1# we have:

# ln |-1| = -1/(-1) - ln |-1| + A => A = -1 #

Thus we have:

# ln |y| = -1/x - ln |x| + 1 #

Noting that we can write #lne=1# we get:

# ln |y| = -1/x - lne - ln |x| #

# :. ln |y| + ln |x| + lne = -1/x #

# :. ln |xye| = -1/x #

# :. |xye| = e^(-1/x) #

# :. |y| = (e^(-1/x))/(e|x|) #

# :. |y| = (e^(-1/x-1))/(|x|) #