Linear Differential Equations with Constant Coefficients


A linear ODE with constant coefficients looks like this:
$$a_n\frac{\mathrm{d}^ny}{\mathrm{d}x^n} + a_{n-1}\frac{\mathrm{d}^{n-1}y}{\mathrm{d}x^{n-1}} + … + a_1\frac{\mathrm{d}y}{\mathrm{d}x} + a_0y = f(x)$$

For example:
$$\frac{\mathrm{d}^2y}{\mathrm{d}x^2} – 6\frac{\mathrm{d}y}{\mathrm{d}x} + 13y = x^3$$

This is the most common form of differential equation in circuit theory.
Note that if the coefficients are not constant (i.e. a function of x) then most analytical methods do not work.

Contents

Finding Solutions

Solving these types of equations requires a few steps as described below.

Solving the Homogeneous Equation

A homogeneous equation is one where f(x) is 0:
$$a_n\frac{\mathrm{d}^ny}{\mathrm{d}x^n} + a_{n-1}\frac{\mathrm{d}^{n-1}y}{\mathrm{d}x^{n-1}} + … + a_1\frac{\mathrm{d}y}{\mathrm{d}x} + a_0y = 0$$
Note that the only function of x at all is y(x) since all of the coefficients are numerical constants.

If the ODE is not homogeneous then simply set f(x) to 0 to get the associated homogeneous equation.

The Characteristic Equation Defined

The key to solving these ODE problems is through the so-called characteristic equation.
This equation is a polynomial where the coefficients are taken from the ODE, and the power is taken from the power of the derivative.
Taking the example from before, setting the right hand side to zero to make it homogeneous:
$$\frac{\mathrm{d}^2y}{\mathrm{d}x^2} – 6\frac{\mathrm{d}y}{\mathrm{d}x} + 13y = 0$$

Its characteristic equation looks like this:
$$r^2 – 6r + 13 = 0$$

Any order of ODE works the same way.
For example, this ODE:
$$\frac{\mathrm{d}^4y}{\mathrm{d}x^4} -3 \frac{\mathrm{d}^3y}{\mathrm{d}x^3} + 3\frac{\mathrm{d}^2y}{\mathrm{d}x^2} – \frac{\mathrm{d}y}{\mathrm{d}x} = 0$$
Has the characteristic equation:
$$r^4 – 3r^3 + 3r^2 – r = 0$$

Solving the Characteristic Equation

To use the characteristic equation you must solve for its roots.
It is very important to find all of the roots and note the repetitions, if any.

$$r^2 – 4 = 0 \rightarrow r = \pm2$$
$$r^2 – 4r + 3 = 0 \rightarrow r = 1, 3$$
$$r^4 – 3r^3 + 3r^2 – r = 0 \rightarrow r = 0, 1, 1, 1$$

General Solutions

Now that we have the roots of the characteristic equation we can assemble the general solution.
A fundamental theorem of differential equations states that the general solution to an ODE is a weighted, algebraic sum of all linearly independent solutions.
The general solution looks like this:
$$y(x) = c_1y_1(x) + c_2y_2(x) + … + c_ny_n(x)$$

The number of solution terms is typically equal to the order of the ODE.

It turns out there are several variations on these solutions depending on the type of roots that we find, but they are all very similar.

  1. Distinct Real Roots
    Each distinct real root gives a solution term that is simply:
    $$y(x) = e^{rx}$$

    This gives us the general solution of:
    $$y(x) = c_1e^{r_1x} + c_2e^{r_2x} + … + c_ne^{r_nx}$$

    Example:
    $$r = \pm2 \rightarrow y(x) = c_1e^{2x} + c_2e^{-2x}$$

  2. Repeated Real Roots
    When a real root is repeated there must still be a solution term for each root.
    To keep each solution linearly independent simply multiply each subsequent term by a higher power of x.
    So with k repetitions the solution term is:
    $$y(x) = c_1e^{r_1x} + c_2xe^{r_2x} + … + c_kx^ke^{r_kx}$$

    Example:
    $$r = 0, 1, 1, 1 \rightarrow y(x) = c_1e^0 + c_2e^{x} + c_3xe^{x} + c_4x^2e^{x}$$

  3. Complex Roots
    It turns out that there’s nothing special about complex roots, and the solution is the same:
    $$y(x) = e^{rx}$$

    However, when r is complex to get a reasonable solution we need to invoke Euler’s formula (with j as the imaginary number):
    $$e^{jx} = \cos{x} + j \sin{x}$$

    For most situations a complex root will always come in a pair:
    $$r = a \pm j b$$

    Then the associated solution term is:
    $$c_1e^{a+jb} + c_2e^{a-jb} = c_1e^ae^{jb} + c_2e^ae^{-jb}$$
    $$e^a(c_3\cos{bx}+c_4\sin{bx})$$

    (the imaginary numbers disappear because the constants can be complex and cancel out the imaginary parts)

    Example:
    $$r^3 + 4r^2 +6r – 36 = 0 \rightarrow r = 2, -3 \pm j3$$
    $$y(x) = c_1e^{2x} + e^{-3x}(c_2\cos{3x} + c_3\sin{3x})$$

