Worked example: slope field from equation | AP Calculus AB | Khan Academy
Which slope field is generated by the differential equation? The derivative of y with respect to x is equal to x minus y. And like always, pause this video and see if you can figure it out on your own.
Well, the easiest way to think about a slope field is if I was, if I needed to plot this slope field by hand, I would sample a bunch of x and y points, and then I would figure out what the derivative would have to be at that point.
What we can do here, since they've already drawn some candidate slope fields for us, is figure out what we think the slope field should be at some points and see which of these diagrams, these graphs, or these slope fields actually show that.
So, let me make a little table here. I'm going to have x, y, and then the derivative of y with respect to x. We can do it at a bunch of values. So let's think about it.
Let's think about when we're at this point right over here, when x is 2 and y is 2. When x is 2 and y is 2, the derivative of y with respect to x is going to be 2 minus 2; it's going to be equal to zero. Just with that, let's see here. This slope on this slope field does not look like it's zero; this looks like it's negative 1.
So already, I could rule this one out. This slope right over here looks like it's positive 1, so I’ll rule that out; it's definitely not 0. This slope also looks like positive 1, so I can rule that one out. This slope at (2, 2) actually does look like 0, so I'm liking this one right over here.
This slope at (2, 2) looks larger than 1, so I could rule that out. It was that straightforward to deduce that if any of these are going to be the accurate slope field, it’s this one. But just for kicks, we could keep going to verify that this is indeed the slope field.
So let's think about what happens when x is equal to 1. Whenever x is equal to y, you're going to get the derivative equaling 0. And you see that here; when you're at (4, 4), derivative equals 0. When it's (6, 6), derivative equals 0. At (-2, -2), derivative equals 0. So that feels good that this is the right slope field.
Then we could pick other arbitrary points. Let's say when x is 4, y is 2. Then the derivative here should be 4 minus 2, which is going to be 2. So when x is 4, y is 2, we do indeed see that the slope field is indicating a slope that looks like 2 right over here.
If it was the other way around, when x is, let’s say, x is -4 and y is -2, so (-4, -2), well, -4 minus -2 is going to be -2. And you can see that right over here.
(-4, -2) you can see the slope right over here. It's a little harder to see, looks like -2. So once again, in using even just this (2, 2) coordinates, we were able to deduce that this was the choice, but it just continues to confirm our original answer.