# How many derivatives am I supposed to take in method undetermined coefficients

The PDF(page 3) I am looking at for the method of undetermined coefficients says the following:

For the problem: $$ay'' + by' + cy = f(x)$$

Differentiate the atom f(x) repeatedly. Isolate independent functions whose linear combinations are the derivatives. Multiply them by undetermined coefficients d1, d2, . . . , dk to define an initial trial solution.

What exactly is meant by differentiate f(x) repeatedly? How many times exactly, is it 2 because it's second order? Infinitely? (How could I solve for an infinite number of coefficients) They don't define k so it's not clear how many times I should differentiate

• Think about it; to find a particular solution, you are looking for a $Cg(x)$ (where $C$ is the undetermined coefficient and $g(x)$ is the test function) such that $a \cdot Cg''(x) + b \cdot C g'(x) + c \cdot Cg(x) = f(x)$ – Hyperion Feb 15 at 4:34
• @Hyperion Appreciate the hint but I still don't get it. – Keatinge Feb 15 at 4:36

For linear differential equations, you will differentiate your test function the amount of times equal to the order of the differential equation. It helps to see a basic example: $$y'' + 3y' + 4y = e^{2x}$$ We can easily conclude that the particular solution to the above equation will take the form $$Ae^{2x}$$ where $$A$$ is our undetermined coefficient. We have to make a jump here, and hope that a particular solution has this form, so plugging $$Ae^{2x}$$ into our original equation, we find that \begin{align*} \frac{d^2y}{dx^2}(Ae^{2x}) + 3\frac{dy}{dx}(Ae^{2x}) + 4(Ae^{2x}) &= e^{2x} \\ 4Ae^{2x} + 6Ae^{2x} + 4Ae^{2x} &= e^{2x} \\ 14Ae^{2x} &= e^{2x} \end{align*} We conclude that for $$14Ae^{2x} = e^{2x}$$, $$14A = 1$$, so $$A = \frac{1}{14}$$. From here, we conclude that a particular solution to the equation is $$g(x) = \frac{1}{14}e^{2x}$$.
Note that in this example, we differentiated our test function $$Ae^{2x}$$ twice, as it is a second order equation.
• Thanks, it's obvious in this case why you need to guess $Ae^{2x}$ but I don't understand why it makes sense if the RHS was $xe^x$ for example. If you're going to be differentiating it once it's in the equation, wouldn't it make more sense to integrate it for a guess. Why should the derivatives of the derivatives add up to the original thing? – Keatinge Feb 15 at 4:57
• @Keatinge I don't know what example you're talking about, but you will always multiply a test function by an extra $x$ if your test function happens to be a solution to the associated homogeneous equation. Try plugging it in without the $x$ in such a case and see what happens. – Hyperion Feb 15 at 5:00
• By RHS I mean imagine if the problem was $y'' + 3y' + 4y = xe^x$. Why in this case would I expect y to be a linear combination of derivatives of $xe^x$ – Keatinge Feb 15 at 5:00
• @Keatinge your test function for $xe^x$ would be $(Ax+B)e^x$. Integrating doesn't make sense here because there is quite literally know way to do so without making some substitutions. – Hyperion Feb 15 at 5:03
• and you calculated that $(Ax + B)e^x$ by differentiating $xe^x$ twice? And that method always works for abitrary products? Even for something like $\sin(ax)\cos(bx)e^{cx}(dx^2 + ex + f)$ – Keatinge Feb 15 at 5:07