First order linear differential equation

JoeTrumpet
Messages
43
Reaction score
0

Homework Statement


Solve this differential equation:
(y^2 +1)*dx + (2xy + 1)*dy = 0


Homework Equations


dy/dx + P(x)*y = Q(x)
u(x) = e^(integral of P(x)dx)
(d/dx)(u(x)*y) = Q(x)*u(x)
y = (integral of (Q(x)*u(x)dx))/(u(x)


The Attempt at a Solution


I tried dividing by dx then distributing and rearranging to get it into the right form, but run into problems:
y^2 + 1 + 2xy*dy/dx + dy/dx = 0
dy/dx + y/2x = (-1/(2xy))(dy/dx) -1/(2xy)

this is the closest I could get it to the right form. It would give me u(x) = x^(1/2), but I wouldn't be able to integrate the right side as it would have both x and y. Is there a way to get past this, or did I just rearrange poorly? I just integrated it anyway and the part that was integrated with respect to x I held y as constant, and vice versa, but I'm sure it's wrong so I won't show how I did that. This is for a calc II class so it should be doable without any advanced tricks.

thanks!
 
Physics news on Phys.org
That's an exact differential. You should show us how you did it wrongly by integrating. Because you should be able to do it that way.
 
that's interesting. We haven't done exact differentials as far as I know, but since I don't know what that means perhaps we have!

dy/dx + y/2x = (-1/(2xy))(dy/dx) -1/(2xy)
using u(x) = x^(1/2)

integral of ((d/dx)(y*x^(1/2))dx) = integral of (-1/(2*x^(1/2)*y)(dy/dx)(dx)) - integral of (-1/(2*x^(1/2)*y)(dx))

I integrated with respect to y for the first one on the right side, treating x as a constant, and integrated with respect to x on the right side, holding y constant, to get:

x^(1/2)*y = -1/(2*x^(1/2))*ln(abs(y)) - (x^(1/2))/y + C
y = -1/(2*x)*ln(abs(y)) - 1/y + C/(x^(1/2))
 
Another way to about doing this is to consider what d/dx( xy2) works out to be i.e. d(xy2)
 
JoeTrumpet said:
that's interesting. We haven't done exact differentials as far as I know, but since I don't know what that means perhaps we have!

dy/dx + y/2x = (-1/(2xy))(dy/dx) -1/(2xy)
using u(x) = x^(1/2)

integral of ((d/dx)(y*x^(1/2))dx) = integral of (-1/(2*x^(1/2)*y)(dy/dx)(dx)) - integral of (-1/(2*x^(1/2)*y)(dx))

I integrated with respect to y for the first one on the right side, treating x as a constant, and integrated with respect to x on the right side, holding y constant, to get:

x^(1/2)*y = -1/(2*x^(1/2))*ln(abs(y)) - (x^(1/2))/y + C
y = -1/(2*x)*ln(abs(y)) - 1/y + C/(x^(1/2))

Not quite. You are looking for a solution of the form f(x,y)=C. The differential of f is (df/dx)*dx+(df/dy)*dy (the derivatives are partial). So you are looking for a function such that df/dx=(y^2 +1) and df/dy=(2xy + 1). Like rock.freak667 points out, you could probably guess the answer.
 
Oh, I think I know what to do then. I can flip my strategy around and solve for x instead:

(y^2 +1)*dx + (2xy + 1)*dy = 0
dividing by dy, distributing, and rearranging:
dx/dy + 2x/y = - 1/y^2 - (1/y^2)*dx/dy

therefore u(y) = e^(2*lny) = y^2

so

(d/dy)((y^2)*x) = -1 - dx/dy
integrating with respect to y
(y^2)*x = -y - x + C

Is this correct? Also, a question regarding my last integration with respect to y: when I integrate (dx/dy)*dy, I'm told that in situations like this "the dy's don't actually cancel out, but you can treat it as such." What *actually* happens then?

Thanks for the help!
 
You've got the right answer. f(x,y)=x*y^2+x+y=C. So (df/dx)*dx+(df/dy)*dy=0. I'm a little confused by your last question. If you are integrating dy, then C could be any function of x. But if you differentiate d/dx and d/dy, you can figure out what it is, right?
 
Oh, sorry, for my last question I meant regarding the step where I integrated

integral of (-1-(dx/dy))dy

I integrated by "distributing" the dy and "cancelling" it out on the right side to get

int(-dy - dx)
-y - x

The step where I simplified (dx/dy)*dy to dx is what I was asking about. I remember hearing that technically that's not allowed, but it works out because it implies that you're actually doing something else, I think with substitution. I was wondering what implied substitution I was doing so I can more readily understand the integration (we've never worked with multiple variables before so it's a very new to me).
 
(dx/dy)*dy IS dx. Technically, it's not allowed to deal with 'infinitesimal' quantities at all, since they aren't 'real' numbers. But that's a technicality. Do it anyway. Everybody else does.
 
  • #10
http://stuff.bsodmike.com/Integral%20for%20an%20Exact%20Equation%20(1st%20Order%20ODEs).jpg

This would probably a more organised method of arriving at the solution. What is also nice, is that you can test for the condition that it is an exact differential.
 
Last edited by a moderator:
Back
Top