A foundational course for understanding mathematical modeling, PDEs, and fluid dynamics.
This course introduces the fundamental ideas behind ordinary differential equations (ODEs), including linearity, separability, homogeneous and non-homogeneous equations, and methods of solving first- and second-order systems. We will also examine their applications, which is generally the most important part. This will give you an understanding of the importance of ODEs and the breadth of their use (ODEs touch on just about everything you could imagine!) The goal is to build a strong conceptual foundation that will support later work in partial differential equations, computational fluid dynamics, and operator-theoretic methods.
As you progress through this course, you will find links to related topics in other courses (such as PDEs or Linear Algebra). This interconnected structure is designed to help you quickly revisit prerequisite ideas without breaking your workflow.
One of the first distinctions we make in the study of differential equations is between linear and nonlinear ODEs. Linear ODEs have a very specific structure that allows powerful solution techniques, while nonlinear ODEs often require more specialized or qualitative approaches.
If you want the fast version, below is a short video introducing how to identify whether an ODE is linear or nonlinear. Otherwise stick around for a more detailed explanation. This video includes examples, visual explanations, and a clear checklist for classification.
To understand linear vs. nonlinear ODEs we must first understand the basic structure in which ODEs are written. A common way we will see a (linear) ODE written is as follows: $$a_n(x)y^{(n)}+a_{n-1}(x)y^{(n-1)}+...+a_1(x)y'+a_0(x)y = g(x),$$ and a nonlinear one will often be written as: $$a_n(x,y)y^{(n)}+a_{n-1}(x,y)y^{(n-1)}+...a_1(x,y)y'+a_0(x,y)y = g(x).$$ You many wonder the difference between the two, it is in the values of \(a_n\) are called the coefficients, if those coefficients depend only on the independent variable (in this case the independent variable is \(x\)) then it is linear, however, if those coefficients depend on the dependent variable (which is \(y\) in this case) then the ODE is nonlinear. The number of "primes" (as in \(y'\) for example) represents the number of derivitives we are taking of \(y\) with respect to the independent variable (in this case \(x\)). It should be noted that there are other common ways of writing derivatives as well, perhaps the most common being \(\frac{dy}{dx}\), again with \(y\) as the dependent variable and \(x\) as the independent variable. Another common one that we may run into is the "dot" notation, for example \(\ddot{x}\), in this case we generally take \(x\) as the dependent variable and \(t\) as the independent variable, and since there are 2 dots over the top, that means this is a second derivative of \(x\) with respect to \(t\). This is commonly found in physics related applications, and since I like applications, we will make use of it in this course. If the coefficients are only functions of the independent variable, as they are in the above equation, then the ODE is called linear. This still probably is a bit too abstract at the moment, so lets look at some examples to get a better understanding. The following equation: $$y'' + y = 0,$$ is a linear equation, because notice that \(y\) and all of it's derivatives only have coefficients that depend on \(x\) (in this case it is actually just the constant value 1 for the coefficients but this is still not considered a function of \(y\)), and also note that \(y\) and all of it's derivatives are also only linear. Let's turn this up a notch, the following equation: $$y'' + y = \mbox{cos}(x)+e^x,$$ is also linear. Even though there are nonlinear functions of the independent variable \(x\), the coefficients are linear and all of the terms containing \(y\) are also linear. Additionally, $$y^{(4)}+y'' = e^x,$$ (taking the 4th derivative of \(y\) is the meaning of the (4) superscript), is also linear, again there is no multiplication of multiple \(y\) terms, nor are there nonlinear functions of any \(y\) terms. However, $$[y'']^2 + y = 0,$$ is nonlinear, because the term containing \(y''\) is nonlinear. Similarly, $$y'y'' + y = 10,$$ is nonlinear, because \(y'y''\) is the multiplication of 2 terms containing \(y\). Also, $$y''+\mbox{cos}(y) = \mbox{cos}(x),$$ is nonlinear, because the \(\mbox{cos}(y)\) is obviously nonlinear in \(y\).
You may be wondering why we are spending so much time classifying ODEs. The first section was about linear vs nonlinear ODEs and now we are talking about homogeneous vs nonhomogeneous ODEs. As it turns out, understanding what kind of ODE you have (and this will be true for partial differential equations (PDEs) as well by the way) informs you about the potential ways to solve that ODE. What separates a PDE from an ODE you might ask? Well that is quite simple, ODEs have regular derivatives in them \(dy/dx\) for example). Whereas PDEs have partial derivatives in them (\(\partial u/\partial x\) for some function \(u(x,y)\) for example). Techniques for linear ODEs may differ from those for nonlinear ones. To find the full set of solutions of an ODE often requires us to separate out the homogeneous part of the ODE from the nonhomogeneous part, as you will see.
So now that we have that out of the way, it is really simple to tell whether the ODE is homogeneous or not, once you write the ODE in standard form, the (linear) equation: $$a_n(x)y^{(n)}+...+a_1(x)y'+a_0(x)y = 0$$ is called homogeneous, whereas, $$a_n(x)y^{(n)}+...+a_1(x)y'+a_0(x)y = g(x)$$ for \(g(x) \neq 0\), is called nonhomogeneous. The nonhomogeneous term \(g(x)\) is often called a forcing term or the input signal in physics and engineering (and thus sometimes \(u(x)\) is used or since in physics and engineering the dependent variable we typically care about is time, \(u(t)\) when it is considered the input signal).
If you want the fast version, below is a short video introducing how to identify whether an ODE is homogeneous or nonhomogeneous. Otherwise stick around for a more detailed explanation. This video includes examples, and a clear checklist for classification.
As with everything, it is always good to look at examples to make sure we understand. I highly encourage anyone who decides to go into higher level mathematics to get used to doing this type of thing to make sure you understand. Most people (myself included) have a hard time grasping abstract ideas without examples, so gaining practice making your own examples is a good idea. Ok, now lets dive in with the practice, the equation $$xy'' + x^2y = 0,$$ is homogeneous (and also linear by the way), as is, $$y''+y = 0.$$ However, $$xy^{(3)}+y''+1 = 0,$$ is nonhomogenous (yet still linear) because if we rewrite this equation in standard form $$xy^{(3)}+y'' = -1,$$ it is clear that \(g(x) = -1 \neq 0\) in this case. Also, $$y'+y = \mbox{cos}(x),$$ is also nonhomogenous because \(g(x) = \mbox{cos}(x)\).
Oyy, we have yet more classification to go. I promise we will get to the juicy topics of solving ODEs shortly, but as I mentioned above, it is really important to be able to classify the ODEs so that we know which tools in our toolbox will be available to solve them. In this section, we will briefly discuss the order of an ODE.
Lets go back to our standard way of writing an ODE, again I will for simplicity assume for this case that we are dealing with linear ODEs (so the \(a_n\) terms are ONLY functions of the dependent variable, in this case \(x\)). $$a_n(x)y^{(n)}+...+a_1(x)y'+a_0(x)y = g(x),$$ is said to have order \(n\), since the highest derivative that we take is the \(n\)th one.
If you want the fast version, below is a short video introducing how to identify what the order of an ODE is see below. Otherwise stick around for a more detailed explanation. This video includes examples of the order of an ODE.
Again it might seem simply by the way I wrote things above, but we have to be very careful to differentiate between the order of an ODE and polynomial terms that may make an ODE nonlinear. For example, $$x^2y''' + y = \mbox{sin}(x^4),$$ has order 3, since the highest derivative of \(y\) is the \(y'''\) term. However, $$[y']^5+y^4 = x^{10},$$ is first order (or order 1) since the highest derivative is the \(y'\) and the 5th power is only related to the nonlinearity of the differential equation. So it is quite important that we use caution in our notation to avoid confusion. For more practice, $$[y^{(4)}]^2 + \mbox{cos}^3(x)y' = 0,$$ is a 4th order ODE. We should also be comfortable with identifying the order of an ODE from other notations, for example, $$\frac{d^2y}{dx^2}+xy = x^{0.25},$$ is a second order ODE, and $$t^2\dddot{x}+\mbox{cos}(t^8)\ddot{x}+ x = e^{-5t},$$ is a third order ODE since the highest derivative term contains 3 dots.
Again it might seem simply by the way I wrote things above, but we have to be very careful to differentiate between the order of an ODE and polynomial terms that may make an ODE nonlinear. For example, $$x^2y'''+y = \mbox{sin}(x^4),$$ has order 3, since the highest derivative of \(y\) is the \(y'''\) term. However, $$[y']^5+y^4=x^{10},$$ s first order (or order 1) since the highest derivative is the \(y'\) and the 5th power is only related to the nonlinearity of the differential equation. So it is quite important that we use caution in our notation to avoid confusion. For more practice, $$[y^{(4)}]^2+\mbox{cos}(x^3)y' = 0,$$ is a 4th order ODE. We should also be comfortable with identifying the order of an ODE from other notations, for example, $$\frac{d^2y}{dx^2}+xy=x^{0.25},$$ is a second order ODE, and $$t^2\dddot{x}+\mbox{cos}(t^8)\ddot{x}+x = e^{-5t},$$ is a third order ODE, since the highest derivative term contains 3 dots.
Amazing! We finally can move on from classification (well sort of anyway...). Don't put all that terminology away though, as with most courses, we will build on the information that we have already learned. So if you forget what a nonlinear, nonhomogeneous, second order ODE is later on, you are going to have a hard time understanding why the technique you tried to use didn't work out properly to solve a particular problem. And that is no fun. Also, ODEs are truly a foundational course for just about any mathematical science you can imagine, whether it be the majority of the engineering fields, or physics or chemistry, and when you get right down to it, biology too, at least when we model biological systems. We will stick with first order ODEs for a while because a number of ideas from these types of ODEs carry over into the higher order ODEs.
We are going to add in more terminology now, a first order ODE is called autonomous if the only the dependent variable is explicitely given in the equation, that is, $$\frac{dy}{dx} = f(y).$$ Notice that the right hand of the equation only depends on the dependent variable \(y\), there is no mention of the independent variable \(x\) other than in the derivative itself, this is the definition of autonomous. Now we will see some examples, the first order ODE, $$\frac{dy}{dx} = y^2,$$ is autonomous, notice also that it is nonlinear and homogeneous because if we write it in standard form, it becomes $$\frac{dy}{dx} -y^2 = 0.$$ Also, the first order differential equation, $$\dot{x} = \mbox{cos}(x)-1,$$ is autonomous, because the independent variable (in this case remember the independent variable is \(t\), anytime you see a dot over the top this implies that \(t\) is the independent variable) does not appear, however the above equation is also nonlinear, but it is nonhomogeneous, because when written in standard form $$\dot{x}-\mbox{cos}(x) = -1.$$ Also, $$y' = e^{-y}+3y,$$ is first order, autonomous, nonlinear and in this case homogeneous, try writing it in standard form to see this. You may wonder why we do not always write differential equations in standard form, it will be abundantly clear soon, but I will stop for a moment to note that sometimes (or maybe even often) it is convenient to write the ODE in other forms as we have been doing here. This is particularly true when dealing with solutions to autonomous ODEs.
For nonautonomous ODEs we may write it as, $$\frac{dy}{dx} = f(x,y).$$ Notice in this equation the function \(f\) will depend on both the independent and the dependent variable, or potentially only the independent one. So for example the first order ODE, $$\frac{dy}{dx} = \mbox{cos}(x),$$ is nonautonomous, and it also linear, and nonhomogeneous. Additionally, $$\dot{x} = -t^2+\mbox{cos}(x),$$ is nonautonomous, because the independent variable (\(t\)) shows up in the equation, naturally this is a first order ODE, it is nonlinear and it is nonhomogeneous. Now for a slightly tricky case, $$xy' = 0,$$ is also nonautonomous, you might yell at me on that one, because I wrote that the right hand side as \(f(x,y)\), but where is the \(x\) on the right hand side? Well notice that if I divide both sides by \(x\) that the right hand side becomes \(\frac{0}{x}\), if we were careless we would just write that as \(0\) but that is actually not entirely correct, it is only true if we explicitely rule that \(x \neq 0\), but recall that if \(x = 0\) this becomes \(\frac{0}{0}\) which is an indeterminant form. You can read up on indeterminant forms if you click here.
But we should be interested now in actually solving these things! We will start with an example $$ \frac{dy}{dx} = 2xy $$, before showing you how to find a solution itself, let me start with giving you the solution and allowing you to verify that it is in fact a solution. I propose that the solution is $$y(x) = Ce^{x^2}$$. To verify that this is true, we must ensure that the left hand side is equal to the the right hand side of the equation, so first if \(y(x) = Ce^{x^2}\) we must find \(\frac{dy}{dx}\). Taking the derivative here will require our knowledge of the derivative of \(e^x\) and we must also apply the chain rule (click here to remind yourself of the chain rule). If we let \(h(x) = x^2\) then \(h'(x) = 2x\) by the power rule (click here to remind yourself of the power rule), and using this we can apply the chain rule as mentioned, then \(\frac{dy}{dx} = C(2x)e^{x^2}\). Now on the right hand side, we must simply substitute in \(y(x) = Ce^{x^2}\), and if we do so we will find we get the exact same thing as the left hand side, thus this solution is in fact the solution to the first order, linear, nonautonomous differential equation that we started with.
If you want the fast version, below is a short video introducing how to identify what the order of an ODE is see below. Otherwise stick around for a more detailed explanation. This video includes examples of the order of an ODE.
But it will be important for us to know how to solve linear first order ODE's directly, without needing to be provided the solution up front. As we will see, there is a general method for solution, however, it is often useful to determine whether or not the linear first order ODE is separable.
This is perhaps the simplest imaginable case of an ODE. If we imagine the linear, first order differential equation to look like this: $$\frac{dy}{dx} = f(x,y),$$ and furthermore, the function \(f(x,y)\) (which is a function of both the independent and dependent variables) takes a form $$f(x,y) = g(x)h(y),$$ then this is a separable equation. To see why this is so useful, it will help to include an example or two, so for example, $$\frac{dy}{dx} = 2xy$$ is separable, as we may choose \(f(x,y) = g(x)h(y)\) with \(g(x) = 2x\) and \(h(y) = y\). (Note we could have stuck the constant on either function, it makes no difference in this case). The reason this is so powerful, is it allows us to separate the differential equation into two separate pieces that can then be integrated (hence the term separable). In our example, $$\frac{dy}{dx} = 2xy \implies \frac{dy}{y} = 2x dx,$$ and now we may integrate both sides of the equation to find, $$\int \frac{dy}{y} = \int 2x dx \implies ln(y)+C_1 = x^2 + C_2 \implies ln(y) = x^2 + (C_2-C_1) \implies y = e^{x^2+(C_2-C_1)} \implies y = Ce^{x^2},$$ where in the last step we let \(e^{C_2-C_1} = C\) since this is simply a constant anyway. Notice that we came up with a solution that we have already verified to be a solution in an earlier section. If you need to remember how to perform the integrals here, recall the antiderivative, paired with the fundamental theorem of calculus.
Now we will do another example. Suppose we have the following differential equation, $$\frac{dy}{dx} = \frac{x}{y}.$$ This equation is valid anywhere that \(x \neq 0\) (so the range does not include \(0\)). Thus for the solution, we will note that this is in fact separable, we can let \(g(x) = x, h(y) = \frac{1}{y}\) and we can see that \(f(x,y) = g(x)h(y)\) so this fits the definition of separable. To find the solution, we separate the variables onto either side of the equation as before, $$y dy = x dx \implies \int y dy = \int x dx \implies \frac{y^2}{2} + C_1 = \frac{x^2}{2}+C_2 \implies y^2 = x^2 + (2C_2 - 2C_1).$$ Now from here we have to note that there are two branches to the solution for \(y(x)\), a positive branch and a negative one (remember \(y=0\) is NOT a valid option). So if \(y(x)>0, \ \mbox{then} \ y(x) = \sqrt{x^2+C}\) and if \(y(x)<0, \ \mbox{then} \ y(x) = -\sqrt{x^2+C}\), where \(C = 2C_2-2C_1\).
Time to learn about exact equations! More to come!
More to come!
More to come!
More to come!
Following on from the previous section about exact equations, we can actually take a non-exact linear ODE and turn it into an exact linear ODE. The standard way of doing this is via something called an integrating factor. This is a very powerful technique and is a general way to solve first order linear ODEs. We will start by writing the first order linear ODE in standard form, $$\frac{dy}{dx}+P(x)y = Q(x).$$ Notice that in this case, the coefficients are not necessarily constants, they can be a function (i.e. \(P(x)\)) of the dependent variable. We can rewrite this equation in the following way, $$[P(x)y-Q(x)]dx +dy = 0.$$ This equation is NOT exact, however it can be made exact via multiplication by a special factor, called the integrating factor \(\mu(x)\). It looks like the following, $$\mu(x) = e^{\int P(x)dx}.$$ So now, if we multiply both sides of the linear first order ODE by the integrating factor, we have, $$[\mu(x)P(x)y-\mu(x)Q(x)]dx + \mu(x)dy = 0,$$ and we will note that \(\mu(x)P(x) = \mu'(x)\) (which can be easily shown via the chain rule, and the fundamental theorem of calculus ).
While this link to exact equations is important, and can be used directly from the exact equations, I would also like to focus on the power of the integrating factor outside of just exact equations. So taking a step back, we can also write the linear first order ODE equation, after multiplication by the integrating factor as, $$\mu(x)\frac{dy}{dx}+\mu(x)P(x)y = \mu(x)Q(x).$$ Now, noting what we discussed above, that \(\mu(x)P(x) = \mu'(x)\), or in other notation, \(\mu(x)P(x) = \frac{d\mu}{dx}\), the above equation can be rewritten as, $$\mu(x) \frac{dy}{dx}+ y(x)\frac{d\mu}{dx}=\mu(x)Q(x) \implies \frac{d}{dx}[\mu dy+y(x) d\mu] = \mu(x)Q(x).$$ Now recall from the product rule, that if we have the following derivative \(\frac{d}{dx}[y(x)\mu(x)]\), then the result of the derivative is \(\frac{dy}{dx}\mu(x) + \frac{d\mu}{dx}y(x)\). Notice that in the above equation the term on the left hand side of the equal sign looks exactly like the result of the product rule, therefore we can replace it with the initial form of the product rule (because of the equality) $$\frac{d}{dx}[y(x)\mu(x)] = \mu(x)Q(x).$$ And we may integrate both sides with respect to \(dx\) (and note for the left hand side that we will use the fundamental theorem of calculus ), to find, $$y(x)\mu(x)+C_1 = \int \mu(x)Q(x)dx \implies y(x) = Ce^{-\int P(x)dx}+e^{-\int P(x)dx}\int \mu(x)Q(x)dx,$$ where we recall that \(\mu(x) = e^{\int P(x)dx}\) and for this case we choose \(C = -C_1\).
We will do some examples using the integrating factor method to demonstrate its power. Suppose we have the following differential equation, $$\frac{dy}{dx}-y-\frac{11}{8}e^{\frac{-x}{3}}=0.$$ Note that this currently is not written in the standard form, so first we will rewrite it as follows, $$\frac{dy}{dx}-y = \frac{11}{8}e^{\frac{-x}{3}},$$ this makes it clearer that \(P(x) = -1, Q(x) = \frac{11}{8}e^{\frac{-x}{3}}\). Now we can apply the integrating factor method, first we will note that, $$\mu(x) = e^{\int P(x) dx} = e^{\int (-1)dx} = e^{-x}.$$ This means that from what we derived above that, $$y(x) = Ce^{x} + e^{x}\int e^{-x}\frac{11}{8}e^{\frac{-x}{3}}dx = Ce^{x} + e^{x}\frac{11}{8}\int e^{\frac{-4x}{3}}dx.$$ We will note that, $$\int e^{\frac{-4x}{3}}dx = \frac{e^{\frac{-4x}{3}}}{\frac{-4}{3}} = \frac{-3}{4}e^{\frac{-4x}{3}}.$$ Thus, $$y(x) = Ce^x+ e^x\Big(\frac{11}{8}\frac{-3}{4}e^{\frac{-4x}{3}}\Big) = Ce^x + \frac{-33}{32}e^{\frac{-x}{3}}.$$ This gives the general solution, however, suppose I also gave the following initial condition for this problem, $$y(0) = -1.$$ With this initial condition, I can also find the exact value of $$C$$. Substituting in \(y=-1\), when \(x = 0\), we find, $$y(0) = Ce^{0}+ \frac{-33}{32}e^{\frac{-0}{3}}= -1 \implies C + \frac{-33}{32} = -1 \implies C = \frac{33}{32}- \frac{32}{32} \implies C = \frac{1}{32}.$$ So substituting in our value for \(C\) in this case, we get the solution (for this particular initial condition) of, $$y(x) = \frac{1}{32}e^x +\frac{-33}{32}e^{\frac{-x}{3}}.$$
For another example, solve the initial value problem, $$ty'+2y = 4t^2,$$ $$y(1) = 2.$$ Notice in this example that \(t\) is the independent variable and \(y\) is the dependent variable. The first thing we will need to do is to write this in a standard form, thus, $$y' + 2 \frac{y}{t} = 4t.$$ Now we can see that \(P(t) = \frac{2}{t}, Q(t) = 4t.\) Using the integrating factor method, $$\mu(t) = e^{\int P(t) dt} = e^{2\ln(t)} = e^{\ln(t^2)} = t^2.$$ Thus recalling from the integrating factor method, $$y(t)\mu(t) + C_1 = \int \mu(t)Q(t)dt \implies y(t)t^2 + C_1 = \int t^2(4t)dt \implies y(t)\mu(t) + C_1 = t^4 + C_2 \implies y(t) = t^2 + \frac{C}{t^2}.$$ Note that \(C = C_2-C_1\) in this case and in the last step I substituted in \(\mu(t) = t^2\). Now, since \(y(1) = 2\), $$y(1) = 1^2 + \frac{C}{1^2} = 2 \implies 1+C = 2 \implies C = 1,$$ which means the solution to this initial value problem is, $$y(t) = t^2 + \frac{1}{t^2}.$$
We will state a theorem, (without proof for now). Suppose that the functions \(p,q,f\) are continuous on the open interval \(I\) which contains the point \(a\). Then, given any two numbewrs \(b_0,b_1\), the (linear) equation $$y''+p(x)y'+q(x)y = f(x)$$ has a unique (that is one and only one) solution on the entire intervale \(I\) which satisfies the initial conditions $$y(a) = b_0, y'(a) = b_1.$$
Notice here how the initial condition has changed from the first order case. In the first order case, to uniquely identify the solution we only needed a single initial condition \(y(a) = b\), now we need information both about the initial "position" \(y(a) = b_0\) but also about its "velocity" \(y'(a) = b_1\) to uniquely identify its solution. In general, if the ODE is linear, then we can write the solution of the second order homogeneous linear ODE as, $$y(x) = c_1y_1(x)+c_2y_2(x).$$ Notice that we require that the differential equation be homogeneous here. If the ODE is nonhomogeneous, then we must account for the nonhomogeneous term by adding a particular solution, that is in complete generality the solution to a second order linear differential equation is, $$y(x) = c_1y_1(x)+c_2y_2(x)+y_p(x),$$ where \(y_p(x)\) is the particular solution associated with the nonhomogeneous part. As another note about the solution of a second order linear DOE, the general solution can thus be broken up into two pieces, the first piece we generally call the homogeneous part \(y_h(x) = c_1y_1(x)+c_2y_2(x)\) and the particular solution \(y_p(x)\) as noted above. The homogeneous part has the property that, so long as the coefficients of the second order linear ODE are continuous on the open interval in question, the solution forms a linearly independent pair. Two functions are said to be linearly independent if the are NOT linearly dependent. Two functions are said to be linearly dependent if one of the functions is a constant multiple of the other. In other words, if I have \(f_1(x) = Cf_2(x)\), then these two functions are linearly dependent. This leads us to a beautiful fact about linear ODEs in general (it carries over to higher orders as well), when the order is 2 or larger, we can find the solutions to the homogeneous part, for order 2 say \(y_1(x), y_2(x)\) then we can always find the general solution by making a linear combination of them, $$y(x) = c_1y_1(x)+c_2y_2(x),$$ this is known as the principle of superposition.
Much like we did for first order linear ODEs, we will first show that a proposed solution is actually the solution to the ODE. Suppose for example I have the following ODE, $$y'' - 2y' + y = 0,$$ which is a second order, linear, homogeneous ODE. I want to verify that, \(y_1 = e^x, y_2 = xe^x\) are both solutions to the differential equation, and thus that the general solution must be, $$y = c_1y_1+c_2y_2 = c_1e^x+c_2xe^x$$ (since this is homogeneous we do not need a particular solution). To verify, we need to substitute in for \(y, y', y''\), so we must first find \(y'\) and \(y''\). Note that the derivative of \(e^x\) is \(e^x\), and by the product rule, the derivative of \(xe^x\) is \(e^x + xe^x\), thus (also applying the sum rule of derivatives), $$y'(x) = c_1e^x+c_2e^x+c_2xe^x$$ and we can extrapolate from this to find, $$y''(x) = c_1e^x+c_2e^x+c_2e^x+c_2xe^x = c_1e^x+2c_2e^x+c_2xe^x.$$ Now we can substitute into the original equation, $$y'' - 2y' + y = 0,$$ to find, $$c_1e^x+2c_2e^x+c_2xe^x - 2(c_1e^x+c_2e^x+c_2xe^x)+c_1e^x+c_2xe^x = 0 \implies c_1e^x+2c_2e^x+c_2xe^x-2c_1e^x-2c_2e^x-2c_2xe^x+c_1e^x+c_2xe^x = 0.$$ One can easily see this is true by collecting all like terms to find the left hand side is in fact \(0\). Now suppose for this problem I also know the following initial condition, $$y(0) = 3, y'(0) = 1,$$ (notice that I need two pieces of information for a second order initial condition, this generalizes to higher order as well) then I can find the coefficients of the solution, \(c_1,c_2\). Recall that we just verified that the solution is, $$y = c_1e^x+c_2xe^x,$$ thus \(y(0) = c_1 = 3\) and note that, $$y'(x) = c_1e^x+c_2e^x+c_2xe^x$$ thus, \(y'(0) = c_1+c_2 = 1.\) So now we have two equations, and we can solve these equations via either elimination, or substitution. I will choose substitution, so, since we already know that \(c_1 = 3\) now I can substitute this back into \(c_1+c_2+c_2x = 1\) $$3 + c_2 = 1 \implies c_2 = -2.$$ This tells us that our solution to this initial value problem is $$y(x) = 3e^x-2xe^x.$$
For another example, show that \(y_1(x) = \cos(3x), y_2(x) = \sin(3x)\) are solutions to $$y'' + 9y = 0,$$ and find the general solution. Up to this point we haven't noted how to check if two solutions are linearly independent, and yet, as noted before, in most of the cases we will see for linear second order equations the solutions are in fact linearly independent. So first, we will learn how to check if these two solutions are linearly independent. This is where we will see the concept of the Wronskian, \(W[y_1,y_2,...,y_n](x)\). For second order ODEs the Wronskian will be, $$W[y_1,y_2](x) = y_1(x)y'_2(x)-y'_1(x)y_2(x) = |K|,$$ where, $$K = \begin{bmatrix} y_1(x) & y_2(x) \\ y'_1(x) & y'_2(x). \end{bmatrix}$$ So to find the Wronskian in this case, note that \(y'_1(x) = -3\sin(3x), y'_2(x) = 3\cos(3x)\) which is from the sinusoidal functions rules, and thus, $$y_1(x)y'_2(x)-y'_1(x)y_2(x) = 3\cos(3x)^2 -(-3\sin(3x)^2) = 3\cos(3x)^2+3\sin(3x)^2 = 3(\cos(3x)^2+\sin(3x)^2) = 3.$$ If the Wronskian is NOT equal to \(0\), then we may say that the solutions in this case ARE linearly independent, and as we can see in this example, they are in fact linearly independent. Now we will verify that they are solutions, we must find \(y''_1(x)\) but we already found \(y'_1(x) = -3\sin(3x)\), so \(y''_1(x) = -9\cos(3x)\), similarly we find that \(y''_2(x) = - 9\sin(3x)\). Substituting in \(y_1(x)\) and its derivatives, we see, $$-9 \cos(3x).$$ It is clear by substitution into the original equation that these both are in fact solutions to the differential equation. Therefore we can form a linear combination of these solutions (since they are linearly independent, and this is a homogeneous differential equation), to form the general solution, $$y(x) = c_1\sin(3x)+c_2\cos(3x).$$
When we have a linear second order differential equation, $$y''+ p(x)y' + q(x)y = f(x),$$ and furthermore, \(p(x) = a_1, q(x) = a_0\) where, \(a_0,a_1\) are constants, then we call such a differential equation a constant coefficient differential equation. In engineering, since the independent variable often involves time, this is also called time invariant. In this case, we are able to look for a single solution by using the characteristic equation. We will note that, $$\frac{d^k}{dx^k}e^{rx} = r^ke^{rk}.$$ Because of this, we know for a differential equation with constant coefficients, we can search for an equation that has a solution of the form, $$y(x) = e^{rx}$$. Doing so greatly simplifies our problem, as we will see, however it must be reemphasized that this will ONLY work if we have constant coefficients, and we can find in this case that, $$ay''+by'+cy = 0 \implies ar^2+br+c = 0,$$ since, \(y'' = r^2e^{rx}, y' = re^{rx}, y = e^{rx}\), and substituting in we may verify that we can divide through by \(e^{rx}\) arriving at the result above. This "trick" turns the differential equation into an algebraic one (we will rely on such a trick by using the Laplace transform later as well). Now you may ask, how does finding \(r\) help, don't we need two solutions to form a general solution for the second order, linear, homogeneous differential equation? The answer is yes we do, however notice that the equation has an \(r^2\) term in it, thus the solution to this algebraic equation will have two solutions in most cases (we will discuss how to handle the case when \(r = 0\) or repeated roots, shortly). The equation we discovered, $$ar^2+br+c = 0,$$ is called the characteristic equation or the auxiliary equation.. We will now do a couple of examples to drive home the point.
Suppose we would like to find the solution to the following differential equation, $$y''-4y = 0.$$ Then, as above, we may assume the solution (again since this is a differential equation with constant coefficients) looks like \(y = e^{rx}\), and substituting this in we should find, $$r^2e^{rx}- 4e^{rx} = 0 \implies r^2 - 4 = 0,$$ where the second equation is the characteristic equation. From this, we can easily solve, $$r^2 = 4 \implies r = \pm 2.$$ This means, the solution looks like, $$y(x) = c_1e^{2x}+c_2e^{-2x}.$$
As another example, let $$y'' - 4y'+5y = 0,$$ be the differential equation, with, $$y(0) = 1, y'(0) = 5,$$ as the initial condition. Note that we may use the characteristic equation method since this is a constant coefficient (or time invariant) system. Thus allowing \(y = e^{rx},\) we arrive at the characteristic equation, $$r^2-4r+5 = 0 \implies (r-2)^2+1 = 0,$$ where we used the method completion of the square. We can see if we subtract the \(1\) over and take the square root, we get \(r-2 = \pm \sqrt{-1}\) and noting that \(\sqrt{-1} = i\), this means we have, \(r = 2 \pm i\). Substituting this, we find that $$y = c_1e^{(2+i)x}+c_2e^{(2-i)x} = e^{2x}(c_1 \cos(x)+c_2\sin(x)).$$ In the last part we used Euler's identity, which maps the exponential of \(i\) to sine and cosine. Now we may apply the initial condition to find, $$y(0) = c_1 = 1, y'(0) = 2c_1+c_2 = 5 \implies c_2 = 3.$$ Thus the general solution is, $$y(x) e^{2x}(\cos(x)+3\sin(x)).$$
As another example, solve, $$y''-4y'+4y = 0.$$ Since this linear second order homogeneous ODE has constant coefficients, we may find the characteristic equation, which is, \(r^2-4r+4 =0.\) This means that, \((r-2)(r-2) = 0 \implies r = 2.\) Notice however in this case we have repeated roots, the root \(2\) shows up twice. You might be tempted to say the solution is, $$y(x) = c_1e^{2x},$$ however we know this cannot be the case, since this is a second order equation. In this situation, we may find the other term in the solution by multiplying by the first term in the solution by \(x\) (or for higher order ODEs we might need to multiply by higher powers of \(x\) in this scenario). This interestingly (you can verify with the Wronskian), creates a set of linearly independent solutions. So, the solution in this case is, $$y(x) = c_1e^{2x}+c_2xe^{2x}.$$ You can verify this solution by substituting it into the differential equation (I encourage you to do so for more practice).
As a final example, suppose we have the differential equation, $$y''+y' = 0.$$ We should be able to see by now that the characteristic equation is, $$r^2+r = 0 \implies r(r+1) = 0 \implies r =0, \ \mbox{and} \ r = -1.$$ The solution here is easy, since \(e^0 = 1\), we get, $$y(x) = c_1 + c_2e^{-x}.$$
So now you should be asking yourself, ok, we have a way to find the solution of a constant coefficient homogeneous second order ODE, but what if that same type of differential equation is nonhomogeneous? It turns out, it depends on the type of input (also known as forcing) function \(f(x)\). In some special cases, there is a fast method for obtaining the particular solution, when the homogeneous solution is known in the case of constant coefficients (NOTE this method only works for constant coefficients). This method is known as the method of undetermined coefficients. As an example, suppose the term \(f(x)\) in the differential equation, $$y'' + p(x)y'+q(x)y = f(x),$$ is a polynomial function. Since the derivative of a polynomial is another polynomial, it is reasonable to expect that the particular solution may itself be polynomial. Similarly, if, $$f(x) = a\cos(kx)+b\sin(kx),$$ we may also reasonably expect (since the derivative of \(\sin\) has a \(\cos\) in it and vice versa) that the particular solution will be of the form, $$A\cos(kx)+ B \sin(kx).$$ So the method of undetermined coefficients in this case is used to guess the form of the solution, and then find the proper coefficients to make complete the solution. This works on some types of functions \(f(x)\), but certainly not all.
As an example, suppose we have the differential equation, $$y''+3y'+4y = 3x+2,$$ and thus \(f(x) = 3x+2\). The first thing we will need to do to find the general solution, is to find the homogeneous solution. Since the coefficients are constant, we can use the characteristic equation, to find a solution to the homogeneous equation, $$y''+3y'+4y = 0.$$ The characteristic equation is, $$r^2+3r+4 = 0,$$ and using the quadratic equation, $$r = \frac{-3 \pm \sqrt{9-4(1)(4)}}{2(1)} \implies r = \frac{3}{2} \pm \frac{\sqrt{-7}}{2} \implies r = \frac{3}{2} \pm \frac{1}{2}\sqrt{7}i.$$ From this we can find the homogeneous solution, $$y_h(x) = e^{\frac{3}{2}x}(c_1\cos(\frac{1}{2}\sqrt{7}x)+c_2\sin(\frac{1}{2}\sqrt{7}x)).$$ And for the particular solution we will guess the solution is of the form, $$y_p(x) = Ax+B,$$ since, $$f(x) = 3x+2.$$ Note that, \(y_p'(x) = A, y_p''(x) = 0\) Substituting the guess of a particular solution into the differential equation yields, $$0 + 3(A)+4(Ax+B) = 3x+2 \implies 3A+4Ax+4B = 3x+2,$$ we can see by inspection of the right and left hand sides that it must be true that \(4A = 3 \implies A = \frac{3}{4}\) additionally, and again by inspection, \(3A+4B = 2 \implies 3(\frac{3}{4})+4B = 2 \implies 4B = -\frac{1}{4} \ implies B = -\frac{1}{16}\). Thus my particular solution is, $$y_p(x) = \frac{3}{4}x-\frac{1}{16},$$ which means that, $$y(x) = y_h(x)+y_p(x) = e^{\frac{3}{2}x}(c_1\cos(\frac{1}{2}\sqrt{7}x)+c_2\sin(\frac{1}{2}\sqrt{7}x))+\frac{3}{4}x-\frac{1}{16}.$$
As another example, suppose we have the differential equation, $$y'' - 4y = 2e^{3x},$$ and we just want to find the particular solution. It is reasonable to assume the particular solution will be of the form, $$y_p(x) = Ae^{3x}.$$ Note that $$y_p'(x) = 3Ae^{3x}, y_p''(x) = 9Ae^{3x}.$$ Thus, substituting in, we see that, $$9Ae^{3x} - 4(Ae^{3x}) = 2e^{3x} \implies 5Ae^{3x} = 2e^{3x},$$ and by inspection this leads us to conclude that, $$5A = 2 \implies A = \frac{2}{5}.$$ Finally, we may say, $$y_p(x) = \frac{2}{5}e^{3x}.$$
As another example, solve the following initial value problem, $$y''-3y'+2y = 3e^{-x}-10\cos(3x),$$ with \(y(0) = 1, y'(0) = 2.\) It is important to note that this is a constant coefficient linear equation. First to solve this problem, we must solve the homogeneous equation, so we can see the characteristic equation of the homogeneous problem is given by, $$r^2-3r+2 = 0,$$ which implies that \(r = 1, r = 2\). So the homogenous (also called complementary) solution is, $$y_h(x) = c_1e^x + c_2e^{2x}.$$ Now note that the nonhomogeneous part, \(f(x) = 3e^{-x}-10\cos(3x)\). Since these are two types of functions we mentioned before, but that are added together, we can assume their solution looks like each part added together, that is our guess for a solution is, $$y_p(x) = Ae^{-x} + B\cos(3x)+C\sin(3x).$$ Thus, \(y_p'(x) = -Ae^{-x} - 3B\sin(3x)+3C\cos(3x), y_p''(x) = Ae^{-x}-9B\cos(3x)-9C\sin(3x).\) Substituting this back into the differential equation yields, $$6Ae^{-x} + (-7B-9C)\cos(3x)+(9B-7C)\sin(3x) = 3e^{-x}-10\cos(3x).$$ By inspection, we see immediately that \(6A = 3 \implies A = \frac{1}{2}.\) Additionally, note that since there is no sine term on the right hand side, that implies that the coefficient on the left hand side must be \(0\), that is \(9B-7C = 0 \implies B = \frac{7}{9}C.\) Finally, we note that \((-7B-9C) = -10 \implies -7(\frac{7}{9}C)-9C = -10.\) From here we can see that, $$\frac{-130}{9}C = -10 \implies C = \frac{90}{130} = \frac{9}{13},$$ which means that \(B = \frac{7}{9}(\frac{9}{13}) = \frac{7}{13}.\) So we can write the full solution now as, $$y(x) = c_1e^x + c_2e^{2x}+\frac{1}{2}e^{-x} + \frac{7}{13}\cos(3x) + \frac{9}{13}\sin(3x),$$ and applying the initial condition, $$c_1+c_2+\frac{1}{2}+ \frac{7}{13} = 1 \implies c_1 = -\frac{1}{26}-c_2,$$ and since \(y'(x) = c_1e^x + 2c_2e^{2x}-\frac{1}{2}e^{-x}-\frac{21}{13}\sin(3x) + \frac{27}{13}\cos(3x)\), $$c_1+2c_2-\frac{1}{2} + \frac{27}{13} = 2 \implies (-\frac{1}{26}-c_2) + 2c_2 = \frac{11}{26} \implies c_2 = \frac{12}{26} = \frac{6}{13}.$$ This allows us to find \(c_1 = -\frac{1}{26}-\frac{12}{26} = -\frac{13}{26} = -\frac{1}{2}.\) So the solution becomes, $$y(x) = \frac{1}{2}e^x + \frac{6}{13}e^{2x}+\frac{1}{2}e^{-x} + \frac{7}{13}\cos(3x) + \frac{9}{13}\sin(3x)$$
Now we must handle the case of potential duplication, much in the same way we had to handle the case of repeated roots previously. Suppose we have the following differential equation, $$y'' - y' - 2y = e^{2x}.$$ In this case we can see that the characteristic equation is \(r^2-r-2 = 0 \implies r = 2, r = -1\). Thus the homogeneous solution is, $$y(x) = c_1e^{2x}+c_2e^{-x}.$$ Now we would normally want to guess a particular solution of the form, $$y_p(x) = Ae^{2x},$$ but notice that we already have \(e^{2x}\) in the homogeneous solution. Since we want a linearly independent solution, we will multiply by \(x\) (which helps us find a linearly independent solution similar to the solution we already have)giving a guess of, $$y_p(x) = Axe^{2x}.$$ Thus, \(y_p'(x) = 2Axe^{2x} +Ae^{2x}, y_p''(x) = 4Axe^{2x}+ 2Ae^{2x} + 2Ae^{2x} = 4Axe^{2x}+4Ae^{2x}.\) Substituting in we find,
We may seek to find solutions, even in the case where the linear second order equation does NOT have constant coefficients. A method which allows us to do so, at least so long as we already know the homogeneous solution, is called the method of variation of parameters. We already know that the solution of the second order linear ODE, $$y''+p(x)y'+q(x)y = f(x),$$ will break into two parts, the homogeneous part \(y_h(x) = c_1y_1(x)+c_2y_2(x)\), which solves, $$y''+p(x)y'+q(x)y = 0,$$ and the particular solution, \(y_p(x)\) which is related to \(f(x)\). In variation of parameters, we will suppose the equation of the particular solution takes the form, $$y_p(x) = v_1(x)y_1(x)+v_2(x)y_2(x),$$ where \(y_1(x),y_2(x)\) come from the homogeneous solution. Now, via the product rule, we can see that, $$y_p' = (v_1'y_1+v_2'y_2)+(v_1y_1'+v_2y_2').$$ We can avoid second order derivatives in the unknown functions, \(v_1,v_2\) by imposing the following requirement for the functions, $$v_1'y_1+v_2'y_2 = 0.$$ Thus, with this requirement, $$y_p' = v_1y_1'+v_2y_2',$$ and, $$y_p'' = v_1'y_1'+v_1y_1''+v_2'y_2'+v_2y_2''.$$ We can now substitute \(y_p'', y_p', y_p\) into the second order linear ODE provided above to find (after some algebraic manipulation), $$f = v_1'y_1'+v_2'y_2'.$$ Thus we are left with 2 equations, $$y_1v_1'+y_2v_2' = 0,$$ and, $$y_1'v_1'+y_2'v_2' = f.$$ Finally, we can use these two equations, to help us solve for the linear system, to find that, $$v_1'(x) = \frac{-f(x)y_2(x)}{W[y_1,y_2](x)}, v_2'(x) = \frac{f_(x)y_1(x)}{W[y_1,y_2](x),}$$ where \(W\) is the Wronskian we discussed earlier. Thus we can find, $$v_1(x) = \int \frac{-f(x)y_2(x)}{W[y_1,y_2](x)}dx, v_2(x) = \int \frac{f(x)y_1(x)}{W[y_1,y_2](x)}dx.$$
As an example, suppose we want to find the solution to the differential equation, $$y'' + y = \tan(x),$$ on \((-\pi/2, \pi/2)\). Since the coefficients are constant (and this is a linear second order ODE), we know that the characteristic equation of the homogeneous equation is, $$r^2 +1 = 0 \implies r = \pm i.$$ From this the homogeneous solution is, $$y_h(x) = c_1\cos(x) + c_2\sin(x),$$ thus \(y_1(x) = \cos(x), y_2(x) = \sin(x)\). Now we will suppose that our particular solution is, $$y_p(x) = v_1(x)\cos(x) + v_2(x)\sin(x).$$ Now if we recall the Wronskian in the second order case is given by, $$W[y_1,y_2](x) = y_1y_2'-y_2y_1',$$ we see that, $$W(x) = \cos(x)\cos(x) + \sin(x)\sin(x) = \cos^2(x)+\sin^2(x) = 1.$$ Thus, using, $$v_1(x) = \int \frac{-f(x)y_2(x)}{W[y_1,y_2](x)}dx, v_2(x) = \int \frac{f(x)y_1(x)}{W[y_1,y_2](x)}dx,$$ we see that, $$v_1(x) = \int \frac{-\tan(x)\sin(x)}{1}dx = \int\frac{-\sin^2(x)}{\cos(x)}dx = -\int \frac{1-\cos^2(x)}{\cos(x)}dx = \int (\cos(x)-\sec(x))dx = \sin(x) - \ln|\sec(x)+\tan(x)|+C_1.$$ And, $$v_2(x) = \int \frac{\tan(x)\cos(x)}{1} dx = \int \sin(x) dx = -\cos(x)+C_2.$$ Now we can use these functions to find the particular solution, and since we only need a single particular solution, we will set the constants to \(0\). $$y_p(x) = v_1(x)y_1(x) + v_2(x)y_2(x) = (\sin(x) - \ln|\sec(x)+\tan(x)|)\cos(x) + (-\cos(x)\sin(x)) = -\ln|\sec(x)+\tan(x)|\cos(x).$$ So the complete solution becomes, $$y(x) = y_h(x)+y_p(x) = c_1\cos(x)+c_2\sin(x)-\ln|\sec(x)+\tan(x)|\cos(x).$$
Now we will do another example. Find the particular solution of, $$y''+y = \tan(x)+3x-1.$$ Note that we have already found the particular solution when the right hand side was \(\tan(x)\), and we will now take advantage of the fact that we know that we will have a linear superposition in the solution. So, we will not have to find the solution for the \(\tan(x)\) portion again, it will just be added to the rest of the particular solution. So applying the variation of parameters, $$v_1 = \int [-3x+1]\sin(x)dx = \int -3x\sin(x)dx + \int \sin(x) dx,$$ since as we already noted in the earlier problem, the Wronskian in this case is just \(1\). We can see the first integral on the right hand side can be evaluated using integration by parts, by letting \(u = 3x, du = 3 dx, dv = \sin(x), v = -\cos(x)\), and the second integral is simple, this evaluates to, $$v_1(x) = 3x\cos(x)-3\sin(x)-\cos(x),$$ and note that this means that (setting the constants to \(0\)), $$v_1(x)y_1(x) = 3x\cos^2(x) - 3\sin(x)\cos(x) - \cos^2(x).$$ Similarly, for \(v_2\), $$v_2 = \int [3x-1]\cos(x)dx = \int 3x\cos(x)dx - \int \cos(x)dx,$$ and again for the first integral we will use, integration by parts, and the second integral is again simple to evaluate, thus we find that, $$v_2(x) = 3x\sin(x)+3\cos(x)-\sin(x) \implies v_2(x)y_2(x) = 3x\sin^2(x) + 3\sin(x)\cos(x)-\sin^2(x),$$ and adding \(v_1y_1+v_2y_2\), yields (again setting all the constants to \(0\)), $$v_1y_1+v_2y_2 = 3x\cos^2(x) - 3\sin(x)\cos(x) - \cos^2(x)+ 3x\sin^2(x) + 3\sin(x)\cos(x)-\sin^2(x).$$ Using the identity \(\cos^2(x)+\sin^2(x) = 1\) this evaluates to, $$y_q(x) = v_1y_1+v_2y_2 =3x - 1.$$ Now since we already know that, $$y_r(x) = -\ln|\sec(x)+\tan(x)|\cos(x),$$ from the last problem we can get the full particular solution, $$y_p(x) = y_q+y_r = 3x - 1-\ln|\sec(x)+\tan(x)|\cos(x),$$ and thus the complete solution is, $$y(x) = y_h(x)+y_p(x) = c_1\cos(x)+c_2\sin(x)+ 3x - 1-\ln|\sec(x)+\tan(x)|\cos(x).$$
We have now learned a couple of techniques that can be used to find the solutions of linear ODE's, specifically for the second order case, though these methods can be easily applied to higher order ODE's as well. Another technique, which will be extremely useful, is the Laplace transform. It must be noted, the Laplace transform can only be used in the situation when there are constant coefficients, or in the case when the independent variable is time, we call the constant coefficient case time invariant.
To see why the Laplace transform is so useful in this scenario, we should look at a couple of common physics/engineering scenarios where we see linear constant coefficient ODE's. For example, the acceleration of a mass attached to a spring under an external force and with damping. We can imagine in this scenario that the damping term and spring constant remain constant in time, thus we can write the equation as, $$m\ddot{x}+c\dot{x}+kx = F(t),$$ where \(x(t)\) is the dependent variable (known as the position in this case), \(t\) is the independent variable and \(\ddot{x} = \frac{d^2x}{dt^2}, \dot{x} = \frac{dx}{dt}\). Notice in this case we have a forcing or input term, \(F(t)\), which can be interpreted as the external force on the system. Similarly we can imagine an electric circuit, with, $$L\ddot{I} + R\dot{I}+\frac{1}{C}I = \dot{E}(t),$$ where \(L\) is the inductance, \(I\) is the current, \(R\) is the resistance, \(C\) is the capcitance and \(E\) is the voltage. Notice in this case an external voltage is being applied and is time dependent, whereas we will assume in these circuits that \(L,R,C\) are all constants. The power of the Laplace transform comes from it's ability to handle a wide range of forcing terms, in our examples, \(F(t), \dot{E}(t)\). The Laplace transform will allow us to manage cases, even when these terms are discontinuous.
We mentioned above that the Laplace transform has the advantage that it can handle cases when the forcing (or input) term is discontinuous, but it has an additional advantage, namely because of the fact that it is a type of integral transform, the Laplace tranform changes a differential equation into an algebraic equation, much like our use of the the characteristic equation, did for us before. Naturally, algebraic equations are often much simpler to deal with. We will begin now with the definition of the Laplace transform.
Given a function \(f(t)\) defined for all \(t \geq 0,\) the Laplace transform of \(f\) is the function \(F\) defined as follows: $$F(s) = \mathcal{L}\{f(t)\} = \int \limits_{0}^{\infty}e^{-st}f(t)dt$$ for all values of \(s\) for which the improper integral converges. We will recall that the improper integral defined as, $$\int \limits_{a}^{\infty}g(t)dt = \lim \limits_{b \rightarrow \infty}\int \limits_{a}^{b}g(t)dt$$ converges if the limit exists, otherwise it diverges. Now we will do some examples.
Let \(f(t) = 1\) for \(t \geq 0\), then the Laplace transform is, $$\mathcal{L}\{1\} = \int \limits_{0}^{\infty} e^{-st}dt = \Big[-\frac{1}{s}e^{-st}\Big]_{0}^\infty = \lim \limits_{b \rightarrow \infty}\Big[-\frac{1}{s}e^{-bs}+\frac{1}{s}\Big],$$ and thus, $$\mathcal{L} = \frac{1}{s}$$ for \(s>0\).
As another example, let \(f(t) = e^{at}\), for \(t \geq 0\), then, $$\mathcal{L}\{e^{at}\} = \int \limits_{0}^{\infty}e^{-st}e^{at}dt = \int \limits_{0}^{\infty}e^{-(s-a)t}dt = \Big[-\frac{e^{-(s-a)t}}{s-a}\Big]_0^{\infty},$$ and so, if \((s-a)>0\) then it follows that, $$\mathcal{L}\{e^{at}\} = \frac{1}{s-a},$$ for \(s>a\).
We can form Laplace transforms of functions relatively easily as we saw with the examples above. However, another property of the Laplace tranform makes it particularly useful. Namely, the fact that the Laplace transform obey's linearity. To be more precise, the Laplace transform has the following property, $$\mathcal{L}\{af(t)+bg(t)\} = a \mathcal{L}\{f(t)\}+ b\mathcal{L}\{g(t)\}.$$ This property can be easily proved, $$\mathcal{L}\{af(t)+bg(t)\} = \int \limits_{0}^{\infty}e^{-st}[af(t)+bg(t)]dt =$$ $$ \lim \limits_{c\rightarrow \infty} \int \limits_{0}^{c}e^{-st}[af(t)+bg(t)]dt = $$ $$a\Big(\lim \limits_{c\rightarrow \infty} \int \limits_{0}^{c}e^{-st}f(t)\Big) + b\Big(\lim \limits_{c\rightarrow \infty} \int \limits_{0}^{c}e^{-st}g(t)\Big) = $$ $$a \mathcal{L}\{f(t)\}+b\mathcal{L}\{g(t)\}.$$
Now we can use this to our advantage. For instance, recall that \(\cosh(kt) = \frac{e^{kt}+e^{-kt}}{2}\). Since we know that the Laplace transform obeys linearity, this means that, $$\mathcal{L}\{\cosh(kt)\} = \frac{1}{2}\mathcal{L}\{e^{kt}\} + \frac{1}{2}\mathcal{L}\{e^{-kt}\} = \frac{1}{2}\Big(\frac{1}{s-k}+\frac{1}{s+k}\Big) =$$ $$ \frac{s}{s^2-k^2}.$$
As we noted, one particualarly useful thing about the Laplace Transform is its ability to handle discontinuous forcing functions. Perhaps the most "iconic" piecewise continuous function is the unit step function, given by, $$u(t) = \begin{cases} 0 & \text{if } t < 0 \\ 1 & \text{if } t \geq 0 \end{cases}$$ and interestingly for this function, since \(u(t) = 1 \) if \(t \geq 0\) (and is 0 everywhere else), the Laplace Transform is simple, in fact we already found it here, thus, \(\mathcal{L}\{u(t)\} = \frac{1}{s}, \ s>0\).
One may naturally ask, what if we move the point where the step function jumps up to \(1\)? That is, we will define a shifted unit step function as follows, $$u_a(t) = \begin{cases} 0 & \text{if } t < a \\ 1 & \text{if } t \geq a. \end{cases}$$ Well in this case, $$\mathcal{L}\{u_a(t)\} = \int \limits_0^{\infty}e^{-st}u_a(t)dt = \int \limits_{a}^{\infty}e^{-st}dt = \lim \limits_{b \rightarrow \infty}\Big[-\frac{e^{-st}}{s}\Big]_a^b =$$ $$\frac{e^{-as}}{s}, \ (s>0), \ (a>0).$$
One might naturally ask, how can I apply the Laplace Transform in the case where I have an initial value problem (IVP)? Well as it turns out, I can nicely transform the problem in this scenario as well. Starting from, $$a \ddot{x}(t) + b \dot{x}(t) + cx(t) = f(t),$$ from the linearity of the Laplace transform I know that, $$a \mathcal{L}\{\ddot{x}(t)\}+b \mathcal{L}\{\dot{x}(t)\} + c \mathcal{L}\{x(t)\} = \mathcal{L}\{f(t)\}.$$ For a piecewise smooth function (thus the derivative is piecewise continuous) we have that, $$\mathcal{L}\{\dot{f}(t)\} = s\mathcal{L}\{f(t)\} - f(0) = sF(s)-f(0).$$ We will note, we can find higher order derivatives by applying this formulation as many times as needed, in the second order case we will find that, $$\mathcal{L}\{\ddot{f}(t)\} = s^2F(s)-sf(0)-f'(0).$$
Now for an example using this, solve, $$\ddot{x}-\dot{x}-6x = 0, \ x(0) = 2, \ \dot{x}(0) = -1.$$ Note that, $$\mathcal{L}\{\dot{x}(t)\} = s\mathcal{L}\{x(t)\}-x(0) = sX(s)-2,$$ and $$\mathcal{L}\{\ddot{x}(t)\} = s^2\mathcal{L}\{x(t)\}-sx(0)-\dot{x}(0) = s^2X(s)-2s+1.$$ Now these two pieces may be substituted into the original differential equation, $$[s^2X(s)-2s+1]-[sX(s)-2]-6[X(s)] = 0 \implies (s^2-s-6)X(s) - 2s+3 = 0 \implies X(s) = \frac{2s-3}{s^2-s-6}.$$ We may simplify the denominator, $$X(s) = \frac{2s-3}{(s-3)(s+2)}.$$ And now we may use the method of partial fractions to solve this, thus, $$\frac{2s-3}{(s-3)(s+2)} = \frac{A}{s-3}+\frac{B}{s+2},$$ which simplifies to, $$2s-3 = A(s+2)+B(s-3).$$ Substituting \(s=3\) in allows us to cancel one of the terms and we find that \(5A = 3 \implies A = \frac{3}{5}\). Similarly we may substitute in \(s = -2\) and we find that \(-5B = -7 \implies B = \frac{7}{5}.\) So now we have successfully split this into two pieces, $$X(s) = \mathcal{L}\{x(t)\} = \frac{\frac{3}{5}}{s-3}+\frac{\frac{7}{5}}{s+2}$$ and by noting that \(\mathcal{L}\{e^{at} = \frac{1}{s-a}\}\) and rewriting \(X(s) = \frac{3}{5}\frac{1}{s-3}+\frac{7}{5}\frac{1}{s+2}\) we find that, $$x(t) = \frac{3}{5}e^{3t}+\frac{7}{5}e^{-2t}.$$
Consider the following type of second order system, $$ay''+by'+cy = \delta(t),$$ $$y(0) = y_0, y'(0) = y_1.$$ Such a system is often referred to as an input-output problem. The (constant) coefficients, \(a,b,c\) describe the properties of the (often physical) system, \(g(t)\) represents the input to that system, and \(y_0,y_1\) represent the initial state of the system. Since this is a linear, constant coefficient system, by the principle of superposition, we can see that the system should be the sum of the forced response and the free response. The free response simply arises from the homogeneous solution to the differential equation and the forced response arises from the particular solution. For the type of equation we have above, we can take the Laplace transform to find, $$(as^2+bs+c)Y(s) - (as+b)y_0 - ay_1 = H(s).$$ It is useful in this context, as we shall see, to set, $$G(s) = \frac{1}{as^2+bs+c},$$ and thus we can express our Laplace transformed \(y\) variable as, $$Y(s) = G(s)[(as+b)y_0 + ay_1]+H(s)G(s).$$ In the \(s\) domain, then we can characterize the free response by \(G(s)[(as+b)y_0 + ay_1]\) and the forced response by \(H(s)G(s)\). We may now define the transfer function. The Transfer Function of the input-output problem, is the ratio of the forced response to the input in the \(s\)-domain. Equivalently, the transfer function is the factor in the equation for \(Y(s)\) multiplying the Laplace transform of the input, \(H(s)\). It is clear from this that the transfer function we are referring to is \(G(s)\). For higher order systems we may generalize this (recall in this case we were dealing with a second order system), and we may be interested in more complicated examples where the input function is not simply an impulse \(\delta(t)\), for instance if the higher order system can be written as, $$a_n \frac{d^ny(t)}{dt^n} + ... + a_0y(t) = b_m\frac{d^mx(t)}{dt^m} + ... + b_0x(t)$$ we may call \(y(t)\) the output and \(x(t)\) the input, and in the Laplace transformed space, \(Y(s)\) is the output and \(X(s)\) is the input, and we may define the transfer function in this case as, $$G(s) = \frac{Y(s)}{X(s)} = \frac{b_ms^m + b_{m-1}s^{m-1}+ ... + b_0}{a_ns^n + a_{n-1}s^{n-1}+ ... + a_0}.$$
Now for some examples, suppose we have the following differential equation, $$y''+2y'+5y = \delta(t),$$ $$y(0) = 0, y'(0) = 0,$$ where \(\delta(t) Then, $$(s^2+2s+5)Y(s) = 1,$$ and it is clear that in this case \(G(s) = \frac{1}{(s^2+2s+5)}\) which happens to be the same as \(Y(s)\).
Consider the following system, $$0.1\ddot{y}+6y+4(y-x) = 0.4\dot{x}.$$ Rewriting this system to get the input portion all on the right hand side, $$0.1\ddot{y}+6y+4y = 0.4\dot{x}+4x,$$ we may now write the Laplace transformed function as, $$(0.1s^2+10)Y(s) = (0.4s+4)X(s) \implies G(s) = \frac{Y(s)}{X(s)} = \frac{0.4s+4}{0.1s^2+10}.$$ And we would need the initial conditions to fully solve this problem.
As another example, suppose whe have a spring-mass-dashpot system organized in the following way, $$m\ddot{y}+b\dot{y}+ky = b \dot{u} + ku,$$ where \(m\) represents the mass, \(b\) is the damping, \(k\) is the spring constant. It is clear that \(y(t)\) represents the output and \(u(t)\) represents the input. Then, $$(ms^2+bs+k)Y(s) = (bs+k)U(s).$$ This situation leads to a more complicated transfer function, namely, $$G(s) = \frac{Y(s)}{U(s)} = \frac{bs+k}{ms^2+bs+k}$$ and we would need to know the initial conditions to evaluate this system further.
Now suppose we have the following differential equation, $$\dot{y} + 2y = x(t),$$ and suppose that we use the unit step function for \(x(t)\), that is \(x(t) = u(t)\). Now we would like to find the full system response directly from the transfer function (NOTE, unless initial conditions are supplied we will always assume \(0\) for the initial conditions). Then, first we will find the transfer function, which is, $$(s+2)Y(s) = X(s) \implies G(s) = \frac{Y(s)}{X(s)} = \frac{1}{s+2}.$$ We know from the beginning of this section that the solution will look like \(G(s)X(s)\) if we have \(0\) initial conditions so, $$Y(s) = G(s)X(s) = \Big(\frac{1}{s+2}\Big) \Big(\frac{1}{s}\Big),$$ since the unit step function has a Laplace transform of \(\frac{1}{s}\). Thus, we will evaluate using partial fractions, $$\frac{1}{s(s+2)} = \frac{A}{s}+\frac{B}{s+2} \implies 1 = A(s+2)+B(s).$$ We can see that choosing \(s = 0\) means that \(1 = 2A \implies A = \frac{1}{2}\). Similarly, choosing \(s = -2\), we find that \(1 = -2B\) \implies \(B = \frac{-1}{2}\). Thus we find that, $$Y(s) = \frac{1}{2}\frac{1}{s} -\frac{1}{2}\frac{1}{s+2},$$ and inverting the Laplace transform, we thus find, $$y(t) = \frac{1}{2}-\frac{1}{2}e^{-2t}.$$
Time to learn about differential operators! More to come!
More to come!
More to come!
More to come!
Time to learn about higher order linear ODEs! More to come!
More to come!
More to come!
More to come!
Time to learn about differential operators! More to come!
More to come!
More to come!
More to come!