# Solving system of differential equations using undetermined coefficients

1. Aug 4, 2011

### awelex

Hi,

I've come across a problem in my differential equations book that I can't seem to be able to solve (it's not a homework problem, I'm just practicing):

"Using matrix algebra techniques and the method of undetermined coefficients, find a general solution for

x''(t) + y'(t) - x(t) + y(t) = -1,
x'(t) + y'(t) - x(t) = t^2 "

At first, I tried to change this system to a system of first-order differential functions only using the following substitutions:

x1(t) = x(t)
x2(t) = x'(t)
x3(t) = y(t)

Which leads to the following system in matrix form:

$\left[ \begin{array}{c} x1' \\ x2' \\ x3' \end{array} \right] = \left[ \begin{array}{ccc} 0 & 1 & 0 \\ 0 & 1 & -1 \\ 1 & -1 & 0 \end{array} \right] * \left[ \begin{array}{c} x1 \\ x2 \\ x3 \end{array} \right] + \left[ \begin{array}{c} 0 \\ -t^2 - 1 \\ t^2 \end{array} \right]$

Next, I solved the system of heterogeneous equations associated with this system, which also wasn't a problem. But now I'm stuck:

The nonhomogeneous part suggests a particular solution of the form $Bt^2+Ct+D$, with B, C, and D being vectors to be determined. Putting everything into the system yields

$2*Bt+C = A*(Bt^2 + Ct + D) + \left[ \begin{array}{c} 0 \\ -t^2-1 \\ t^2 \end{array} \right]$, with A being the coefficient matrix of my original system. But how do I proceed from here?

Thanks,

Alex

2. Aug 4, 2011

### awelex

I've just read the "must read" post and it seems that I should have posted my question in the homework section. If somebody could move it there, I'd appreciate it.

3. Aug 4, 2011

### hunt_mat

The first thing to do is to examine the eigenvalues o you matrix, find the eigenvectors and then change co-ordinates to obtain a diagonal matrix.

4. Aug 4, 2011

### awelex

I did find the eigenvalues and eigenvectors, but how do I proceed from there?

5. Aug 4, 2011

### hunt_mat

You create a matrix P whose columns are the eigenvectors, then
$$\mathbf{P}\mathbf{x'}=\mathbf{PAx}+\mathbf{P} \mathbf{f} (t)$$
Then
$$\mathbf{PAx}=\mathbf{PA}\mathbf{P}^{-1} \mathbf{P} \mathbf{x}$$
Now you know that $\mathbf{PA}\mathbf{P}^{-1}$ is a diagonal matrix whose elements are the eigenvectors. This now can be solved easily as the system is decoupled.

6. Aug 4, 2011

### awelex

That's what I wanted to do, but there are two problems with this:

a) the matrix P I get is singular and thus cannot be inverted
b) It's not the procedure the book wants me to use, as the problem states I should use the method of undetermined coefficients.

I suspect that I made an error earlier in setting up the system in normal form. If somebody could double-check it, I'd appreciate it.

7. Aug 4, 2011

### hunt_mat

The system I get is:
$$\begin{array}{ccc} x'-z & = & 0 \\ y'+z-x & = & t^{2} \\ z'+y'-x+y & = & -1 \end{array}$$
Which can be put into the form $\mathbf{Ax'}+\mathbf{Bx}=\mathbf{c}$, and so you have to multiply through by the inverse of A and then find eigenvectors. The matrix I get isn't singular but does have a repeated root.

8. Aug 5, 2011

### awelex

I'm sorry if I seem thick, but how did you get this? And what is z in your system?

9. Aug 5, 2011

### hunt_mat

z=x'

10. Aug 5, 2011

### awelex

Well, I made some progress. I did manage to apply the method of undetermined coefficients to my system, which yielded two particular solutions, xp and yp. The total solution for y(t) and x(t) should then be

y(t) = yh(t) + yp(t)
x(t) = xh(t) + xp(t)

with xh and yh being the solutions to the corresponding homogeneous equation systems. I checked my solution with the solution in the book, and here's the interesting part: the particular solutions in both cases are right, but the homogeneous parts are wrong. I'm wondering why that is.
Here's how I obtained the homogeneous solutions: I calculated the eigenvalues for my coefficient matrix. These are -1, 1, 1 (1 being a double root). However, the problem is that even though 1 is a double root, I only got one corresponding eigenvector, as the other was (0, 0, 0). The fundamental matrix with the two eigenvectors and the nullvector looks like this:

$\left[ \begin{array}{ccc} -1 & 1 & 0 \\ 1 & 1 & 0 \\ 2 & 0 & 0 \end{array} \right]$

I thought that this corresponds to the solution

$C1*e^{-t} \left[ \begin{array}{c}-1 \\ 1 \\ 2 \end{array} \right] + C2*e^t \left[ \begin{array}{c}1 \\ 1 \\ 0 \end{array} \right]$

But apparently this is wrong. I suspect it has something to do with the fact that I only have two eigenvectors instead of three. I've never encountered such a case before, so I don't know...

Any ideas?

11. Aug 6, 2011

### awelex

Alright, I'm giving it one more try. After I figured out how to deal with the t^2 part, I'm still stuck when it comes to solving the homogeneous equation:

$\left[ \begin{array}{c} x1' \\ x2' \\ x3' \end{array} \right] = \left[ \begin{array}{ccc} 0 & 1 & 0 \\ 0 & 1 & -1 \\ 1 & -1 & 0 \end{array} \right] * \left[ \begin{array}{c} x1 \\ x2 \\ x3 \end{array} \right]$

I get the following three eigenvectors:

$\left[ \begin{array}{c} -1 \\ 1 \\ 2 \end{array} \right] , \left[ \begin{array}{c} 1 \\ 1 \\ 0 \end{array} \right] , \left[ \begin{array}{c} 0 \\ 0 \\ 0 \end{array} \right]$

The problem is that the third vector is a nullvector, which is something I haven't encountered yet. Its corresponding eigenvalue is a double root. How do I deal with that?

Thanks

12. Aug 6, 2011

### ehild

Transforming the system of equations into a third-order de, the third solution of the homogeneous equation is t* et
I do not know how it appears in the matrix-method solution.

ehild

Last edited: Aug 6, 2011