Differential Equation Exercise 13
We aim to solve the following first-order differential equation:
$$ y' + y = x $$
This is a linear differential equation of the standard form y' + a(x)y = b(x), where \( a(x) = 1 \) and \( b(x) = x \).
To solve it, we’ll apply the Lagrange method, which provides the general solution:
$$ y = e^{-\int a(x) \, dx} \cdot \left[ \int b(x) \cdot e^{\int a(x) \, dx} \, dx + c \right] $$
Substituting \( a(x) = 1 \) and \( b(x) = x \) into the formula gives:
$$ y = e^{-\int 1 \, dx} \cdot \left[ \int x \cdot e^{\int 1 \, dx} \, dx + c \right] $$
Since \( \int 1 \, dx = x \), we obtain:
$$ y = e^{-x} \cdot \left[ \int x \cdot e^x \, dx + c \right] $$
To evaluate \( \int x \cdot e^x \, dx \), we apply integration by parts, using the identity ∫f g' = f g − ∫f' g, with \( f = x \) and \( g' = e^x \):
$$ \int x \cdot e^x \, dx = x \cdot e^x - \int 1 \cdot e^x \, dx = x \cdot e^x - \int e^x \, dx $$
Since \( \int e^x \, dx = e^x \), we now have:
$$ y = e^{-x} \cdot \left[ x \cdot e^x - e^x + c \right] $$
Distributing the exponential factor \( e^{-x} \) across the expression yields:
$$ y = e^{-x} \cdot x \cdot e^x - e^{-x} \cdot e^x + c \cdot e^{-x} $$
Recognizing that \( e^{-x} \cdot e^x = 1 \), we simplify the expression to:
$$ y = x - 1 + c \cdot e^{-x} $$
This is the general solution of the differential equation:
$$ y = x + c \cdot e^{-x} - 1 $$
And the process can be extended similarly for other cases.
