# Differential Equations and Linear Algebra, 7.3: Boundary Conditions Replace Initial Conditions

From the series: Differential Equations and Linear Algebra

*
Gilbert Strang, Massachusetts Institute of Technology (MIT)
*

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)*.

OK. Well my problem today is a little different. Because I don't have two initial conditions, as we normally have for a second-order differential equation. Instead, I have two boundary conditions.

So let me show you the equation. So I'm changing t to x because I'm thinking of this as a problem in space rather than in time. So there's the second derivative. The minus sign is for convenience. This is the load.

But here's the new thing. I'm on an interval 0 to 1. And at 0-- let me take 0 for the two boundary conditions.

So my solution somehow does something like this. Maybe up and back down. So it's 0 there, 0 there, and in between it solves the differential equation. Not a big difference, but you'll see that it's an entirely new type of problem.

OK. As far as the solution to the equation goes, there is nothing enormously new. I still have a y particular. A particular solution that solves the equation. And then I still have the y null, the homogeneous solution, any solution that solves the equation with 0 on the right hand side.

And in this example-- this is especially simple-- the null equation would be second derivative equal 0. And those are the functions, linear functions, that have second derivative equal zero. So there's the general solution.

And now I have to put in, not the initial conditions, but the boundary conditions. OK. So I substitute x equal 0. And I substitute x equal 1 into this. I have to find y particular.

I'll do two examples. I'll do two examples. But the general principle is to get these numbers, these constants like C1 and C2, from the boundary conditions.

I'll put in x equal zero. And then I'll have y of 0, which is y particular at 0, still defined, plus C times 0, plus d. That's the solution at the left end, which is supposed to be 0.

And then at the right end, end, I have whatever this particular solution is at 1, plus now I'm putting in x equal 1. I'm just plugging in x equals 0, and then x equal 1. And x equal 1, I have C plus D. C plus D. And that gives me 0. The two 0's come from there and there.

OK. Two equations. They give me C and D. So I'm all solved. Once I know how-- I know how to proceed once I find a particular solution.

So I'll just do two examples. They'll have two particular solutions. And they are the most important examples in applications. So let me start with the first example.

So my first example is going to be the equation minus D second y, Dx squared, equal 1. That will be my load. f of x is going to be 1.

So I'm looking for a particular solution to that equation. And of course I can find a function whose second derivative is 1, or maybe minus 1. My function will be-- well, if I want the second derivative to be 1, then probably 1/2 x squared is the right thing. And that would give me a minus. So I think I have a minus 1/2 x squared. That solves the equation.

And now I have the Cx plus D. The homogeneous, the null solution. And now I plug in. And again, I'm always taking y of 0 to be 0, and also y of 1 to be 0. Boundary conditions. Again, boundary condition, not initial condition.

OK. Plug in x equal 0. At x equals 0, what do I learn? x equal 0. That's 0, that's 0, so I learn that D is 0.

At x equal 1, what do I learn? This is minus 1/2. D is 0 now. And x is 1. So I think we learn C is plus 1/2. OK with that?

At x equal 1, I'm supposed to get 0 from the boundary condition. So I have minus 1/2, plus 1/2, plus 0. I do get 0. This is good.

So this answer is-- Cx, then, is 1/2 x minus 1/2 x squared. That's it. That's my solution. That function is 0 at both ends, and it solves the differential equation.

So that's a simple example. And maybe I can give you an application. Suppose I have a rod. Here's a bar. And those lines that I put at the top and bottom are the ones that give me the boundary conditions.

And I have a weight. A weight of 1. Maybe the bar itself. It gives-- elastic force. Gravity will pull, displace, the bar downwards because of its weight. It's elastic.

And this function gives me the solution, gives me the distribution. If I go down a distance x, then that tells me that this part of the bar, originally at x, will move down by an additional y. Moves. So this is now at x plus y of x. And that's the y. And that is 0 at the bottom, 0 at the top, and positive in between.

OK. That was a pretty quick description of an application. And more important, a pretty quick solution to the problem. Can I do a second example that won't be quite as easy?

OK. So again, my equation is going to be minus the second derivative equals a load. But now it will be a point load. A point load. That's a point load at x equal A.

This is my friend, the delta function. The delta function, you remember, is 0, except at that one point where this is 0. This is 0 at the point x equal A.

In my little picture of a physical problem, now I don't have any weight in the bar. The bar is thin. Weightless. But I'm putting on, at the point x equal A, right at this point, I'm attaching a weight.

