Differential Equation Exercise 25
We want to solve the differential equation
$$ y' + \frac{1}{x} y = \frac{\sin x}{x} $$
This is a first-order linear equation of the form y' + a(x)y = b(x), where $a(x) = \tfrac{1}{x}$ and $b(x) = \tfrac{\sin(x)}{x}$.
The standard approach is to use the integrating factor method (sometimes called Lagrange’s method):
$$ y = e^{-\int a(x)\, dx} \,\Bigg( \int b(x)\, e^{\int a(x)\, dx}\, dx + c \Bigg). $$
Substituting $a(x) = 1/x$ and $b(x) = \sin(x)/x$ gives
$$ y = e^{-\int \tfrac{1}{x}\, dx} \,\Bigg( \int \frac{\sin(x)}{x} \, e^{\int \tfrac{1}{x}\, dx}\, dx + c \Bigg). $$
Since $\int \tfrac{1}{x}\, dx = \log(x)$, this becomes
$$ y = e^{-\log(x)} \,\Bigg( \int \frac{\sin(x)}{x} \, e^{\log(x)}\, dx + c \Bigg). $$
$$ y = \frac{1}{e^{\log(x)}} \,\Bigg( \int \frac{\sin(x)}{x}\, e^{\log(x)}\, dx + c \Bigg). $$
Because $e^{\log(x)} = x$, the expression simplifies to
$$ y = \frac{1}{x} \,\Bigg( \int \frac{\sin(x)}{x} \cdot x\, dx + c \Bigg). $$
$$ y = \frac{1}{x} \,\Bigg( \int \sin(x)\, dx + c \Bigg). $$
The antiderivative of $\sin(x)$ is $-\cos(x)$, so we obtain
$$ y = \frac{1}{x}\,(-\cos(x) + c). $$
Thus, the general solution is
$$ y = \frac{c}{x} - \frac{\cos(x)}{x}. $$
That completes the solution.
