1. Identify the form of the differential equation
xy'' + y' = x^2
2. This is a linear differential equation. To solve it, we use the method of variation of constants.
3. First, solve the homogeneous equation:
xy'' + y' = 0
4. Simplify to a first-order equation by letting
y' = p
5. Then
y'' = p'
6. Substitute
x p' + p = 0
7. This is separable, so
p' = -\frac{p}{x}
8. Integrate
\ln|p| = -\ln|x| + C_1
9. Which means
p = \frac{C_1}{x}
10. Recall
y' = p = \frac{C_1}{x}
11. Integrate again
y = C_1\ln|x| + C_2
12. Now find the particular solution of the non-homogeneous differential equation using the method of undetermined coefficients.
13. Assume a particular solution in the form of
y_p = Ax^n
14. Find the correct power of \(x\), let's use \(y_p = Ax^3\)
15. Compute
y_p' = 3Ax^2
y_p'' = 6Ax
16. Substitute into the original equation:
x(6Ax) + 3Ax^2 = x^2
17. Simplify and solve for \(A\):
6Ax^2 + 3Ax^2 = x^2
9Ax^2 = x^2
A = \frac{1}{9}
18. Therefore,
y_p=\frac{x^3}{9}
19. Combine the general solution
y = y_h + y_p
20. Result:
y=\frac{x^3}{9}+C_1\ln|x|+C_2