The general solution of a non-homogeneous differential equation consists of two parts: The complementary function which is the solution of the homogeneous differential equation i.e. the equation when the right side is zero, and the particular solution which is any solution of the non-homogeneous equation.
Firstly, let's find the complementary function for this differential equation. The associated homogeneous equation for this non-homogenous second order differential equation is y′′−9y = 0. The solution of this type of equation is a combination of exponential functions. In this case, the solutions of such an equation are exponentials of the form e^mx, where m are the roots of the characteristic equation, which here are m1 = 3, m2 = -3.
So, the complementary solution (yc) of the differential equation is:
yc(x) = c1 * e^(3x) + c2 * e^(-3x)
Then, let's find the particular solution for this differential equation. The particular solution is a solution that also satisfies the non-homogeneity of the equation. It's of the form x²sin(3x) and x.cos(3x).
Here, the particular solution is:
yp(x) = (-3/73*x² - 756/5329*x) * cos(3x) + (-8/73*x² + 466/5329 *x) * sin(3x)
After we have found both the complementary and particular solutions, we can write the general solution for the differential equation which is the sum of yc and yp. This general solution describes all possible solutions to the differential equation.
The general solution (y) of the differential equation is:
y(x) = yc(x) + yp(x)
= c1*exp(3*x) + c2*exp(-3*x) + (-0.10958904109589*x² + 0.0874460499155564*x) * sin(3*x) + (-0.0410958904109589*x² - 0.141865265528242*x) * cos(3*x)
This is the general solution that satisfies our differential equation. It includes all solutions of the homogeneous case, characterized by the constants c1 and c2, adjusted by the particular solution to fit the non-homogeneity of the equation. The constants c1 and c2 can be determined if further conditions are given.