Takeaways
- Order: the order of the ODE is the number of the highest derivative appear in the equation (e.g. if the equation contains \(y''\) then it is second order).
- Linearity: for each term where \(y(x)\) appears (terms with \(y\) and any of its derivatives), the term is linear if and only if it satisfies: \[ Term(\alpha y_1 + \beta y_2) = \alpha Term(y_1) + \beta Term(y_2) \] The ODE is a linear ODE if this condition is satisfied for every term. Otherwise, the ODE is nonlinear.
- Homogeneity: ODE is homogeneous if when you plug in 0 for \(y(x)\) and all its derivatives, you get \(0 = 0\). Otherwise the ODE is inhomogeneous.
Importance of Classifying ODEs
Before we get started, I’d like to quickly motivate this section. In CME 102, you’re going to learn a lot of solution methods, and each solution method only works for one or a few specific types of ODEs. To know which solution method to use (or which methods are valid), you have to be able to very quickly and correctly identify the type of ODE you’re working with. For this reason, I’ve tried to explain in (excruciating) detail the three main properties we use to characterize an ODE: order, linearity, and homogeneity.
Order
Recall that the most general form for an ODE is an equation of the form:
\[ f(y^{(n)}, y^{(n-1)},…,y’, y, x) = 0 \]
(basically just some function of \(y\) and its derivatives equal to 0, where the notation \(y^{(n)}\) means the \(n^{th}\) derivative of \(y\)). The order of an ODE is then \(n\) in this equation. That is, the order of an ODE is the highest order derivative occuring in the differential equation. For example, consider:
\[ y’’’ + y = x\]
This is a third order ODE, since \(y'''\) is the highest order derivative occurring in the equation. Pretty easy, yea?
Linearity
We also have linearity. Linearity is one of the most important topics in mathematics: some people have gone so far as to call the 20th Century the “century of linearity” because of all the scientific discoveries (quantum mechanics, information theory, etc.) that were made possible by the principle of linearity and the theory developed around it. In ODEs, linearity is one of the most important topics (possibly the most important topic in ODEs), and since this is an ODEs class, we should probably study it.
Now before we begin, linearity is a fairly difficult concept to get your head around since there is a bit of circular reasoning involved in explaining it. However, you are smart, and after a pass or two through the definitions you’ll be a master of telling if an ODE is linear. The best place to start with explaining linearity is with the definiton. A function \(f(x)\) is linear if it satisfies the relationship:
\[f(\alpha x_1 + \beta x_2) = \alpha f(x_1) + \beta f(x_2)\]for two constants \(\alpha, \beta \in \mathbb{R}\) (two real-valued constants). The best example of this (actually the only example for one dimensional functions) is \(f(x) = mx\) for a constant \(m \in \mathbb{R}\). (As an aside here, I’m sure you all were told in school that \(y = mx + b\) is a linear function but that’s not true—you were all lied to!—this function is actually an affine function, which is a more restrictive class of functions.)
Inherent in the definition of linearity is the idea of a linear combination. A linear combination is (basically) where you multiply two or more quantities by constants and add them together. If you look at the definition above, you’ll see that \(\alpha x_1 + \beta x_2\) is a linear combination of \(x_1\) and \(x_2\). Understanding linear combinations is very important since this idea appears often in ODEs (and the remainder of these notes). Using this idea of linear combinations, we can also succinctly state the definition of linearity:
A function is linear if a linear combination of any inputs is equal to the same linear combination of those inputs' outputs
Parse through this definition on your own—I think doing so is a good exercise towards understanding linearity.
Before we go further, a nonlinear function is just a function that isn’t linear—it’s a defintiion by exclusion. So basically, a function is linear if and only if the above equality holds, and nonlinear otherwise. You will find that the vast majority of functions (and ODEs) are actually nonlinear. However, we study linear things because the theory is nice and they often offer useful insight into nonlinear things.
Back to linearity. So what about multivariate functions (functions of multiple variables)? For a multivariate function (let’s say something like \(f(x,y,z)\)), it is possible for a function to only be linear in some of the variables, and nonlinear in the others. For example, take the function \(f(x,y,z) = xy^2e^z\). This function is linear in \(x\) since
\[\begin{align*} f(\alpha x_1 + \beta x_2,y,z) &= (\alpha x_1 + \beta x_2)y^2e^z \\ &= \alpha x_1 y^2 e^z + \beta x_2 y^2e^z \\ &= \alpha f(x_1, y,z) + \beta f(x_2,y,z) \end{align*}\]However, this equality would not hold for \(y\) and \(z\), so the function is not linear in these variables.
So, how does this all connect to ODEs? Well, remember what we said above that the most general form for an ODE is:
\[f(y^{(n)}, y^{(n-1)},...,y', y, x) = 0\]Think of this ODE:
\[ f(y^{(n)}, y^{(n-1)},…,y’, y, x) = 0 \]
as several separable terms (i.e. we just add them together):
\[ f_1(y^{(n)}, y^{(n-1)},…,y’, y, x) + f_2(y^{(n)}, y^{(n-1)},…,y’, y, x) + \cdots + f_m(y^{(n)}, y^{(n-1)},…,y’, y, x) = 0 \]
The ODE is linear if and only if every term containing \(y\) or one of its derivatives is linear. So for the ODE: \(y''' + y = x\)
we have:
\[\begin{align} y''' + y &= x \\ f_1 &= y''' \\ f_2 &= y \\ f_3 &= -x \\ f(y^{(n)}, y^{(n-1)},...,y', y, x) &= f_1 + f_2 + f_3 = 0 \end{align}\]Only \(f_1\) and \(f_2\) depend on \(y\) or one of its derivatives, and these terms are linear in \(y'''\) and \(y\), so the ODE is linear.
Linearity of an ODE is the most important thing to identify when choosing a solution method, and this has historically been a sticking point with CME 102 students. Be sure you fully understand this concept before proceeding with this class.
Homogeneity
Finally, we have homogeneity. An ODE is homogeneous if it is linear and it only contains terms containing \(y\) or one of its derivatives. That is, when we’re constructing \(\tilde{f}(\cdot)\) above, if we do not need to throw any terms out, then the ODE is homogenous. Another, more straightforward way to determine homogeneity is if I set \(y\) and all its derivatives to \(0\) and I find \(0=0\), then the ODE is homogeneous.
Consider the same example from above:
\[y''' + y = x\]We see that if I set \(y''' = y = 0\), I find \(0 = x\), which is clearly not true for all \(x\) values. Therefore, this ODE is not homogeneous.
Homogeneity and linearity are very closely related, as you will see in the coming weeks of this class. As a quick peek into why this is, suppose we have a homogeneous ODE and two solutions \(y_1\) and \(y_2\) that solve the ODE. That is, if we have
\[f(y_1^{(n)}, y_1^{(n-1)}, \cdots, y_1, x) = 0, \qquad f(y_2^{(n)}, y_2^{(n-1)}, \cdots, y_2, x) = 0\]then a linear combination of these solutions will also solve the ODE:
\[f(c_1 y_1^{(n)} + c_2 y_2^{(n)}, c_1y_1^{(n-1)} + c_2 y_2^{(n-1)}, \cdots, c_1y_1 + c_2y_2, x) = 0\]since:
\[\begin{align*} f(c_1 y_1^{(n)} + c_2 y_2^{(n)}, &c_1y_1^{(n-1)} + c_2 y_2^{(n-1)}, \cdots, c_1y_1 + c_2y_2, x) \\ &= c_1 f(y_1^{(n)}, y_1^{(n-1)}, \cdots, y_1, x) + c_2 f(y_2^{(n)}, y_2^{(n-1)}, \cdots, y_2, x) \end{align*}\]by the property of linearity. (This is known as a superposition of solutions, and becomes very important when we start studying higher order ODEs. In physics, superposition is at the core of quantum mechanics, and indeed is the basis for the famous Schrodinger’s cat thought experiment.)
Examples
We will close this seciton with a few examples, since at the end of the day examples are the best way to learn to identify ODEs. As a first example:
\[y'' + \sin(y) = \cos(x)\]This ODE is nonlinear second order (nonlinear ODEs can’t be homogeneous). The nonlinearity is from the \(\sin(y)\) term, inhomogeneous because if we set \(y'' = y = 0\), we do not have \(0=0\), and it is second order because \(y''\) is the highest order derivative appearing in the equation.
Consider:
\[y^{(4)} = 0\]This is a fourth order ODE since the fourth derivative appears in the equation, it is linear because \(y^{(4)}\) satisfies the equality for linearity, and it is homgoeenous since if I set \(y^{(4)} = 0\) I have \(0 = 0\).
Lastly, consider:
\[y'' + 4y = \cos(x)\]This looks very similar to the second equation, except for the \(y\) term. Here, we have \(4y\), which is linear, and therefore this ODE is a linear, second order, inhomogeneous ODE.
This ODE raises an important point that an ODE only needs to be linear in \(y\) and its derivatives to be a linear ODE—the \(x\) terms do not matter for linearity. That is, if we represent this ODE as:
\[f(y'', y, x) = \underbrace{y''}_{f_1} + \underbrace{4y}_{f_2} - \underbrace{\cos(x)}_{f_3} = 0\]we see that only \(f_1\) and \(f_2\) depend on \(y\) or its derivatives, and both of these are linear functions in \(y\) and all derivatives, so this is a linear ODE.