Differential Equation Exercise 16
We want to solve the following first-order differential equation:
$$ y' + y \cos x = \cos x $$
This is a linear differential equation of the form y' + y a(x) = b(x), where \( a(x) = \cos x \) and \( b(x) = \cos x \).
It can be solved using Lagrange’s method, also known as the integrating factor method.
$$ y = e^{- \int a(x) \, dx} \; \left[ \int b(x) \, e^{\int a(x) \, dx} \, dx + c \right] $$
Substituting \( a(x) = \cos x \) and \( b(x) = \cos x \):
$$ y = e^{- \int \cos x \, dx} \; \left[ \int \cos x \; e^{\int \cos x \, dx} \, dx + c \right] $$
The integral of \( \cos x \) is its antiderivative \( \sin x \):
$$ y = e^{-\sin x} \; \left[ \int \cos x \; e^{\sin x} \, dx + c \right] $$
The integral \( \int \cos x \; e^{\sin x} \, dx \) evaluates directly to \( e^{\sin x} \):
$$ y = e^{-\sin x} \; \left[ e^{\sin x} + c \right] $$
Multiplying through by \( e^{-\sin x} \):
$$ y = e^{-\sin x} \cdot e^{\sin x} + c \, e^{-\sin x} $$
$$ y = 1 + c \, e^{-\sin x} $$
Thus, the general solution is:
$$ y = 1 + c \, e^{-\sin x} $$
That completes the solution.
