Our teacher has recently begun teaching second-order differential equations and the methods used for solving them.
The method which we are taught to solve linear differential equations is currently the method of undetermined coefficients. I would like to know if there is a reason as to why the method works. My chief question is about why we're able to just "step-up" our guesses by an x term (i.e. if $$e^{ax}$$ does not work we're simply able to amend our guess to $$xe^{ax}$$ Secondly, why is it that when doing so the terms in between seem to nicely cancel out? An example is the differential equation in one of our tutorials $$\frac{d^2y}{dx^2}-6\frac{dy}{dx}+9y=e^{3x}$$
As the solution to the characteristic polynomial has repeated roots 3, I understand why guesses of the form $$Ae^3x$$ $$Axe^3x$$ fail to work (because they get "absorbed" into the general solution of the complementary solution) and as a result why my "guess" has to be $$Ax^2e^{3x}$$ but I do not understand why when plugging in the solved integrals that somehow I get this mess of an equation $$A(9x^2e^{3x}+12xe^{3x}+2e^{3x}-18x^2e^{3x}-12xe^{3x}+9x^2e^{3x})=e^{3x}$$ that somehow resolves nicely to $$A(2e^{3x})=e^{3x}$$
Thank you for taking the time to read this.