Differential Equation - Exercise 5
We want to solve the differential equation:
$$ y' + x y = 0 $$
This is a first-order differential equation because the highest derivative of the unknown function is the first derivative \( y' \).
It is also a linear differential equation.
We can solve it in two equivalent ways.
Method 1 - Separation of Variables
We can solve the equation using the separation of variables technique.
Starting with:
$$ y' + x y = 0 $$
Rewrite \( y' \) as \( \frac{dy}{dx} \):
$$ \frac{dy}{dx} + x y = 0 $$
Separate the variables \( x \) and \( y \):
$$ \frac{dy}{dx} = -x y $$
$$ \frac{dy}{y} = -x \, dx $$
Integrate both sides:
$$ \int \frac{dy}{y} = \int -x \, dx $$
$$ \ln|y| = -\frac{x^2}{2} + C $$
Exponentiate both sides to isolate \( y \):
$$ y = e^{-\frac{x^2}{2} + C} $$
Since \( e^C \) is just a constant, we can write:
$$ y = C \, e^{-\frac{x^2}{2}} $$
This is the general solution to the equation.
Method 2 - Integrating Factor (Lagrange’s Method)
The equation is of the standard first-order linear form \( y' + a(x) y = b(x) \), with \( a(x) = x \) and \( b(x) = 0 \):
$$ y' + x y = 0 $$
The general solution is given by:
$$ y = e^{-\int a(x) \, dx} \left[ \int b(x) \, e^{\int a(x) \, dx} \, dx + C \right] $$
Substitute \( a(x) = x \) and \( b(x) = 0 \):
$$ y = e^{-\int x \, dx} \cdot C $$
Since \( \int x \, dx = \frac{x^2}{2} \), we get:
$$ y = C \, e^{-\frac{x^2}{2}} $$
Thus, the general solution is:
$$ y = C \, e^{-\frac{x^2}{2}} $$
Both methods lead to exactly the same result, confirming its correctness.
