Linear equations of order n with constant coefficients

We will look for solutions to a non homogeneous linear system of order $n$ with constant coefficients. Nevertheless, we will have to add a restriction to the method that we will introduce.

If our ODE is: $$a_n \cdot y^{(n)}(x)+a_{n-1} \cdot y^{(n-1)}(x)+ \ldots + a_1 \cdot y'(x) +a_0 \cdot y(x)= f(x)$$ (linear with constant coefficients) we require $f(x)$ to be a polynomial, an exponential, a sine or a cosine or any combination of these.

Then we will be prepared to solve, for example: $$y''+y=3 \cos x+e^2x$$

For the same reason as in linear systems, a general solution to this equation is a sum of the general solution to the homogeneous part and a particular solution to the non homogeneous part.

We are going to solve the ODE for the method of the cancelling polynomial or the method of indeterminate coefficients.

Let's suppose that we have the ODE previously given and $f(x)$ is a function that satisfies the conditions that we have been restricted to. Therefore:

In the example that we have given, solutions are:$$y_1(x)=\cos x \\ y_2(x)=\sin x$$

In the previous example, we had to find a polynomial that cancels $f(x)=3 \cos x+e^{2x}$.

Let's proceed in the inverse way to the way we did to find the solutions, that is to say: $\cos x$ comes of $\lambda=ie^{2x}$ it comes of $\lambda=2$.

Therefore the cancelling polynomial is: $Q(D)=\Big(D^2+ID\Big) \cdot (D \cdot 2Id)$.

In fact, $$Q(D)f(x)=\Big(D^2+Id \Big) \cdot \Big(D-2Id\Big) f(x)=\Big( D^3-2D^2+D-2Id\Big)f(x)=\\ =f'''(x)-ef''(x)+f'(x)-2f(x)=\\=3 \sin x+8e^{2x}+6 \cos x- 8e^{2x}-3 \sin x+2e^{2x}-6\cos x-2e^{2x}=0$$

In the previous example, then, we have $Q(D)P(D)=(D^2+Id)(D^2+Id)(D-2Id)$ that has as its roots (and therefore as its associated solutions): $\lambda = \pm i$ with multiplicity $2$ that gives solutions $\cos x, \sin x, x \cdot \cos x, x \cdot \sin x$, $\lambda=2 $ that gives for solution $e^{2x}$.

Therefore we have that $$y^\star (x)=C_1\cos x+C_2 \sin x+D_1 x\cdot \cos x+D_2 x \cdot \sin x+D_3 e^{2x}$$

In our example, we must look for a particular solution of the form: $y_p(x)=D_1\cdot \cos x$.

Let's designate that this is a solution: $$y''_p+y_p=3 \cos x+e^{2x} \\ y''_p+y_p=-2D_1\sin x-D_1x\cos x+2D_2\cos x-D_2x\sin x+4D_3e^{2x}+D_1x \cos x+$$ $$+D_2 x \sin x+D_3 e^{2x}= \\ =-2D_1 \sin x +2 D_2 \cos x+ 5D_3e^{2x}$$ Equaling the coefficients, we obtain: $$D_1=0 \\ D_2=\displaystyle \frac{3}{2} \\ D_3= \displaystyle \frac{1}{5}$$ Therefore, the particular solution is: $\displaystyle y_p(x)=\frac{3}{2}x \cdot \sin x+\frac{1}{5}e^{2x}$

To finish with our example, the general solution is: $$y(x)=c_1\cos x +c_2 \sin x+\displaystyle \frac{3}{2} x \cdot \sin x+\frac{1}{5}e^{2x}$$

Practice exercises