Linear Differential
1. **State the problem:** Solve the differential equation $$\frac{dy}{dx} + \frac{y}{x} = x^2$$ for $y$ as a function of $x$.
2. **Identify the type of equation:** This is a first-order linear differential equation of the form $$\frac{dy}{dx} + P(x)y = Q(x)$$ where $$P(x) = \frac{1}{x}$$ and $$Q(x) = x^2$$.
3. **Find the integrating factor (IF):** The integrating factor is given by
$$\mu(x) = e^{\int P(x) dx} = e^{\int \frac{1}{x} dx} = e^{\ln|x|} = |x|.$$ Since $x$ is typically positive in this context, we take $$\mu(x) = x.$$
4. **Multiply the entire differential equation by the integrating factor:**
$$x \frac{dy}{dx} + y = x^3.$$
5. **Recognize the left side as a derivative:**
$$\frac{d}{dx}(xy) = x^3.$$
6. **Integrate both sides with respect to $x$:**
$$\int \frac{d}{dx}(xy) dx = \int x^3 dx$$
$$xy = \frac{x^4}{4} + C,$$ where $C$ is the constant of integration.
7. **Solve for $y$:**
$$y = \frac{x^4}{4x} + \frac{C}{x} = \frac{x^3}{4} + \frac{C}{x}.$$
**Final answer:**
$$y = \frac{x^3}{4} + \frac{C}{x}.$$