# How do I integrate dy/dx = x - y please ?

Asked on by reflex

hala718 | High School Teacher | (Level 1) Educator Emeritus

Posted on

dy/dx = x - y

Use substitution:
v = x - y
Differentiate with respect to x
dv/dx = 1 - dy/dx
dy/dx = 1 - dv/dx

Now we use above substitutions in differential equations
dy/dx = x - y
1 - dv/dx = v
dv/dx = 1 - v
dv/(1-v) = dx

Now integrate both sides:

intg dv/(1-v) = intg dx

-ln (1-v) = x+c

ln(1-v) = -x - c

1 - v = e^(-x-c) = [e^(-x)][e^(-c)]

1 - v = (C)e^(-x)   ,  where C = e^(-Cc)

1 - (x - y) = (C)e^(-x)

y - x + 1 = (C)e^(-x)

y = (C)e^(-x) + x - 1

Here is an example with a similar problem.

neela | High School Teacher | (Level 3) Valedictorian

Posted on

dy/dx = x-y is a differential equation. so you have to solve the differential equati

Solution :

We rewrite the equation as:

dy/dx+1*y = x. So the integrating factor is    e power Int dx = e^x..

Therefore ,

ye^x = Int (xe^x) dx = xe^x - Int (x)' e^x dx = xe^x- e^x +C . Or

y e^x = (x-1)e^x +C

neela | High School Teacher | (Level 3) Valedictorian

Posted on

dy/dx = x-y is a differential equation. so you have to solve the differential equati

Solution :

We rewrite the equation as:

dy/dx+1*y = x. So the integrating factor is    e power Int dx = e^x..

Therefore ,

ye^x = Int (xe^x) dx = xe^x - Int (x)' e^x dx = xe^x- e^x +C . Or

y e^x = (x-1)e^x +C

We’ve answered 317,871 questions. We can answer yours, too.