In the previous topic, we learned about an important special case of ODEs: first-order linear differential equations. Despite their prevalence, many interesting problems in various fields of science are described by higher-order differential equations. We are now going to turn our focus to them.
Definition
Let's recall the concept of linearity from the previous topic. All the derivatives will enter our equation in the first degree.
In order to keep things simple, in this topic, we will consider all the coefficients of the derivatives to be constants. We would be happy to consider a general equation of the form
...but, unfortunately, it is impossible to solve such an equation in the general form. This is a common situation in the field of differential equations: as soon as you take a step off the road paved by theory, you lose the opportunity to solve the equation analytically. Fortunately, there are numerous methods for solving ODEs numerically, but we'll talk about them some other time.
The equations we will deal with today will have the form
Equations of degree greater than 2 are rarely encountered in practice. In order not to overload the text with indices, we will consider a particular case and then see how it can be extended to equations of higher orders.
To sum up, we will devote most of our presentation to equations of this kind:
Recall that an equation with is called homogeneous. Obviously, every nonhomogeneous equation has a homogeneous counterpart. Solving this counterpart is a crucial step in finding a solution for the initial problem.
Solving higher-order linear homogeneous ODEs
Let's consider a homogeneous equation:
To solve it, we should construct the characteristic equation:
The principle of its construction is obvious – instead of the derivative , we write lambda raised to the appropriate power: .
Why should we do that and what's the point of it? It turns out that the roots of the characteristic equation completely determine the solutions of the original differential equation . We will not strictly prove this fact (the proof can be found in textbooks), but you can always substitute the found solutions and check whether they satisfy our homogeneous ODE.
Let's define the roots (no matter real or complex) of our characteristic equation as .
As it always happens when solving quadratic equations, we have three cases:
1) Two different real roots (discriminant )
In this case, the solution of the equation takes the form
Recall that the solution to an -th order ODE has arbitrary constants (in our case, )!
2) Two different complex roots (discriminant )
If the roots of a quadratic equation are complex, they must be complex conjugate roots. Let's present the roots in the form
The solution of in this case is:
Those of you who are familiar with complex exponents will easily understand that this case is virtually no different from the first one. We just have to substitute the two building blocks in the solution with their linear combinations:
3) Two repeated real roots (discriminant )
This case is a little bit different. The solution of equation will be:
where .
A small remark about equations of degree greater than 2. As we know, any algebraic equation of degree has exactly complex roots (some or all of them may be real). Using these roots, we can construct a solution to any homogeneous equation just as we did for the case of . Each unique real root gives an exponent in the solution (see point 1). Each pair of complex conjugate roots gives an exponent multiplied by the "trigonometric block" (see point 2). Each root repeated times gives a polynomial of degree multiplied by the exponent with that root (see point 3).
Numerical example
Let's see how this is done in practice. We will consider the following equation:
Its characteristic equation is written as follows:
It has two complex conjugate roots (case 2):
Therefore, according to , the solution of the initial equation is:
Higher-order linear nonhomogeneous ODEs
Now, let's turn our attention to nonhomogeneous equations. As before, the first step in solving such an equation will be solving its homogeneous counterpart. The whole algorithm is as follows:
- Find a solution of a homogeneous equation .
- Find some particular solution of the initial equation .
- Construct a full solution of (*) by summation: . The result is called the general solution of .
Step 1 has been discussed in detail above, and step 3 is self-explanatory. So now we will focus on step 2 – finding a particular solution.
We will use the method of undetermined coefficients to find a particular solution . First, we will "guess" the form of the solution, leaving the numerical coefficients in this form undefined. Then, we will substitute our ansatz into the differential equation and determine the values of the coefficients.
A legitimate question arises – how to guess the form of the particular solution? Unfortunately, it is impossible to give a single recipe here – it all depends on the type of function in the right-hand side of the equation (*). However, there are many useful heuristics that allow you to "guess" the right form of the solution. Now we will discuss some of them.
- is a polynomial, for example . Then should be searched among polynomials of the same order multiplied by an additional term: , where is the number of zero roots of the characteristic equation. Yeah, it sounds convoluted and it actually is. But don't worry, in most second-order equations and . Note that the coefficients should not be missed even if they are absent in the .
- is an exponent, for example . If the coefficient in the exponent doesn't coincide with the roots of the characteristic equation (), we should search for in the same form: . Otherwise, the ansatz should be multiplied by x: .
- is a sin or a cos function, for example . The particular solution takes the form . Note that it always contains both sin and cos parts, no matter if they are present in .
These cases cover most of the situations you may encounter in practice. However, another important aspect remains – what if f(x) consists of several of the "building blocks" discussed above? Here are two simple rules to help you figure out the form of in this situation:
- If contains an exponential, we should ignore it and write down the guessed form of the solution for the remaining part. Then tack the exponential back on without any coefficient before it.
- When is a product of a trigonometric function with a polynomial, we first write down the ansatz for the polynomial only and multiply that by the appropriate cosine. Then we add the same polynomial with different coefficients and multiply that by the appropriate sine.
Let's have a look at a concrete example. Let . Following the rules above, we forget about the exponent and start constructing the template for the polynomial: Since we have a sin part, we should now concatenate this template with the trigonometric functions:
Finally, we return the exponent and obtain the guess for :
A final remark: if , where and belong to different types discussed above, the particular solution should be divided into blocks and found step by step, ignoring other parts. After that, the final particular solution may be found as a simple sum of the blocks: .
A complete example
This journey through theory was quite exhausting. Let's consider the whole process of solving an equation from the beginning to end with a concrete example. We will be guided by the algorithm provided in the previous section.
- Step 1: the homogeneous equation. We've already solved it before:
- Step 2: finding a particular solution. The right-hand side contains a polynomial and the exponent. Following the rules formulated above, we first make a guess about the form of the polynomial part of a particular solution and then multiply it by the exponent:To obtain the coefficients, we substitute this "half-baked" solution into the original equation:To obtain the coefficients and , we need to equate the coefficients of corresponding powers of x. This means,So finally, our particular solution is
- Step 3: gathering both parts into the general solution:
Congratulations! We've solved a second-order nonhomogeneous ODE.
Conclusion
Differential equations of higher orders are more complicated than linear ones, but the same algorithms may be applied to solve them. First, we need to find the solution to the homogeneous equation by solving the accompanying characteristic equation. Its roots completely determine the form of the solution. Then you need to find a particular solution to the nonhomogeneous equation – there are several heuristics for this. Finally, the two parts must be combined to obtain a general solution.