From the series: Differential Equations and Linear Algebra
Gilbert Strang, Massachusetts Institute of Technology (MIT)
Transform each term in the linear differential equation to create an algebra problem. You can then transform the algebra solution back to the ODE solution, y(t).
OK. This is the start of Laplace transforms. And that's going to take more than one short video. But I'll devote this video to first order equations, where the steps are easy and pretty quick. Then will come second order equations. So Laplace transforms starting now.
So let me tell you what-- I use a capital letter for the Laplace transform of little f, a function of t. The transform is capital F, a function of s. And you'll see where s comes in. Or if it's the solution I'm looking at, y of t, its transform is naturally called capital Y of s. So that's what we want-- we want to find y, and we know f. OK.
So can I do an example? Well, first tell you what the Laplace transform is. Suppose the function is f of t. Here is the transform. I multiply by e to the minus st, and I integrate from 0 to infinity. 0 to infinity. Very important. The function doesn't start until t equals 0, but it goes on to t equal infinity.
I integrate, and when I integrate, t disappears but s is still there. So I have a function of s. Well, I have to do an example. So to find the Laplace transform is to do an integration. And you won't be surprised that the good functions we know are the ones where we can do the integration and discover the transform, and make a little table of nice transforms.
And the number one function we know is the exponential. So can I find-- for that function, I'll compute its transform. So what do I have to do? I have to integrate from 0 to infinity-- you might say 0 to infinity is hard, but it's actually the best-- of my function, which is e to the at. So that's my function times e to the minus st dt.
OK. I can do that integral, because those combine into e to the a minus st. I can put those together into e to the a minus st. I integrate so I get e to the a minus st divided by a minus s. That's the integral of that. Because what I have in here is just that. To integrate the exponential, I just divide by the exponent there. And I have just substitute t equal infinity and t equal 0. So t equal infinity, starting at 0 to infinity. OK.
Infinity is the nice one. It's the easy one. I will look only at s's that are bigger than a. s larger than a means that this exponential is decreasing to 0. It gets to 0 at t equal infinity. So at t equal infinity, that upper limit of the integral ends up with a 0. So I just have to subtract the lower limit. And look how nice. Now I put in t equal 0. Well, then that becomes 1.
And it's a lower limit, so it comes with a minus sign. So it's just the 1 over, the minus sign will flip that s minus a. The most important Laplace transform in the world. Remember, the function was in to the at. The transform is a function of s. The original function depended on t and a parameter a. The result depends on s and a parameter a.
And an engineer would say, here we have the exponent. The growth rate is a. And over in the transform-- so this is the transform, remember. This is the transform f of x. In the transform, I see blow up-- a pole, that's called a pole-- at s equal a. 1/0 is a pole.
And I'm not surprised. So the answer is blowing up at s equal a. Well, of course. If s equals a, then this is the integral of 1 from 0 to infinity, and it's infinite. So I'm not surprised to see the pole showing up. The blow up showing up exactly at the exponent a. But this is a nice transform. OK.
I need to do one other-- oh, no. I could already solve the equation. So let me start with the equation dy dt minus ay equal 0. Oh, well, I can take the Laplace transform of 0 is 0, safe enough. The Laplace transform of y is capital Y. But what's the transform of this? Oh, I have to do one more transform for you.
I'm hoping that the transform of the derivative, dy dt, connects to the transform of y. So the transform of this guy is the integral from 0 to infinity of that function, whatever it is, times e to the minus st dt. This is the transform. So this Laplace transform.
Now what can I do with that integral? This is a step that goes back to the beginning of calculus. But it's easy to forget. When you see a derivative there inside that integral, you think, I could integrate by parts. I could integrate that term and take the derivative of that term. That's what integration by parts does. It moves the derivative away from that and onto that where it's no problem.
And do you remember that a minus sign comes in when I do this? So I have the integral from 0 to infinity of-- now the derivative is coming off of that, so that's just y of t. And the derivative is going onto that, so that's minus se to the minus st dt. Good. And then do you remember in integration by parts, there's also another term that comes from y times e to the minus st? This is ye to the minus st at 0 and infinity. OK.
I've integrated by parts. A very useful, powerful thing, not just a trick. OK. Now, can I recognize some of this? That is minus minus, no problem. I bring out-- that s is a constant. Bring it out, s. Now, what do I have left when I bring out that s? I have the integral of ye to the minus st dt. That is exactly the Laplace transform of y. It's exactly capital Y.
Put the equal sign here. I'll make that 0 a little smaller, get it out of the way. OK. sY of s. So that whole term has a nice form. When you take the derivative of a function, you multiply its Laplace transform by s. That's the rule. Take the derivative of the function, multiply the Laplace transform by s. If we have two derivatives, we'll multiply by s twice. Easy.
That's why the Laplace transform works. But now, here is a final term. y at infinity-- well, and e to the minus st at t equal infinity, 0. Forget it. So I just have to subtract off y at 0 times e to the minus st at 0, which is 1. e to the 0 is 1. So do you see that the initial condition comes into the transform? It's like, great.
We have the transform of Y. Now, all this is the transform. This is the transform of dy dt that we found. Now, why did I want that? Because I plan to take the transform of every term in my equation.
So like there are two steps to using the Laplace transform. One is to compute some transforms like this one, and some rules like this one. That's the preparation step. That comes from just looking at these integrals.
And then to use them, I'm going to take the Laplace transform of every term. So I have an equation. I take the Laplace transform of every term. I've got another equation. So the Laplace transform of this is sY of s minus y of 0. That was a Laplace transform of this part.
Now the Laplace transform of this is minus a, a constant, Y of x. And the Laplace transform of 0 is 0. Do you realize what we've done? I've taken a differential equation and I've produced an algebra equation. That's the point of the Laplace transform, to turn differential equations-- derivatives turn into multiplications, algebra.
So all the terms turn into that one. And now comes-- so that's big step one. Transform every term. Get an algebra problem for each s. We've changed from t, time in the differential equation, to s in Laplace transform.
Now solve this. So how am I going to solve that? I'm going to put y of 0 on to the right-hand side. And then I have Y of s times s minus a. So I will divide by s minus a. And that gives me Y of s. So that was easy to do. The algebra problem was easy to solve. The differential equation more serious.
OK. The algebra problem is easy. Are we finished? Got the answer, but we're in the s variable, the s domain. I've got to get back to-- so now this is going to be an inverse Laplace transform. That's the inverse transform. To give me back y of t equals what?
How am I going to do the inverse transform? So now I have the transform of the answer, and I want the answer. I have to invert that transform and get out of s and back to t. Well, y of 0 is a constant. Laplace transform is linear, no problem. So have y of 0 from that. And now I have 1 over s minus a.
So I'm asking myself, what is the function whose transform is 1 over s minus a? Then it's that function that I want to put in there. And what is the function whose transform is 1 over s minus a? It's the one we did. It's this one up here. 1 over s minus a came from the function e to the at.
So that 1 over s minus a, when I transform back, is the e to the at. And I'm golden. And that you recognize, of course, as the correct answer, correct solution to this differential equation. The initial value y of 0 takes off with exponential e to the at. No problem. OK.
Can I do one more example of a first order equation? Now I'm going to put it in an f of t. I'm going to put in a source term . So I'll do all the same stuff, but I'm going to have an f of t. And what shall I take for-- I'll take an exponential again, e to the ct. So that's my right-hand side.
Can I do the same idea, the central idea? Take my differential equation, transform every term. I've started with a time equation and I'm going to get an s equation. So again, dy dt minus ay, that transformed to-- what did that transform to? sY of s minus y of 0. Came from there. Minus aY of 0-- minus aY of s. Minus aY of s.
And on the right-hand side, I have the transform of e to the ct. We're getting good at this transform. 1 over s minus c, instead of a at c. OK. That's our equation transform. Now algebra. I just pull Y of s out of that. How am I going to pull Y of s out of this equation?
Well, I'll move y of 0 to the other side. And I'll divide by s minus a. Look at it. Y of s is-- OK. I have 1 over s minus c. And I have an s minus a that I'm dividing by. S minus a. And then I have the y of 0 over s minus a.
I've transformed the differential equation to an s equation. I've just done simple algebra to solve that equation. And I've got two terms. Two terms. You see that term? That's what I had before. That's what I had just there. The inverse transform was this. No problem. That's the null solution that's coming out of the initial value .
The new term that's coming from the e to the ct, coming from the force, is this one. And I have to do its inverse transform. I have to figure out what function has that transform. And you may say, that's completely new. But we can connect it to the one we know.
OK. So that will give me the same inverse transform, the growing exponential. But what does this one give? That's a key question. We have to be able to do-- invert, figure out what function has that transform? The function will involve a and c and t, the time. And s, the transform variable, will become t, the time period.
So that's the big question. What do I do with this? And notice, it has two poles. It blows up at s equal a, and it blows up at s equal c. And I have to figure out-- well, actually, by good luck, I want to separate those two poles. Because if I separate the two poles, I know what to do with a blow up at s equal a and a blow up at s equal c.
The problem is, right now I have both blow ups at once. So I'm going to separate that. And that's called partial fractions. So I will have to say more about partial fractions. Right now, let me just do it. That expression there, I'll take this guy away. Because it gives that term that we know.
It's this one. Is that one. It's this two poles thing that I want to separate those two poles. So this is algebra again. Partial fractions is just algebra. No calculus. No derivatives are in here. I just want to write that as 1 over s minus c. It turns out-- look. There's a way to remember the answer.
s minus c times c minus a and 1 over s minus a. And now a minus c. Do you see that that has only one pole at s equals c? This is just a number. This has one pole at s equals a. That's just a number. In fact, those numbers are the opposite.
So now, are we golden? I can take the inverse transform with just one pole. So now that gives me the solution y from-- so this is just a constant, 1 over c minus a. And what is the inverse transform of this? That's the simple pole at c. It came from a pure exponential, e to the ct. Right?
And now this guy, this one. OK. Well, this has a minus c, which is the opposite of c minus a. So if I put a minus sign, I can put them all over c minus a. Look at that. Look at this. C minus a is in both of these. Here it is with a plus sign. And that transform came from that function. Here it is with a minus sign. So I want a minus there.
And what function gave me that transform? e to the at, right? That's the one we know. The unforgettable transform of a simple exponential, e to the at. That is the particular solution. So the Laplace transform, we transformed the differential equation. We got an algebra equation. We solved that algebra equation, and then we had to go backwards to find what function had this transform y.
And to see that, clearly we had to use this partial fraction idea which separated these two poles into one pole there, when s is c, and another pole, when s is a. We've got two easy fractions. The easy fractions each gave me an exponential. And the final result was this one. And I don't know if you remember that. That is the correct solution to the first order linear constant coefficient equation, the simple equation there, when the right-hand side is e to the ct.
So our final solution then is the null solution with the initial value in it. And that function comes from the right-hand side, comes from the force, e to the ct. And so that's how Laplace transforms work. Take the Laplace transform of every term. Solve for y of s, and try your best to invert that transform. OK. More of that coming in the next lecture on Laplace transforms. Thank you.
1.1: Overview of Differential Equations Linear equations include dy/dt = y, dy/dt = –y, dy/dt = 2ty . The equation dy/dt = y *y is nonlinear.
1.2: The Calculus You Need The sum rule, product rule, and chain rule produce new derivatives from the derivatives of xn , sin(x ) and ex . The Fundamental Theorem of Calculus says that the integral inverts the derivative.
1.4b: Response to Exponential Input, exp(s*t) With exponential input, est , from outside and exponential growth, eat , from inside, the solution, y(t), is a combination of two exponentials.
1.4c: Response to Oscillating Input, cos(w*t) An oscillating input cos(ωt ) produces an oscillating output with the same frequency ω (and a phase shift).
1.4d: Solution for Any Input, q(t) To solve a linear first order equation, multiply each input q(s) by its growth factor and integrate those outputs.
1.4e: Step Function and Delta Function A unit step function jumps from 0 to 1. Its slope is a delta function: zero everywhere except infinite at the jump.
1.5: Response to Complex Exponential, exp(i*w*t) = cos(w*t)+i*sin(w*t) For linear equations, the solution for f = cos(ωt ) is the real part of the solution for f = eiωt . That complex solution has magnitude G (the gain).
1.6: Integrating Factor for a Constant Rate, a The integrating factor e-at multiplies the differential equation, y’=ay+q, to give the derivative of e-at y: ready for integration.
1.6b: Integrating Factor for a Varying Rate, a(t) The integral of a varying interest rate provides the exponent in the growing solution (the bank balance).
1.7: The Logistic Equation When –by2 slows down growth and makes the equation nonlinear, the solution approaches a steady state y( ∞) = a/b.
1.7c: The Stability and Instability of Steady States Steady state solutions can be stable or unstable – a simple test decides.
2.1: Second Order Equations For the oscillation equation with no damping and no forcing, all solutions share the same natural frequency.
2.1b: Forced Harmonic Motion With forcing f = cos(ωt ), the particular solution is Y *cos(ωt ). But if the forcing frequency equals the natural frequency there is resonance.
2.3: Unforced Damped Motion With constant coefficients in a differential equation, the basic solutions are exponentials est . The exponent s solves a simple equation such as As2 + Bs + C = 0 .
2.3c: Impulse Response and Step Response The impulse response g is the solution when the force is an impulse (a delta function). This also solves a null equation (no force) with a nonzero initial condition.
2.4: Exponential Response - Possible Resonance Resonance occurs when the natural frequency matches the forcing frequency — equal exponents from inside and outside.
2.4b: Second Order Equations With Damping A damped forced equation has a particular solution y = G cos(ωt – α). The damping ratio provides insight into the null solutions.
2.5: Electrical Networks: Voltages and Currents Current flowing around an RLC loop solves a linear equation with coefficients L (inductance), R (resistance), and 1/C (C = capacitance).
2.6: Methods of Undetermined Coefficients With constant coefficients and special forcing terms (powers of t , cosines/sines, exponentials), a particular solution has this same form.
2.6b: An Example of Method of Undetermined Coefficients This method is also successful for forces and solutions such as (at2 + bt +c) est : substitute into the equation to find a, b, c .
2.6c: Variations of Parameters Combine null solutions y1 and y2 with coefficients c1(t) and c2(t) to find a particular solution for any f(t).
2.7: Laplace Transform: First Order Equation Transform each term in the linear differential equation to create an algebra problem. You can then transform the algebra solution back to the ODE solution, y(t) .
2.7b: Laplace Transform: Second Order Equation The second derivative transforms to s2Y and the algebra problem involves the transfer function 1/ (As2 + Bs +C).
3.1: Pictures of the Solutions The direction field for dy/dt = f(t,y) has an arrow with slope f at each point t, y . Arrows with the same slope lie along an isocline.
3.2: Phase Plane Pictures: Source, Sink Saddle Solutions to second order equations can approach infinity or zero. Saddle points contain a positive and also a negative exponent or eigenvalue.
3.2b: Phase Plane Pictures: Spirals and Centers Imaginary exponents with pure oscillation provide a “center” in the phase plane. The point (y, dy/dt) travels forever around an ellipse.
3.2c: Two First Order Equations: Stability A second order equation gives two first order equations for y and dy/dt . The matrix becomes a companion matrix.
3.3: Linearization at Critical Points A critical point is a constant solution Y to the differential equation y’ = f(y) . Near that Y , the sign of df/dy decides stability or instability.
3.3b: Linearization of y'=f(y,z) and z'=g(y,z) With two equations, a critical point has f(Y,Z) = 0 and g(Y,Z) = 0. Near those constant solutions, the two linearized equations use the 2 by 2 matrix of partial derivatives of f and g .
3.3c: Eigenvalues and Stability: 2 by 2 Matrix, A Two equations y’ = Ay are stable (solutions approach zero) when the trace of A is negative and the determinant is positive.
5.1: The Column Space of a Matrix, A An m by n matrix A has n columns each in R m . Capturing all combinations Av of these columns gives the column space – a subspace of R m .
5.4: Independence, Basis, and Dimension Vectors v 1 to v d are a basis for a subspace if their combinations span the whole subspace and are independent: no basis vector is a combination of the others. Dimension d = number of basis vectors.
5.5: The Big Picture of Linear Algebra A matrix produces four subspaces – column space, row space (same dimension), the space of vectors perpendicular to all rows (the nullspace), and the space of vectors perpendicular to all columns.
5.6: Graphs A graph has n nodes connected by m edges (other edges can be missing). This is a useful model for the Internet, the brain, pipeline systems, and much more.
6.1: Eigenvalues and Eigenvectors The eigenvectors x remain in the same direction when multiplied by the matrix (A x = λx ). An n x n matrix has n eigenvalues.
6.2: Diagonalizing a Matrix A matrix can be diagonalized if it has n independent eigenvectors. The diagonal matrix Λis the eigenvalue matrix.
6.3: Solving Linear Systems d y /dt = A y contains solutions y = eλt x where λ and x are an eigenvalue / eigenvector pair for A .
6.4: The Matrix Exponential, exp(A*t) The shortest form of the solution uses the matrix exponential y = eAt y (0) . The matrix eAt has eigenvalues eλt and the eigenvectors of A.
6.4b: Similar Matrices, A and B=M^(-1)*A*M A and B are “similar” if B = M-1AM for some matrix M . B then has the same eigenvalues as A .
6.5: Symmetric Matrices, Real Eigenvalues, Orthogonal Eigenvectors Symmetric matrices have n perpendicular eigenvectors and n real eigenvalues.
7.2: Positive Definite Matrices, S=A'*A A positive definite matrix S has positive eigenvalues, positive pivots, positive determinants, and positive energy vT Sv for every vector v. S = AT A is always positive definite if A has independent columns.
7.2b: Singular Value Decomposition, SVD The SVD factors each matrix A into an orthogonal matrix U times a diagonal matrix Σ (the singular value) times another orthogonal matrix VT : rotation times stretch times rotation.
7.3: Boundary Conditions Replace Initial Conditions A second order equation can change its initial conditions on y(0) and dy/dt(0) to boundary conditions on y(0) and y(1) .
8.1: Fourier Series A Fourier series separates a periodic function F(x) into a combination (infinite) of all basis functions cos(nx) and sin(nx) .
8.1b: Examples of Fourier Series Even functions use only cosines (F(–x) = F(x) ) and odd functions use only sines. The coefficients an and bn come from integrals of F(x) cos(nx ) and F(x) sin(nx ).
8.1c: Fourier Series Solution of Laplace's Equation Inside a circle, the solution u (r , θ) combines rn cos(n θ) and rn sin(n θ). The boundary solution combines all entries in a Fourier series to match the boundary conditions.
8.3: Heat Equation The heat equation ∂u /∂t = ∂2u /∂x2 starts from a temperature distribution u at t = 0 and follows it for t > 0 as it quickly becomes smooth.