Example: Solving a Differential Equation
Given the initial value problem:
\[ \frac{dy}{dx} = xy^2 - y^2, \quad y(1) = 2 \]
First, factor the right side to separate variables:
\[ \frac{dy}{dx} = y^2(x - 1) \]
Separate the variables and integrate both sides:
\[ \frac{1}{y^2} dy = (x - 1) dx \]
\[ \int \frac{1}{y^2} dy = \int (x - 1) dx \]
Perform the integration:
\[ -\frac{1}{y} = \frac{1}{2}x^2 - x + C \]
General Solution
\[ y = \frac{-1}{\frac{1}{2}x^2 - x + C} \]
Finding the Particular Solution
Apply the initial condition \( y(1) = 2 \), which means when \( x = 1 \), \( y = 2 \):
\[ 2 = \frac{-1}{\frac{1}{2}(1)^2 - 1 + C} = \frac{-1}{-\frac{1}{2} + C} \]
Solving for C:
\[ -\frac{1}{2} + C = -\frac{1}{2} \]
\[ \text{so } C = 0 \]
Particular Solution
\[ y = \frac{-1}{\frac{1}{2}x^2 - x} \]