# Homework Help: Differential Equation

1. Feb 10, 2005

### krusty the clown

I am supposed to make this equation exact and then solve it. I can do the problem, but I don't understand why I am doing what I am. Is the final answer right?

$$cos(x) dx + (1 + \frac {2}{y}) sin(x) dy = 0$$

$$M(x,y)=cos(x)$$

$$N(x,y)=(1 + \frac{2}{y}) sin(x)$$

$$\frac{\partial M(x,y)}{\partial y} = 0$$

$$\frac{\partial N(x,y)}{\partial x} = (1 + \frac {2}{y}) cos(x)$$

The integration factor is then

$$u(x)= e^{\int\frac{(1+\frac{2}{y})cos(x)}{cos(x)}dy)}=e^{y+2\ln(y)} = y^2 e^y$$

Multiplying the integration factor by both sides,

$$y^2 e^y cos(x) dx + (y^2 e^y + 2ye^y)sin(x)dy=0$$

I confirmed that this was exact, the new M(x,y) and N(x,y) are
$$M(x,y)=y^{2}e^{y}cos(x) \ \ \ N(x,y)=ye^{y}(y+2)sin(x)$$

$$g(x,y)=\int{M(x,y)dx}+g(y)=\int{(2ye^{y}cos(x)+y^{2}e^{y}cos(x))dx}+g(y)=sin(x)2ye^{y}+sin(x)y^{2}e^{y}+g(y)$$

$$N(x,y)=\frac{\partial}{\partial y}(2ye^{y}sin(x)+y^{2}e^{y}sin(x)+g(y))$$

$$=e^{y}sin(x)(2+4y+y^{2})+g'(y)$$

set this equal to N(x,y), and solve for g'(x)

$$e^{y}sin(x)(2+4y+y^{2})+g'(y)=y^{2}e^{y}sin(x)+2ye^{y}sin(x)$$

$$g'(x)=-4e^{y}sin(x) \ \ \ \ \ \ \ \ \ \\ \ g(x)=-4e^{y}sin(x)+c$$

$$g(x,y)=e^{y}sin(x)(2y+y^{2}-4)=C$$

Thanks-Erik

2. Feb 10, 2005

### faust9

Did you choose to do it the way you did, or was it prescribed to do it like that? You should be able to solve it via seperation of variables.

3. Feb 10, 2005

### krusty the clown

I was told to do it that way.

4. Feb 10, 2005

### dextercioby

Did u try to see whether your solution verifies the initial equation...?

Daniel.

5. Feb 10, 2005

### faust9

The answer looks reasonable. Take the partial of x and y then stick those into the original eqn to verify that they do indeed equal something (zero in this case). As far as not understanding what your doing its nothing more than a recipe to follow. If you look at the original eqn then you see the partial of x times some thing plus the partial of y times something to yield. The procedure used simply gives "an" answer which will work in the original question. I don't know what you are looking for other than that.

6. Feb 10, 2005

### krusty the clown

This is where I made my mistake, I inserted the partial derivative of M that I had when I checked to make sure it was exact instead of plain old M. I realized this after the internet at my school went down and I did the problem for the third time. After doing it the correct way I get the same answer as when I use separation of variables.

7. Feb 10, 2005

### krusty the clown

I am currently taking calc 3 and diff eq at the same time so I havent formally learned about partial derivatives, how would I put them back into the equation?

the answer is (I think) (y^2)(e^y)(sin(x))+c=0

partial derivative wrt y
2y(e^y)sin(x)+(y^2)(e^y)sin(x)

wrt x
(y^2)(e^y)cos(x)

At this point is there a way to combine these to get dy/dx, or am I going about this all wrong?

Last edited by a moderator: Feb 10, 2005
8. Feb 10, 2005

### dextercioby

Do you know the formula inside the theorem of implicit functions...?

Daniel.

9. Feb 10, 2005

### krusty the clown

$$\frac{dy}{dx}=-\frac{F_x}{F_y}$$

Looked this up in my book, that would do the trick

Thanks

10. Feb 10, 2005

### dextercioby

That's right.That's what i was talking about.

Daniel.

11. Feb 10, 2005

### krusty the clown

Perfect, I was able to verify that

(y^2)(e^y)(sin(x))+c=0

Thanks everybody for all your help.

Erik

12. Feb 10, 2005

### saltydog

Wait a minute. I'm not done yet . . . well, I'd like a plot. I mean, I don't want to be anoying but that's only half of it. What happens if we needed to use it? I'm going to work on it and I know you guys have school but me personally, well, it ain't done yet. Can anyone in the group suggest a way of extracting meaningful data from it? Looks like the Lambert W function you know:

$$y ye^y=k\csc(x)$$

13. Feb 10, 2005

### dextercioby

You can explicitate it on a certain interval using "arcsin":
$$x=\arcsin \frac{C}{y^{2}e^{y}}$$

Is this function u assessed with the name of Lambert...?It looks horrible... :yuck:

Daniel.

14. Feb 10, 2005

### saltydog

Thanks Daniel, that's a good start to begin analyzing it and I'll start there. It's kind of the inverse though and yes, I would like to analyze it also in terms of the Lambert W function if possible. As these functions are sometimes the solution of DDEs, perhaps this implicit function is a solution of some DDE as well. Interesting.

15. Feb 10, 2005

### dextercioby

Then,hummm...Good luck...!!

Daniel.

16. Feb 11, 2005

### saltydog

A summary

My thanks to the members of this group for helping me prepare the following report (any errors in it are solely my own):

For the ODE:

$$\cos(x)dx+(1+\frac{2}{y})\sin(x)dy=0$$

The solution is:

$$y^2e^y=k\csc(x)$$

In order to use this equation, it's best to first express it in terms of the generalized Lambert W-function. Some basics first:

The W-function is defined as the inverse of the following:

$$f(x)=xe^x=y$$

then:

$$f^{-1}(y)=x=W(y)$$

With W being the Lambert W-function for $y>-e^{-1}$

and in general if:

$$h(x)=x^ne^x=y$$

then:

$$h^{-1}(y)=nW(\frac{y^\frac{1}{n}}{n})$$

Thus the solution can be expressed as:

$$y(x)=2W(\frac{1}{2}\sqrt{k\csc(x)})$$

Note first that for the solution to be real, only x-values in which csc(x) are greater than 0 are allowed. Therefore, the domain for this function is:

$$x\in ({2n\pi},(2n+1)\pi)$$

This of course is the positive values of csc(x).

It's not supprising that the function has asymptotes at $n\pi$ since the ODE is singular at these values. This can be seen by writing the ODE as follows:

$$\frac{dy}{dx}=\frac{-\cos(x)}{\sin(x) (1+\frac{2}{y}) }$$

I've plotted a graph of the solution for k=1 and included it as an attachment.

#### Attached Files:

• ###### dif3.JPG
File size:
4.4 KB
Views:
71
17. Feb 11, 2005

### dextercioby

Nice job!!

Daniel.

18. Feb 11, 2005

### saltydog

A correction

I wish to make a correction to the above summary.

I've analyzed the ODE numerically and it seems a solution is valid throughout the reals with the exception of the singular points.

Thus a more accurate description of the solution is:

$$y(x)=2W(\frac{1}{2}\sqrt{k\csc(x)})$$

such that:

k>0 for $x\in (2n\pi,(2n+1)\pi)$

k<0 for $x\in ((2n+1)\pi,(2n+2)\pi)$

Just wish to be precise that's all.