So I have started learning ODEs for the first time.
I need to find the general solution of the differential equation $$x \frac{dy}{ dx} + 2y = 3x$$ where the solution satisfying the initial condition $y(1) = 5$.
Should I be using the integrating factor method to solve this?
You can use the method of integrating factors:
First divide through by x:
$$ \frac{dy}{dx} + \frac{2}{x}y = 3$$
Integrating factor: $e^{\ln x^2}= x^2$
Multiply through by $x^2$
$$x^2 \frac{dy}{dx}+ 2xy = 3x^2$$
$$ \frac{d}{dx}\left(x^2y\right) = 3x^2$$
Integrating through wrt x:
$$ x^2 y = x^3 + c$$
where $c$ is an arbitrary constant
$$ y = x+cx^{-2}$$
Use the initial condition $y(1) = 5$ to find a value for c:
$$5 = 1+c$$
$$ c = 4$$
Solution:
$$ y = x+ \frac{4}{x^2}$$