## Solving the Differential Equation (x + 2y) dy/dx = 2x - y

This article will guide you through the process of solving the first-order differential equation (x + 2y) dy/dx = 2x - y. We'll use the method of **integrating factors** to achieve this.

### 1. Rearranging the Equation

First, let's rearrange the given equation to put it in a standard form:

**(x + 2y) dy/dx = 2x - y**

This can be rewritten as:

**dy/dx + (y/(x + 2y)) = (2x)/(x + 2y)**

### 2. Identifying the Integrating Factor

Now, we can identify the integrating factor (IF). The equation is in the form:

**dy/dx + P(x)y = Q(x)**

Where:

- P(x) = 1/(x + 2y)
- Q(x) = 2x/(x + 2y)

The integrating factor is calculated as:

**IF = exp(∫P(x) dx)**

**IF = exp(∫(1/(x + 2y)) dx)**

**IF = exp(ln|x + 2y|)**

**IF = x + 2y**

### 3. Multiplying by the Integrating Factor

Multiply both sides of the rearranged equation by the integrating factor (x + 2y):

**(x + 2y)(dy/dx) + (x + 2y)(y/(x + 2y)) = (x + 2y)(2x/(x + 2y))**

Simplifying, we get:

**(x + 2y)dy/dx + y = 2x**

### 4. Integrating Both Sides

Now, we can integrate both sides with respect to x:

∫[(x + 2y)dy/dx + y] dx = ∫2x dx

The left side can be simplified using the product rule for differentiation:

d/dx[(x + 2y)y] = 2x

Integrating both sides:

**(x + 2y)y = x² + C**

Where C is the constant of integration.

### 5. Solving for y

Finally, we can solve for y:

**y(x + 2y) = x² + C**

**2y² + xy - x² - C = 0**

This equation represents the **general solution** to the given differential equation.

### Conclusion

We have successfully solved the differential equation (x + 2y) dy/dx = 2x - y using the method of integrating factors. The solution is expressed as an implicit equation involving y and x.