Choose the learning badge you'll earn today

Current time:0:00Total duration:18:48

0 energy points

# Introduction to the line integral

Introduction to the Line Integral. Created by Sal Khan.

Video transcript

If we're just dealing with two
dimensions, and we want to find the area under a curve, we have
good tools in our toolkit already to do it, and I'll
just remind us of our tools. so let's say, that's the
x-axis, that's the y-axis, let me draw some arbitrary function
right here, and that's my function f of x. And let's say we want to find
the area between x is equal to a, so that's x equal to
a, and x is equal to b. We saw this many, many,
many videos ago. The way you can think about it,
is you take super small widths of x, or super small
changes in x. We could call them delta x's,
but because they're so small, we're going to call them a dx. Super, infinitesimally
small changes in x. And then you multiply them
times the value of f of x at that point. So you multiply it times the
height at that point, which is the value of f of x. So you get f of x times each of
these infinitesimally small bases, that'll give you the
area of this infinitesimally narrow rectangle right there. And since each of these guys
are infinitely small, you're going to have an infinite
number of these rectangles in order to fill the space. You're going to have
an infinite number of these, right? And so the tool we use was
the definite integral. The definite integral is a sum,
is an infinite sum of these infinitely small areas,
or these infinitely small rectangles. And the notations that we
use, they would go from a b. And we've done many videos
on how do you evaluate these things. I just want to remind
you, conceptually, what this is saying. This is conceptually saying,
let's take a small change in x, multiply it times the height at
that point, and you're going to have an infinite number of
these, because these x's are super small, they're infinitely
small, so you're going to have an infinite number of those. So take an infinite sum of all
of those, from x is equal to a to x is equal to b. And that's just our standard
definite integral. Now what I want to do in this
video is extend this, broaden this a little bit, to solve, I
guess it maybe could say a harder or a broader
class of problems. Let's say that we are, let's
go to three dimensions now. And I'll just draw
the x-y plane first. Maybe I'll keep this, just to
kind of make the analogy clear. I'm going to kind of
flatten this, so we have some perspective. So let's say that this right
here is the y-axis, kind of going behind the screen. You can imagine if I
just pushed on this and knocked it down. So that's the y-axis, and that
is my x-axis right there. And let's say I some
path in the x-y plane. And in order to really define a
path in the x-y plane, I'll have to parameterize both
the x and y variables. So let's say that x is equal
to, let me switch colors. I'm using that orange too much. Let's say that x is is equal to
some function of some parameter t, and let's say y is equal to
some other function of that same parameter t, and let's say
we're going to start, we're going to have t go from, t is
going to be greater than or equal to a, and then less
than or equal to b. Now this will define a path in
the x-y plane, and if this seems confusing, you might want
to review the videos on parametric equations. But essentially, when t is
equal to a, you're going to have x is equal to, so t is
equal to a, you're going to have x is equal to g of a,
and you're going to have y is equal to h of a. So you're going to have this
point right here, so maybe it might be, I don't know, I'll
just draw a random point here. When t is equal to a,
you're going to plot the coordinate point g of a. That's going to be
our x-coordinate. This is g of a, right here. And then our y-coordinate
is going to be h of a. Right? You just put t is equal to a
in each of these equations, and then you get a
value for x and y. So this coordinate right
here would be h of a. And then, you would keep
incrementing t larger and larger, until you get to b, but
you're going to get a series of points that are going to
look something like that. That right there is a curve, or
it's a path, in the x-y plane. And you know, you're saying,
how does that relate to that right now? What are we doing? Well, let me just write a c
here, for saying, that's our curve, our that's our path. Now, let's say I have another
function that associates every point in the x-y plane
with some value. So let's say I have some
function, f of x y. What it does is associate
every point on the x-y plane with some value. So let me plot f of x y. Let me make a
vertical axis here. We could do a different color. Call it the f of x y axis,
maybe we could even call it the z-axis, if you want to. But some vertical
axis right there. And for every point, so if you
give me an x and a y, and put into my f of x y function, it's
going to give you some point. So I can just draw some
type of a surface that f of x y represents. And this'll all become a lot
more concrete when I do some concrete examples. So let's say that f of x y
looks something like this. I'm going to try my
best to draw it. I'll do a different color. Let's say f of x y. Some surface. I'll draw part of it. It's some surface that
looks, let's say it looks something like that. That is f of x y. And remember, all this is, is
you give me an x, you give me a y, you pop it into f of x y,
it's going to give me some third value that we're going to
plot in this vertical axis right here. I mean, example, f of x y? It could be, I'm not saying
this is a particular case, it could be x plus y. It could be f of x y. These are just examples. It could be x times y. If x is 1, y is 2, f of
x y will be 1 times 2. But let's say when you plot,
for every point on the x-y plane, when you plot f of x y
you get this surface up here, and we want to do
something interesting. We want to figure out, not the
area under this curve, this was very simple when we
did it the first time. I want to find the area if you
imagine a curtain, or a fence, that goes along this curve. You can imagine this being a
very straight linear path, going just along the
x-axis from a to b. Now we have this kind of crazy,
curvy path that's going along the x-y plane. And you can imagine if you drew
a wall, or curtain, or a fence that went straight up from this
to my f of x y, let me do my best effort to draw that. Let me draw it. So it's going to go up to
there, and maybe this point corresponds to there. And when you draw that curtain
up, it's going to intersect it something like that. Let's say it looks
something like that. So this point right here
corresponds to that point right there. So if you imagine, you have a
curtain, f of x y is the roof, and this is a, what I've drawn
here, this curve, this kind of shows you the bottom of a wall. This is some kind
of crazy wall. And let me say, this point it
corresponds to, well, actually, let me draw it little
bit different. This point will correspond to
some point up here, so when you trace where it intersects, it
will look something maybe like that, I don't know. Something like that. And I'm trying my best to
help you visualize this. So maybe I'll shade this in
to make it a little solid, let's say f of x y is
little transparent. You can see. But you have this
curvy-looking wall here. And the whole point of this
video is, how can we figure out the area of this curvy-looking
wall, that's essentially the wall or the fence that happens
if you go from this curve and jump up, and hit the
ceiling at this f of x y? So let's think a little bit
about how we can do it. Well, if we just use the
analogy of what we did previously, we could
say, well look. Let's make a little change
in distance of our curve. Let's call that ds. That's a little change
in distance of my curve, right there. And if I multiply that change
in distance of the curve times f of x y at that point, I'm
going to get the area of that little rectangle right there. Right? So if I take the ds, my change
in my, you can imagine the arc length of this curve at that
point, so let me write, you know, ds is equal to super
small change in arc length of our path, or of our curve. That's our ds. So you can imagine, the area of
that little rectangle right there, along my curvy wall, is
going to be ds, I'll make it a capital S, ds times the
height at that point. Well, that's f of x y. And then if I take the sum,
because these are infinitely narrow, these ds's have
infinitely small width, if I were take the infinite sum of
all of those guys, from t is equal to a to t is equal to b,
right, from t is equal to a, I keep taking the sum of those
rectangles, to t is equal to b, right there, that
will give me my area. I'm just using the exact same
logic as I did up there. I'm not being very
mathematically rigorous, but I want to give you the intuition
of what we're doing. We're really just bending the
base of this thing to get a curvy wall instead of a
straight, direct wall like we had up here. But you're saying, Sal, this is
all abstract, and how can I even calculate something like
this, this makes no sense to me, I have an s here, I have
an x and a y, I have a t, what can I do with this? And let's see if we can
make some headway. And I promise you, when we do
it with a tangible problem, the end product of this video
is going to be a little bit hairy to look at. But when we do it with an
actual problem, it'll actually, I think, be very concrete, and
you'll see it's not too hard to deal with. But let's see if we can get
all of this in terms of t. So first of all, let's
focus just on this ds. So let me re-pick
up the x-y axis. So if I were to reflip the
x-y, let me switch colors, this is just getting
a little monotonous. So if I were to reflip the x-y
axis like that, actually, let me do that with that same
green, so you know we're dealing with the same x-y axis. So that's my y-axis,
that is my x-axis. And so this path right here, if
I were to just draw it straight up like this, it would
look something like this. Right? That's my path, my arc. You know, this is when t is
equal to a, so this is t is equal to a, this is
t is equal to b. Same thing, I just kind
of picked it back up so you can visualize it. And we say that we have some
change in arc length, let's say, let me switch colors. Let's say that this
one right here. Let's say that's some small
change in arc length, and we're calling that ds. Now, is there some way to
relate ds to infinitely small changes in x or y? Well, if we think about it, if
we really-- and this is all a little bit hand-wavy, I'm not
being mathematically rigorous, but I think it'll give you the
correct intuition-- if you imagine this is, you can figure
out the length of ds if you know the length of these
super small changes in x and super small changes in y. So if this distance right here
is ds, infinitesimally small change in x, this distance
right here is dy, infinitesimally small
change in y, right? Then we could figure out ds
from the Pythagorean Theorem. You can say that ds is going to
be, it's the hypotenuse of this triang.e It's equal to the
square root of dx squared plus dy squared. So that seems to make things a
little bit, you know, we can get rid of the ds
all of a sudden. So let's rewrite this little
expression here, using this sense of what ds, is really
the square root of dx squared plus dy squared. And I'm not being very
rigorous, and actually it's very hard to be rigorous with
differentials, but intuitively I think it makes
a lot of sense. So we can say that this
integral, the area of this curvy curtain, is going to be
the integral from t is equal to a to t is equal to b of f of x
y, instead of writing ds, we can write this, times the
square root of dx squared plus dy squared. Now we at least got rid of this
big capital S, but we still haven't solved the problem of,
how do you solve something, you know, an integral, a definite
integral that looks like this? We have it in terms of t
here, but we only have it in terms of x's and y's here. So we need to get
everything in terms of t. Well, we know x and y are both
functions of t, so we can actually rewrite it like this. We can rewrite it as from t is
equal to a, to t is equal to b. And f of x y, we can write it,
f is a function of x, which is a function of t, and f is also
a function of y, which is also a function of t. So you give me a t, I'll be
able to give you an x or y, and once you give me an x or y,
I can figure out what f is. So we have that, and then we
have this part right here. I'll do it in orange. Square root of dx squared
plus dy squared. But we still don't have
things in terms of t. We need a dt someplace
here in order be able to evaluate this integral. And we'll see that in the
next video, when I do a concrete problem. But I really want to give you a
sense for the end product, the formula we're going to get
at the end product of this video, where it comes from. So one thing we can do, is if
we allow ourselves to algebraically manipulate
differentials, what we can do is let us multiply
and divide by dt. So one way to think about it,
you could rewrite, so let me just do this orange
part right here. Let's do a little
side right here. So if you take this orange
part, and write it in pink, and you have dx squared, and then
you have plus dy squared, and let's say you just multiply
it times dt over dt, right? That's a small change in t,
divided by a small change in t. That's 1, so of course you
can multiply it by that. If we're to bring in this part
inside of the square root sign, right, so let me rewrite this. This is the same thing as 1
over dt times the square root of dx squared plus dy squared,
and then times that dt. Right? I just wanted to write it
this way to show you I'm just multiplying by 1. And here, I'm just taking this
dt, writing it there, and leaving this over here. And now if I wanted to bring
this into the square root sign, this is the same thing, this is
equal to, and I'll do it very slowly, just to make sure, I'll
allow you to believe that I'm not doing anything shady
with the algebra. This is the same thing as the
square root of 1 over dt squared, let me make the
radical a little bit bigger, times dx squared plus
dy squared, and all of that times dt, right? I didn't do anything, you could
just take the square root of this and you'd get 1 over dt. And if I just distribute this,
this is equal to the square root, and we have our dt at the
end, of dx squared, or we could even write, dx over dt squared,
plus dy over dt squared. Right? dx squared over dt
squared is just dx over dt squared, same thing
with the y's. And now all of a sudden,
this starts to look pretty interesting. Let's substitute this
expression with this one. We said that these
are equivalent. And I'll switch colors,
just for the sake of it. So we have the integral. From t is equal to a. Let me get our drawing back, if
I-- from t is equal to a to t is equal to b of f of x of t
times, or f of x of t and f of, or and y of t, they're both
functions of t, and now instead of this expression, we can
write the square root of, well, what's dx, what's the change in
x with respect to, whatever this parameter is? What is dx dt? dx dt is the same thing
as g prime of t. Right? x is a function of t. The function I wrote
is g prime of t. And then dy dt is same
thing as h prime of t. We could say that, you
know, this function of t. So I just wanted to
make that clear. We know these two functions,
so we can just take their derivatives with respect to t. But I'm just going to
leave it in that form. So the square root, and we take
the derivative of x with respect to t squared, plus the
derivative of y with respect to t squared, and all
of that times dt. And this might look like some
strange and convoluted formula, but this is actually something
that we know how to deal with. We've now simplified this
strange, you know, this arc-length problem, or this
line integral, right? That's essentially
what we're doing. We're taking an integral over
a curve, or over a line, as opposed to just an
interval on the x-axis. We've taken the strange line
integral, that's in terms of the arc length of the line, and
x's and y's, and we've put everything in terms of t. And I'm going to show you that
in the next video, right? Everything is going to be
expressed in terms of t, so this just turns into a
simple, definite integral. So hopefully that didn't
confuse you too much. I think you're going to see in
the next video that this, right here, is actually a
very straightforward thing to implement. And just to remind you where
it all came from, I think I got the parentheses right. This right here was just a
change in our arc length. That whole thing right
there was just a change in arc length. And this is just the height of
our function at that point. And we're just summing it,
doing an infinite sum of infinitely small lengths. So this was a change in our
arc length times the height. This is going to have an
infinitely narrow width, and they're going to take an
infinite number of these rectangles to get the area of
this entire fence, or this entire curtain. And that's what this definite
integral will give us, and we'll actually apply
it in the next video.