Nonhomogeneous Equations

Now that the homogeneous equation is hopefully solved, we can look at that f(x) term which is often called the forcing function.
As discussed before, the general solution is an algebraic sum of independent terms. As before there are n terms derived from the characteristic equation, called the complementary solution yc.
However, the non-homogeneous function on the right-hand side has introduced a new term, yp, which is called the particular solution.
The general solution to the non-homogeneous equation will now be:
$$y(x) = y_c(x) + y_p(x)$$
$$y(x) = c_1y_1(x) + c_2y_2(x) + … + c_ny_n(x) + y_p(x)$$

Finding the Particular Solution

Fundamentally our ODE says that the combination of a function and its derivatives on the left-hand side are equal to some other function on the right-hand side.
Therefore, these functions are must be related, and more specifically through differentiation.
For instance, if we have:
$$\frac{\mathrm{d}^2y}{\mathrm{d}x^2} + 16 y = e^{3x}$$
Then y(x) must also be an exponential – the particular solution term must be:
$$y_p(x) = Ae^{3x}$$

This is because any derivative of the exponential, no matter what order, always results in the same form.
To calculate the unknown constants we must plug the particular solution into the ODE and solve.
Getting the derivatives of the proposed particular solution:
$$\frac{\mathrm{d}y_p}{\mathrm{d}x} = 3Ae^{3x}$$
$$\frac{\mathrm{d}^2y_p}{\mathrm{d}x^2} = 9Ae^{3x}$$

And plugging it into the ODE:
$$(9Ae^{3x}) + 16(Ae^{3x}) = e^{3x}$$
$$25Ae^{3x} = e^{3x}$$
$$A = \frac{1}{25}$$

Therefore the particular solution is:
$$y_p(x) = \frac{1}{25}e^{3x}$$

There can be a lot of trial and error in finding particular solutions.
Since the ODE potentially contains many derivatives we need to include the derivatives of the forcing function in our trial solution.
For example:
$$f(x) = e^{ax} \rightarrow y_p(x) = Ae^{ax}$$
$$f(x) = xe^{ax} \rightarrow y_p(x) = Ae^{ax} + Bxe^{ax}$$
$$f(x) = \cos{ax} \rightarrow y_p(x) = A\cos{ax} + B\sin{ax}$$
$$f(x) = x^3+a \rightarrow y_p(x) = Ax^3 + Bx^2 + Cx + D$$

Complications

Unfortunately this gets worse: the particular solution cannot be redundant with the solution to the homogeneous equation.
The way to fix this is very similar to the problem of repeated roots.
A general procedure with an example is:

  1. Solve the characteristic equation of the homogeneous equation.
    $$\frac{\mathrm{d}^2y}{\mathrm{d}x^2} + 2\frac{\mathrm{d}y}{\mathrm{d}x} – 3y = 1 + xe^x$$
    Becomes:
    $$\frac{\mathrm{d}^2y}{\mathrm{d}x^2} + 2\frac{\mathrm{d}y}{\mathrm{d}x} – 3y = 0$$
    $$r^2 + 2r – 3 = 0 \rightarrow r = 1, -3$$

  2. Determine the form of the solution term for each root.
    $$y_c(x) = c_1e^x + c_2e^{-3x}$$

  3. Assemble a trial particular solution by taking the derivatives of the forcing function.
    $$\frac{\mathrm{d}^2}{\mathrm{d}x^2}(1 + xe^x) = 2e^x + xe^x$$
    $$y_p(x) = A + Be^x + Cxe^x$$
    Where the A and C terms come from the original function, and the B term comes from the derivative

  4. If there is repetition, multiply all of the offending particular solution terms by xk with k high enough to prevent any repetition.
    The ex term of yc overlaps with the ex term of yp where multiplying by x prevents overlap
    $$y_p(x) = A + x(Be^x + Cxe^x)$$
    $$y_p(x) = A + Bxe^x + Cx^2e^x$$

  5. Solve for the coefficients of the particular solution by taking the derivative of yp and plugging it back in to the ODE.
    $$\frac{\mathrm{d}y_p}{\mathrm{d}x} = Cx^2e^x + (B+2C)xe^x + Be^x$$
    $$\frac{\mathrm{d}^2y_p}{\mathrm{d}x^2} = Cx^2e^x + (B+4C)xe^x + (2B + 2C)e^x$$
    Back into the ODE:
    $$8Cxe^x + (4B+2C)e^x – 3A = 1 + xe^x$$
    Match the coefficients
    $$A = -\frac{1}{3}, B = -\frac{1}{16}, C = \frac{1}{8}$$

  6. Assemble the general solution.
    $$y(x) = y_c(x) + y_p(x)$$
    $$y(x) = c_1e^x + c_2e^{-3x} – \frac{1}{3} + \frac{1}{16}(2x^2-x)e^x$$

Circuit Problems

Coming soon…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.