# Solve ydx+xdy=0

• Sep 30th 2010, 08:44 AM
Mppl
Solve ydx+xdy=0
solving the following diff eq:

ydx+xdy=0

a simple one indeed, i saw it as y being a partial derivative of a function U(x,y) in order to x and x being the partial derivative of the same function now in order to y, integrated found the constants and everything nice till i found the solution y=C/x which substituting back in the equation makes ydx+xdy equal to zero so its indeed a solution.
my problem is that in the prosses of solving the equation I said that the integral of ydx is yx but if i substitute y for C/x before the integral I get a different result from the one I get if i substitute after the integral, whats the explanation for that? what's wrong here?
Can somebody help me plz?
• Sep 30th 2010, 08:50 AM
Ackbeet
That's not how you integrate this DE. y is being viewed as a function of x. You have:

$\displaystyle{x\,\frac{dy(x)}{dx}+y(x)=0}.$ You can write this as

$\displaystyle{x\,\frac{dy(x)}{dx}=-y(x)},$ or

$\displaystyle{\frac{dy(x)}{y(x)}=-\frac{dx}{x}.}$ Now integrate both sides.
• Sep 30th 2010, 09:47 AM
Mppl
well I gess it can be seen in both ways, and still the result is the same...I'm not worried about the result of the diff eq, I'm pretty sure I got it right, your way I think just gives the same result. My worry is that seeing it as a derivative of a function of two variables i no longer get the same result substituting y by the result before integrating ydx and after...why is that so?
• Sep 30th 2010, 10:19 AM
Ackbeet
My guess is that switching your viewpoint to this $U$ function where $x$ and $y$ are independent variables might not be an appropriate way to think of the DE. $y$ being dependent on $x$ versus $y$ being independent of $x$ are two very different situations. I know that differentiating is different in these two viewpoints. To me, it sounds like the difference between total derivatives (regular derivatives like in Calculus I), and partial derivatives like in Calculus III. They're not the same thing. If I consider $U(x,y)$ versus $U(x,y(x)),$ and I compare the total derivatives with respect to $x$, I will get different quantities depending on which situation I have.

$\dfrac{d}{dx}\,U(x,y)=\dfrac{\partial}{\partial x}\,U(x,y),$ but

$\dfrac{d}{dx}\,U(x,y(x))=\dfrac{\partial}{\partial x}\,U(x,y(x))+y'(x)\,\dfrac{\partial}{\partial y}\,U(x,y(x)).$

I realize this is not a proof, and I wish I could be more explicit. Perhaps Krizalid or mr f or cb could weigh in on this one?
• Sep 30th 2010, 10:51 AM
Mppl
It can be diffrent but look: take U(x,y)=xy derivative in order to x is y and in order to y is x and by the deffenition of derivative follows that the derivative of U is ydx+xdy, now say U(x,y)=C which is xy=C which is Y=c/x then you know its derivative is zero so here you have ydx+xdy=0!! so it solves the equation and still I dont know why doing the reverse process now substituting y for c/x before or after the integration I get diffrent results!
• Sep 30th 2010, 10:56 AM
Ackbeet
Ok, there are some things I guess I still don't understand in what you're saying.

Quote:

by the definition of derivative it follows that the derivative of U is
Derivative with respect to what?

Quote:

then you know its derivative is zero
What is "its"? And you're taking the derivative of "its" with respect to what?

Quote:

still I dont know why doing the reverse process now substituting y for c/x before or after the integration I get diffrent results!
Could you please explain what you mean by "substituting y for c/x before the integration" means, as well as "substituting y for c/x after the integration"? Thanks!
• Sep 30th 2010, 10:58 AM
Ackbeet
Incidentally, if you view y = y(x), then

$\dfrac{dU}{dx}=y(x)+xy'(x).$

Also, you write:

Quote:

the derivative of U is ydx+xdy
Technically, you have yourself a differential there, not a derivative.
• Sep 30th 2010, 12:51 PM
Mppl
Man, the derivative of a function U of two variables is by defenition (dU/dx)*dx+(dU/dy)*dy(or if you replace dx for delta x and dy by delta y you get a linear approximation to the function, I mean, a tangent plane, so if you prefer that point of view if a function is constant its tangent plane should be horizontal, (just like a tangent line does in a one variable function))
and when i said "then you know its derivative is zero" i meant to say "then you know the derivative of U(x,y) is zero"
Well let me see, do you agree that y=c/x is the solution of the equation right?
then if you do you can replace y by c/x and then you would get that ydx (which is (dU/dx)dx) and by the solution ydx=(c/x)dx and integrating that you have that thats c*ln(x) if you choose to integrate ydx which gives us yx and now you substitute y by c/x you get that the integral = a constant! thats what I am talking about
• Sep 30th 2010, 04:11 PM
Ackbeet
Your expression $(dU/dx)*dx+(dU/dy)*dy$ is the differential, not the derivative. I would definitely agree with this equation:

$dU = (dU/dx)*dx+(dU/dy)*dy$, if $x$ and $y$ are independent.

The two terms "derivative" and "differential" are quite different.

Quote:

Well let me see, do you agree that $y=c/x$ is the solution of the equation right?
Checking:

$\displaystyle{\int\frac{dy(x)}{y(x)}=-\int\frac{dx}{x}}$

$\ln|y|=-\ln|x|+C$

$e^{\ln|y|}=e^{-\ln|x|+C}$

$y=\tilde{C}e^{-\ln|x|}=\tilde{C}e^{\ln(|x|^{-1})}=\tilde{C}\dfrac{1}{x}.$

So yes, I agree with your solution.

So, in looking at what you say later, I think you're saying that you're puzzled by the following apparent discrepancy:

$\displaystyle{\int y\,dx=\int\frac{c}{x}\,dx=c\ln|x|+\tilde{c},}$ versus

$\displaystyle{\int y\,dx=yx+\tilde{c}=\frac{c}{x}\,x+\tilde{c}=c+\til de{c},}$ right?

Well, my initial thought is that the first integral there is perfectly valid, if that's what you want to do. The second integral is invalid.

I think it comes back to what is dependent on what. $y$ is simply not independent of $x$. To integrate

$\displaystyle{\int y\,dx=yx+\tilde{c},$

you must have $y$ and $x$ be independent. But if you've already shown that $y=c/x$, then that assumption is not true.

I think that's what it comes down to. Does this clear it up a bit?
• Oct 1st 2010, 01:26 AM
Mppl
well ok you say its because y is not independent, then starting from initial problem assume that there is a function U(x,y) whose derivative in order to x is y and whose derivative in order y is x so you assume that those two variables are independent, then you try to figure what the solution is in that situation and the solution is the same but you cant substitute them like they are independent variables!!
• Oct 1st 2010, 01:27 AM
Mppl
well ok you say its because y is not independent, then starting from initial problem assume that there is a function U(x,y) whose derivative in order to x is y and whose derivative in order y is x so you assume that those two variables are independent, then you try to figure what the solution is in that situation and the solution is the same but you cant substitute them like they are independent variables (and notice that you assumed they were while solving the problem)!!
• Oct 1st 2010, 01:37 AM
Ackbeet
Yeah, this is a subtle point, I think. In going from

$\displaystyle{\int y\,dx}$ to

$\displaystyle{yx+\tilde{c},}$ you've assumed independence. However, in going from

$\displaystyle{yx+\tilde{c}}$ to

$\displaystyle{\frac{c}{x}\,x+\tilde{c},}$ you've assumed the dependence of $y=c/x.$

You can't change in mid-course like that. When you substitute in $y=c/x$ before doing the integral, you've now assumed dependence before commencing your calculations. Thus, your calculations will be consistent.

Quote:

(and notice that you assumed they were while solving the problem)
Perhaps. But I'm not sure I like that method of solution. I'm not at all sure that that method would work in other general cases. Try a few other cases, and see if you get the same result by 1. Introducing your $U(x,y)$ and assuming $y$ and $x$ are independent. 2. Solving the DE the old-fashioned way, by writing out your $dy/dx$'s and assuming $y=f(x).$