The general solution of the differential equation dy/dx=x-y is equal to y=x-1-Ce^{-x} where C is an arbitrary constant. In this post, we will learn how to find the general solution of dy/dx =x-y.

## Solution of dy/dx=x-y

**Question:** Find the genral solution of $\dfrac{dy}{dx}$ =x-y.

**Solution:**

Let x-y=v.

Differentiating w.r.t x, we get that

$1-\dfrac{dy}{dx}=\dfrac{dv}{dx}$

⇒ $\dfrac{dy}{dx}=1-\dfrac{dv}{dx}$

So the given equation dy/dx =x-y becomes

$1-\dfrac{dv}{dx}=v$

⇒ $\dfrac{dv}{dx}=1-v$

⇒ $-\dfrac{dv}{v-1}=dx$

Integrating, $-\int \dfrac{dv}{v-1}=\int dx -K$

$-\ln |v-1|=x-K$

⇒ $\ln |v-1|=-x+K$

⇒ $v-1 =e^{-x+K}$

⇒ $x-y-1 =Ce^{-x}$ where C=e^{K} [as v=x-y]

⇒ $y =x-1-Ce^{-x}$

So the general solution of dy/dx=x-y is equal to y=x-1-Ce^{-x} where C denotes an integral constant.

**Related Topics:** How to solve dy/dx=x+y

## FAQs

### Q1: What is the solution of the differential equation dy/dx=x-y?

**Answer:** The solution of the differential equation dy/dx=x-y is given by y=x-1-Ce^{-x} where C is a constant.