# Method of Undetermined Coefficients Differential Equation

So the question is to solve this differential equation: $y'' - 4y' + 5y = 1 + t$.

I've got the general solution to $\ C_1e^{2t}\cos(2t) + C_2e^{2t}\sin(2t)$

However, I don't really know how to proceed with the particular solution.

I know that t is a polynomial of the first degree and should be written as $At + B$. After that I'm pretty much stuck. One particular question I have though, should $1$ be a constant $D$ which would make the equation for the particular solution: $y = At + B + D$? Or is that redundant since we already have the constant $B$?

As you see, my main concern is how handle the "set-up" of the particular solution.

Follow up question: Is it some general rule to follow when setting up these particular solutions? I'm feeling pretty lost and want to really learn the concept.

• Yes having extra constants like that is redundant as it can be rewritten as another constant – Triatticus Feb 3 '18 at 21:55
• B + D, or maybe just call it C. Anyway, you have the form, why not put it in for y? – Kaynex Feb 3 '18 at 21:57
• What you wrote is not the general solution, it is the homogenous solution. – Joel Feb 3 '18 at 22:03

The method of undetermined coefficients has been called 'educated guesswork' for finding particular solutions. One attempts trial solutions based on the form of the right-hand-side (RHS), bearing in mind the form of the complementary function. In this case, the RHS is a polynomial of degree 1, and as it does not appear in your complementary function, you pick a trial solution as a polynomial of degree 1 i.e. $y_P=At+B$. Just one additive constant. Note there are other, more systematic, methods for solving these problems such as variation of parameters.

• For arguments sake (or more for me to understand the concept better), what would one do if it did appear in my complementary function? – gbgult Feb 3 '18 at 22:07
• The problem is if your ODE is Ly=f and f is part of the CF, then Lf=0 so trying yp=f is going to fail. You then typically try to find particular solutions by multiplying by (powers) of t i.e try yp= A t f say, where A is a const. – PM. Feb 3 '18 at 22:10

make for the particular solution the ansatz $$y_p=At^2+Bt+C$$

First, your homogeneous solution contains a mistake. It should be:

$$y_h = C_1e^{2t}\cos(t) + C_2e^{2t}\sin(t)$$

Now, this equation allows for a simple particular solution, but a more general way to find a particular solution is making one of the constants depend on $t$ and substituting this into the equation:

$$y_p=C(t)e^{2t}\cos(t)=C y_0$$

Where:

$$y_0''-4y_0'+5y_0=0$$

$$y_p'= C'y_0+Cy_0'$$

$$y_p''= C''y_0+2C'y_0'+Cy_0''$$

Now substitute into the original equation:

$$C''y_0+2C'y_0'+\color{blue}{Cy_0''}-4(C'y_0+\color{blue}{Cy_0'})+\color{blue}{5C y_0}=t+1$$

The sum of the blue parts is equal to $0$ by definition so our equation becomes:

$$y_0 C''+2(y_0'-2y_0)C'-t-1=0$$

or:

$$e^{2t} \cos t~ C''-2 e^{2t} \sin t~ C'-t-1=0$$

Making a substitution:

$$C'(t)=f(t)$$

$$e^{2t} \cos t~ f'-2 e^{2t} \sin t~ f-t-1=0$$

And we obtained a 1st order ODE, which can be solved and in the end get us $C(t)$ and consequently, $y_p(t)$.

The solution is simple in this case, as the homogeneous equation becomes:

$$f_h'-2 \tan t~ f_h=0$$

$$f_h(t)=\frac{A}{\cos^2 t}$$

Now again, we make $A$ depend on $t$:

$$f_p(t)=\frac{A(t)}{\cos^2 t}=A f_0$$

So we find the general solution for $f(t)$, which we then integrate to find $C(t)$ and our particular solution $y_p(t)$ is known.

Again, for this case it doesn't make sense to use this complicated procedure, but for the more general case of inhomogeneous equations this is a sure way to obtain a solution.

• Thanks for the great comment. First of all, where is the mistake? Isn't the roots: $2 +_- 2i$ which makes my homogenous solution correct? Or have I mistaken how to handle imaginary numbers? Secondly, I'm gonna try to understand how to use your way of finding a $Y_p (t)$. Do you have any tips of videos/online sources where I could see some more examples? That's the best way for me to learn. – gbgult Feb 4 '18 at 9:33
• No, the roots are $2 \pm i$, hence your mistake. If this is an assignment, make sure to fix your solution.  As for the method, it's called variation of parameters (of constants) and is pretty standard. See Wikipedia for example en.wikipedia.org/wiki/Variation_of_parameters – Yuriy S Feb 4 '18 at 9:38
• Oh, sorry about that, spotted my, silly, mistake now. Thanks, I'll look into that! – gbgult Feb 4 '18 at 9:49