So this distance is x equal A. Here's my weight, my load, hanging at this point. So I can see what will happen. That load hanging down there will stretch the part above the bar, above the load, and compress the part below the load. So it's a point load. Very important application.

OK. Now I have this equation to solve. OK. I can solve it on the one side of A, x equal A. And I can solve it on the other side of x equal A. Let me do that.

For x less than A, I have minus the second derivative. And what's the delta function for x below A, on the left side of the spike? 0. And x on the right side of the load, again, 0.

And what are the solutions to the null equation? y is Cx plus D on the left side of the load, there. And now here it may have some different constants. y equals, what shall I say, E x plus F, on the right side of the load.

And now I've got four numbers to find. C, D, E, and F. And what do I know? I know two boundary conditions. Always I know that y of 0 is 0, from fixing the top of the bar. So y of 0 equal 0.

And when I put in x equal 0, that will tell me D is 0. And then also y of 1 is 0. And that will be on this side of the load. So when I put in x equal 1, that will tell me that E plus F is 0, at x equal 1. So it tells me that F is minus E, right?

So what do I know now? D is gone. 0. F is minus E. So can I just change this to F is minus E. So I had E x minus E. E times x minus 1 takes care of that boundary condition. At x equal 1, it's gone.

OK. But I still have two, C and E, to find. So what are my two further conditions at the jump? So far I'm on the left of the jump, the spike, the impulse, the delta function. And on the right of it.

But now I've got to say, what's happening at the impulse? At the delta function. Or at the point load.

OK. Well, what's happening there? I need two equations. I've still got C and E to find.

So my first equation is that at that load, the bar is not going to break apart. It's just going to be stretched above and compressed below. But it is not going to break apart. So at the load, at which is x equal A. So now I'm ready for x equal A.

OK. What happens at x equal A? That's the same as that. Let me draw a picture of the solution, here.

Here is x. This is x. Here's y. Here is x equal 0. Here is x equal 1.

I see a linear function. Cx up to the point x equal A. And here I have a linear function coming back to 0. You see?

That's the picture of the solution. The graph of the solution. It has this 0 at the left boundary. It has 0 at the right boundary. It has, in between, it is Cx in the x minus E. And I have made it continuous at x equal A. The bar is not coming apart.

So that this solution runs into that solution. That's good. That's one more condition.

But I need one further, one final, condition. And somehow I have to use the delta function. And what does the delta function tell me? I'm just going to go give you the answer here, rather than a theory of delta functions.

That equation. So you see what my solution is. It's a broken line with a change of slope. It's a ramp. It has a corner. All those words describe functions like this.

So I have some slope going up here, and some slope-- and let me tell you. I'll tell you what those slopes are. I'll tell you what those slopes are in this. So I'll tell you the answer and then we'll check.

So that C turns out to be 1 minus A. So in this region, I have 1 minus A times x. In that region.

And in this region, below, so that's stretching. The fact that it's positive displacement means it's stretching. Now this part is going to be in compression, with that negative slope. And I think in this region it's 1 minus x times A, which will be coming from there.

So there is my solution. Because of the delta function, I need a two part solution. To the left of the delta function, the point load. And to the right of the point load.

And then we could check that at the load, x equal A. This is 1 minus A times A. This is 1 minus A times A. They do meet.

And now comes this mysterious fourth condition about the slopes. The slope drops by 1. Here the slope is 1 minus A. That's 1 minus A is the slope there. And here the slope is minus A. You see minus x times A, so the derivative is minus A.

So it was 1 minus A. The 1 dropped away and left me with minus A. That's what the solution looks like.

And now I have to say one word about why did the slope drop by 1. The slope dropped by 1, from 1 minus A to minus A. And that has to come from this delta function.

And of course you remember about the delta function. The key point is if when you integrate the delta function, you get 1. So when I integrate this equation, I get a 1 on the right hand side from the delta. And on the left hand side, I'm integrating the second derivative, so I get the first derivative.

Great. The first derivative at the end point, minus the first derivative at the start point, should be the 1. And that's the drop of 1.

I'll do a full-scale job with delta functions in another video. I want to keep this one under control. We're seeing the new idea is boundary conditions, and here we're seeing a delta function equation in this boundary value problem. Thank you.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

- América Latina (Español)
- Canada (English)
- United States (English)

Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

Asia Pacific

- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)