From the series: Differential Equations and Linear Algebra
Gilbert Strang, Massachusetts Institute of Technology (MIT)
The wave equation ∂2u/∂t2 = ∂2u/∂x2 shows how waves move along the x axis, starting from a wave shape u(0) and its velocity ∂u/∂t(0).
OK. This video is about the third of the great trio of partial differential equations. Laplace's equation was number one. That's called an elliptic equation. The heat equation was number two. That's called a parabolic equation. Now we reach the wave equation. That's number three, and it's called a hyperbolic equation. So somehow the three equations remind us of ellipses, parabolas, and hyperbolas.
They have different types of solutions. Laplace's equation, you solve it inside a circle or inside some closed region. The heat equation and the wave equation, time enters, and you're going forward in time. The heat equation is first order in time, du dt. And the wave equation, the full-scale wave equation, is second order in time. That stands for the second derivative, d second u dt squared. And it matches the second derivative in space with a velocity coefficient c squared.
I'm in one-dimensional space. If I were in three dimensions, where we really have sound waves and light waves and all the most important things in life, then there would be a uxx and a uyy and a uzz, second derivatives in all the space directions. But that's good enough to do 1D.
So what are the differences, first of all, between the heat equation and wave equation? So I'll say heat versus wave equations. What are the sort of biggest differences? The heat, the signal travels infinitely fast. Under the wave equation, the signal travels with finite velocity, and that velocity is that number c with speed c.
So fortunately, for sound waves, the wave comes to us, or when I'm speaking to you, my voice is traveling out to the microphone at the speed of sound, the speed c. And actually, another good thing is after it gets there, it goes on, and it goes by the point and doesn't just stay there messing up the future sounds. It travels. It dies out.
Whereas-- well, the heat. So let me try to give an example. Suppose the initial condition is a delta function. So if u equals a delta function, a point source, which is quite normal. A point source of heat, something really hot, or a point source of sound, my voice. So it's that at t equals 0. Then for the heat equation, there's a famous solution to the heat equation.
Remember, the heat equation is du dt equal uxx, first derivative in time. And the solution that starts from the delta function? Oh, do I know what it is? I think there's a 1 over-- there's a square root of 4 pi t. There's an e to the minus x squared over 4t. I think perhaps that's it. Perhaps that's it.
So what do I see from that? I see big damping out. I see immediate travel. As soon as time is just a little beyond 0, then for every x we get an answer, but it's an extremely, extremely small answer. e to the minus x squared is tailing off to 0 incredibly fast. So that's a very small answer. Very little of the heat immediately gets very, very quickly across the ocean. But in theory, a little bit does.
Whereas for the wave equation, it takes time to cross the ocean. We have a tsunami. We have a wave. It gets there. It reaches the other side. And actually, at the-- it's very important. What is the speed of that wave to tell people about a tsunami that's coming, and you can actually do it, which you couldn't do for the heat equation.
So for the wave equation, what comes out of a delta function in 1D? Well, a wave goes to the right, and a wave goes to the left. That's what happens. And those waves are 1/2 of a delta function each way. So the solution is 1/2 of a delta function that's traveling. I see that-- let me write down the other half that's traveling the other way-- delta at x plus ct.
That's a cool solution. So that means the sound in 1D, the sound, half of it takes off in one direction and half in the other direction. And what happens in each direction is a spike of sound. You don't hear anything, then at a particular time, depending on your position x, there's a particular time when you get 0 in there, and you hear the signal. And then as soon as time goes past that, it's past you. So you get a big shock, and it comes to you with speed c.
If you look at that expression x minus ct, it's telling you that the speed of the wave in dx dt for the wave is c. OK. So that's a contrast for a very particular initial condition-- a big wall of water, a big noise, a big bang. OK.
I want to solve the wave equation, study it further for other initial conditions. And of course, initial condition's plural because the wave equation is second order in time. So I'm given u at t equals 0 and all x and du dt. I'm given an initial distribution of the wall of water, shall we say, and its velocity, the normal thing.
When I have a second-order equation, I'm given an initial condition and an initial velocity. And of course, because it's a partial differential equation, I'm given those for every x. So we have functions instead of just two numbers, and that's where a Fourier series can come in.
So we can solve that by a Fourier series if we're on a finite-- like a violin string. You've plucked a violin string that starts waves going back and forth in the string. They solve the wave equation. You hear music, great music if it's a good sound. Or we could solve it on an infinite line with no boundary, as in an essentially infinite ocean or waves in space. Light waves in space are solving the wave equation with no boundary, as far as we know.
OK. So which shall I do? I'll write the solution down in free space, and then I'll write one down for a violin string. So in space-- well, it's a one-dimensional space here. So this would be minus infinity less than x less than infinity.
Then what does the solution to the wave equation look like? It looks like some function of plus some function of x plus ct. Well, that's exactly the form that we had here when they were delta functions. Here, in general, they don't have to be delta functions. I chose that function f and that function g so that at t equals 0, I'm good. So at t equals 0-- so I set t equals 0. At t equals 0, u of 0 and x would be f of x plus g of x. Good.
But that's only one condition, and I have f and g to find. So I would also use du dt at the start. What's the time derivative? It's minus c f prime at x. And the time derivative of this will be a plus c g prime at x. OK. No big deal. I'm given two functions. I've got two functions to find in the answer, and I've got two equations. I could solve those for f and g, and it gives a formula called d'Alembert's formula, named after the person who put this together.
I'd rather go on to the violin, to a finite string. OK. So now I have a finite string, and I'm holding u equals 0 at the ends. OK. And my solution will still be functions that depend on x minus ct waves. My solution will still be waves.
The solution that I'm going to write down comes from a very, very important method called separation of variables. I want to separate x from t. I need to give you a full video about separation of variables. That's the best tool we have to get solutions to lots of equations.
So let me just jump to the form of the solution here. I'm imagining the violin string is at rest. So it starts with-- I'm imagining, let's say in our particular problem, this is 0, the initial velocity. This is plucked. The starting position is-- with your finger you've moved it off 0. OK.
What do the solutions look like, u of t and x? OK. They will be a sum of neat, special, convenient, separated solutions, with separated meaning t separated from x. And I think we would have cosine of nct. I'm going to have a sum. Oh, we'll have a coefficient, of course, a sub-- well, or b, or c, or even d. How about d for a new letter-- d sub n. And I think-- well, let me finish here. I'm separating that from I think it would probably be the sine of nx. OK.
If we just look at that for a little bit, that's the point of this video. So this is x equals 0. This is, say, x equal pi. That's for convenience. Suppose our violin string has length pi, then, I think, that's what the solution looks like. It starts from at t equals 0. At t equals 0, the cosine is 1. So at t equals 0, this is an initial condition that we have to match. This'll tell us the d's will be the sum of dn sine nx. That tells us the d's. And then we have our answer.
So the initial condition-- remember, it's starting at rest. So the initial velocity is 0, and that's why I don't have any sine t's because I'm starting with initial velocity 0. I only have cosines in the t direction. But I only have sines in the x direction because the violin string is being held down at the two ends, and it's the sine function that matches that perfectly.
So this is separation of variables, t separated from x. And I really have to do a proper explanation of that highly important method of getting solutions like this. 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.