What is a solution to the differential equation #dy/dx=x-y#?

1 Answer
Jul 10, 2016

# y = x - 1 + C/e^x#

Explanation:

#dy/dx=x-y#

not separable, not exact, so set it up for an integrating factor

#dy/dx + y =x#

the IF is #e^(int dx) = e^x# so

#e^x dy/dx + e^x y =xe^x#

or

#d/dx (e^x y) =xe^x#

so

#e^x y = int xe^x \ dx qquad triangle#

for the integration, we use IBP: #int u v' = uv - int u' v#

#u = x, u' = 1#
#v' = e^x, v = e^x#

#implies x e^x - int e^x \ dx#

#= x e^x - e^x + C#

so going back to #triangle#

#e^x y = x e^x - e^x + C#

# y = x - 1 + C/e^x#