# Non Separative Diff-EQ problem

1. Jun 12, 2013

### ashketchumall

The problem I'm given is - I think this is a non separable equation
dy/dx=x-y ...... u=x-y
I tried Substituting, where
x-y=u
1-dy/dx=du/dx
(remember above statement u=x-y, and dy/dx=x-y)
therefore, I got 1-u=du/dx and then I solved it from there by integrating since I think once it's in this form it becomes separable. But I get the answer of

1-(e^x)+x+c=y which when I checked with wolfram differential eq calculator is a little off
the differential calculator gives me this answer c1(e^-x)+x-1

I have solved this several times now, I'm so close I just don't know where I'm making the mistake. Any help will be appreciated.

2. Jun 12, 2013

### Staff: Mentor

The separable equation is
du/(u - 1) = -dx
Integrating both sides gives
ln|u - 1| = -x + C
Exponentiating (and this is where you made your mistake, I believe) gives

|u - 1| = e-x + C = eC * e-x = C1e-x
BTW, homework-type problems should be posted in the Homework & Coursework section, not in the technical math sections. I am moving this thread now.

3. Jun 12, 2013

### LCKurtz

If you have had linear equations, just rewrite it as $y'+y = x$ and solve it with an integrating factor.

4. Jun 12, 2013

### ashketchumall

How can you do that?? I don't understand what you are saying.

5. Jun 12, 2013

### ashketchumall

I understood what you did there, but it still gives me y= -c*e^(-x)+x-1, the negative in front of the constant still technically makes the answer wrong. But Thanx for your help. I appreciate it.

6. Jun 12, 2013

### LCKurtz

Have you studied first order linear equations? If not, then you wouldn't be expected to understand. If you have studied them, perhaps you should review them.

7. Jun 13, 2013

### HallsofIvy

Staff Emeritus
It's hard to believe you are serious. Since C can be any constant, $-c e^{-x}+ x- 1$ is exactly the same solution as $c e^{-x}+ x- 1$. Just with different "c". If, for example, c= 1 in the first, then c= -1 in the second.

Last edited by a moderator: Jun 13, 2013
8. Jun 13, 2013

### HallsofIvy

Staff Emeritus
Your equation is y'+ y= x. That is "linear" and so it is simple to find an "integrating factor", a function, u(x), such that mutiplying by it makes the left side an "exact derivative", d(uy)/dx.

By the product rule, (uy)'= uy'+ u'y. Just multiplying the left side of the equation by u would give uy'+ uy. Comparing those, uy'+ u'y= uy'+ uy, reduces to u'= u which has solution $u= e^x$.

So multiplying the entire equation by $e^x$ gives [itex]e^xy'+ e^xy= (e^xy)'= xe^x.

Now just integrate both sides.