Today we will start a new topic which given
everything that we have been doing so far
that this basically we have been looking at
one dimensional flow, will be a little different
it is in some fashion connected to the material
that we did right in the beginning of the
course when we talked about representation
of functions and so on, okay, so I want to
give you a flavor for variational techniques.
Some of you may have encountered these variational
techniques in different courses earlier, variational
principles are used, right, have been used,
principle of virtual work and so on, you may
have seen these before. So there is whole
area of study called calculus of variations,
if you happen to take the elective it is good,
but I think the last time I asked nobody is
really dealt with calculus of variations before.
So what I will do again in the spirit of this
introductory course I will try to give you
a flavour for calculus of variations, it is,
I am not going to do any finite element method
as I said in right of the class of techniques
I have basically looked at finite difference
method I have mentioned, hand waved little
on finite volume method, but this is in a
sense of foundation for finite element method,
okay.
In the sense it is basically the foundational
material for finite element method. So the
idea is very simple, what I am going to do
is I am going to set up the relevant theorem,
the important theorem that we need, so I am
going to do it in parts, okay, so mathematics
normally the way we prove something is that
we take intermediate steps which are called
Lemmas and then you prove your theorem based
on that Lemmas, it is a logical sequence.
So the other reason why I want to do this
is also to give you in case you have not had
this before a flavour of proving something
okay, so you may have seen, in calculus maybe
you have manipulated, perform manipulations
and so on, but just so that at more mature
stage again you see right when these techniques
of proving something. So that is basically
the driving motive for these set of classes
is that fine.
So there are 2 ways that I could do this one
of course I could give you the motivation
right up front, or we could move at the Lemmas,
I do not know what is the, we will try out
what the Lemmas like and then maybe we can
see whether motivation is required I will
give you the motivation, is that fine, okay.
So the first Lemma, this is by the way I am
following calculus of variations by Gelfand
and Fomin, a very readable book, you can check
it out, our library has it. So the first Lemma,
okay, basically says if alpha of x is the
continuous function on an interval a, b, so
I would write that as alpha of x belongs to
a, b, so this is shorthand notation, right
that is the whole point about mathematics
that learning language, I hope all you are
familiar with this.
So C a, b is like this big bowl and the bowl
contains continuous functions, you can stick
your hand and take out a function right from
that bowl, am I making sense. The a, b indicates
that it is a bowl of functions defined on
the domain a, b, on the interval a, b is that
fine, is that okay, right, this is just matter
of notations, alpha of x belongs to C so I
am taking an alpha from this and I will have
another function h of x which belongs to sum
over notation.
So I am basically going to be introducing,
I am using this opportunity to introduce this
kind of notation, so C0 a, b and what I mean
by this putting this 0 in between is that
h is not only continuous on in the interval
it is defined, it is a function on the interval
a, b but it is 0 at the end point, what I
mean by this is h of a = h of b = 0.
The integral of over a, b, alpha of x, h of
x, dx if it = 0 for any h normally if you
look at Gelfand this statement would come
afterwards, you basically say if alpha of
x belongs to this and integral a, b alpha
of x, h of x, dx = 0 for any h of x coming
from here then alpha of x is identically 0
okay, fine. So the way mathematics works,
if you are taught about this is basically
a conversation between 2 individuals, right,
all you have to have a split personality,
right.
So essentially what I am saying the statement
of this theorem what I am saying is look I
will give you an alpha of x, the alpha of
x will be defined on the interval a, b, it
will be continuous, right, so I am going to
give you a continuous alpha of x such that
alpha of x a, b integrated this integral will
be 0. Now the other individual, you can pick
any h of x that you want, you pick any h of
x that you want which is 0 at the end points
and it is continuous.
And I guarantee right this integral will be
0, fine, to which then you say at no, your
alpha must be 0, am I making sense that is
the conversation, right, so it is like a discussion,
I am basically saying, look, I will pick an
alpha of x, I do not tell you what and I am
guaranteeing this is 0 and you get to pick
the h of x, you pick any h of x that you want,
as long as it is continuous then ha = hb = 0
okay, right.
So it is like conversation to which you basically
say, if you tell me that then I insist that
you must be picking an alpha it cannot be
that oh I will just pick some alpha, your
alpha has to be 0 that is what you are insisting,
your alpha has to be 0, is that fine, okay,
so you know mathematicians will look for different
ways by which, the straightforward way would
be that you assume that, you give me the benefit
of the doubt.
You see okay Ramakrishna, impossible, you
can actually find, we will give you right,
there is a place, there is alpha is not 0
everywhere, it is not identical you see, okay,
alpha is not identical, we will go with you,
let us see where you go, right, basically
you say I will give you what you want, we
will get you in trouble, that is the idea,
right, so alpha of x is not equal to 0.
At some xi, there is some point xi in the
interval a, b, right, where alpha is not 0,
alpha being a continuous function there is
a small neighbourhood around that point where
it is not 0 basically okay, that is the idea,
there is a small neighbourhood where it is
not 0 that is why the continuity component
is important, you have to make sure that I
use every bit that I have stated here, right.
So if the function is continuous you cannot
just have a nonzero value here and zero everywhere
else that does not make sense, right, so there
has to be a neighbourhood in which it is nonzero
and we can assume that without loss of generality
as they say then it is positive, you can make
the same argument assuming that it is negative,
is that fine okay.
So I finished my part of the story, now your
part of the story, now you have to get me
into trouble, so your part of the story would
be, okay, we need to pick an h, you get to
pick the h, right, see what I am saying is
for any h this is true, you have to just pick
one h for which it fails, that is all that
you need to do. Your hunt now is to find an
h that gets me into trouble, is that fine.
So 
you pick an h in such a fashion that it is
0 everywhere and nonzero on this interval,
that is the idea, am I making sense, okay,
so you can pick an h so if this happens to
be say x1 and that happens to be x2, there
is an interval over which it is nonzero, right,
so if I pick an h of x which equals and there
are different ways by which we could do this,
of course we know other way by which we can
construct it.
But anyway I will just write x – x1 times
x2 – x, I picked this cleverly for x and
x1, x2. You understand what I am saying right,
so in my mind, I said well if the point is
in between, I want something positive times
something else that is positive, right, so
x2 is > x if it is in that interval, x1 is
< x if it is in that interval so x-x1 times
x2-x is positive, right, that is why I picked
that, am I making sense and it is 0 at the
end points x=x1 it is 0 x=x2 it equals 0,
okay.
You could have used our HAT functions also,
you could have put a small HAT function there
instead of this but it does not matter equals
0 otherwise. So then what? I substitute integral
a to b alpha of x h of x dx = integral x1
to x2 where it is nonzero alpha of x h of
x dx is not equal to 0, violating my guarantee,
you understand, which means that I cannot
guarantee, the only way I can guarantee this
is if alpha of x = 0 identically everywhere,
is that fine.
This Lemma is just a sort of warm up to get
you a feeling as to where we are going okay,
I am not going to use this directly, but the
next Lemma we will use directly okay, fine.
Questions? Okay, let us try one more, see
where that goes if alpha of x is in C a, b
same thing and h of x is in now I am going
to change it, I will say C1 a, b, the superscript
1 indicates now h has also got derivatives
okay, the superscript 1.
Now I am not talking about functions that
are continuous right, the function can be
continuous, but there may be points where
the derivative is not defined, okay, now I
am saying no the derivative is there everywhere,
this is the bowl of function which can be
differentiated everywhere, okay, this earlier
this is the set of functions which were just
continuous, now we are basically saying no
that is not it, this is the set of functions
which is not only continuous, but also has
derivatives, okay.
It is just notation that basically tells us
see, you have to get comfortable with it,
very quickly it looks like oh it gets messy,
but if you imagine look at how compact that
notation is, defined on the interval a, b,
0 at the end points has derivatives, you understand,
right, it is continuous derivatives, fine.
Okay, if alpha of x h prime of x where h prime
indicates differentiation with respect to
h.
Then what do you expect? We will turn out
that alpha of x is identically a constant.
Okay, we will turn out that alpha of x is
identically a constant, is that fine. Now
we have the same strategy now, we have to
figure out a strategy before we start off,
obviously what you are going to say is, we
have the same discussion, right, it is obvious
that I am saying, I am going to give you an
alpha from this bowl of continuous functions.
So I am going to dip my hand in and take out
an alpha and I will take that alpha and I
guarantee to you for the alpha that I have
got, I take a look at that alpha and say you
know what, for the alpha that I have this
will always be true, you get to choose the
h, this will always be true to which again
your response will be if that is the fact
then your alpha must be a constant, okay,
right.
And again we go through the same argument
saying well okay may be my alpha is not a
constant, right, you give me the benefit of
the doubt one more time, and say okay alpha
is not a constant, alpha is the function of
x, so if alpha varies your business now is
to give me an h that will get me into trouble,
right, so that it will force me to concede
that alpha is a constant, am I making sense,
okay, is that fine.
So our objective is now to construct an h
further, not only construct an h, h which
has a derivative, we need to construct an
h which has a derivative, with what we have
in our hands, what we have available to us
we need to construct an h which has derivatives
okay, so it is a good idea to define h as
the integral of something, see there is a
logic that pushes us, okay. So these are standard
tools that you would use when you are looking
for something.
There is inspiration it strikes you saying
oh I see the proof, the other is that you
sit down and you actually work through systematically,
so these are clues that you have, so it has
equal of constants, so we will start by defining
a constant as the average of the alpha, okay
and I do that the average value of the alpha,
right then if I say alpha is, you understand
what I am saying, alpha is a constant it will
be the average value obviously.
So the average value of alpha, I call that,
I will say constant, I will define C as what
is the average value integral a to b alpha
of x dx 1/b-a that is the average value. We
will start there, we will start with that
constant, okay, so if your alpha is identically,
so what I want all we have now come to is,
I have to prove that alpha is identically
that constant, fine, so this can be rewritten
actually, this is b-a times C which suspiciously
look like integral cdx between a to b, okay.
So b-a times C, so this looks like integral
cdx a to b right, which I take over to the
other side, the average in the sense I mean
you may have seen this normally people will
just do it direct, so you say the average
and we put a semicolon there, so alpha of
x, so I define a C in that fashion that is
just the average which is the same thing,
I have just manipulated, I started off with
the average, multiplied by b-a.
Recognize that that is the integral, average
that is essentially what it means right, the
integral is the function and the integral
of the average are the same and that is essentially
what we are saying, integral of the function
and the integral of the average are the same,
fine, right, so I said oh I need an h that
is differentiable, I have an integral, right,
so I can define an h now, so I say h of x,
okay, so what is h of a? 0, what is h of b?
0.
And the derivative exist, you understand what
I am saying, so we have got what we want,
is that fine. Now what, now I have to somehow
involve this in this integral, I have to get
an integral of this form, right, I have this,
so I say okay, let me look at into h prime
dx, okay, which is nothing but integral, okay.
So this is 0 because this is hb-ha this is
just hb-ha, C times hb-ha that is 0, this
is what we want, now what is this? this I
am guaranteeing to be 0, this is what I claim
is 0, I have given this to you, I said oh
you pick any h I guarantee this will be 0
right, so this is 0, fine that is given it
is 0, that is my guarantee, and what is this,
what is h prime, alpha – C so now I have
integral a to b alpha of x – C whole squared
dx = 0 and this is the positive quantity.
The integral of this positive quantity is
0 therefore the thing itself has to be 0 there
is no choice. Integrand is positive, is >/=0
alpha of x – C squared is >/=0 this tells
us that that is possible since this righthand
side equals 0 alpha of x has to be a constant,
has to be that particular constant, is that
fine, so it is not bad, I mean we can work
through and always when you are reading these
theorems you should always look at it as a
conversation right.
At least it helps me I do not know whether
it helps you, it would always help me right,
to look at it as a conversation. Okay, now
let us see if we can get to the third Lemma,
Lemma 3 before we get to the actual theorem
okay, the third Lemma.
Says I have 2 functions now, and if alpha
of x and beta of x belong to C a, b there
are 2 functions that I have, alpha of x and
beta of x that come from C a, b, right, so
and h(x) again may be I need to erase this,
belongs to a, b which is 0 at the end points
first derivative exists. The integral a to
b alpha of x, h of x + beta of x, h prime
of x dx = 0 okay, so this is neat relationship
then this is remembered that I have picked
alpha and beta from bowl of continuous functions.
If this is 0, right, then you can assert you
can tell me look you must have picked beta
which has actually got a derivative and that
derivative is alpha, if I guarantee this and
you can tell me you must have pick the beta
that has a derivative, right and that derivative
is alpha, okay, is that fine, so again we
look here we look for clues just like we did
last time clearly will have to figure out
something to do with this integral, now it
has h and h prime.
So we either have to convert it into something
that has h or something that has h prime,
we have done Lemma before which had an h prime,
right we had done a Lemma way before that
which had an h so if you could somehow convert
this to something that is completely h prime
or something that is completely h we could
apply one of the 2 previous Lemmas, okay that
is one thing that is clear, am I making sense,
see this is strange.
The first one had only h in it, the second
one had h prime in it, this has both, okay,
so I am taking well, yah if I want to convert
this to an h prime I know one rule that will
introduce derivative when we are doing integration,
integration by parts, we have products of
thing right, so I know one mechanism by which
we can do it. Integration by parts will get
me a derivative.
See we are working out strategy now, right,
so integration by parts will give me a derivate
so that is fine, okay, the second thing is
I want beta prime to be alpha so it looks
like I need the integral of alpha in some
fashion, so we start by defining a function
which is the integral of alpha so A of x is
integral a to x alpha of x dx, okay, so that
is the potential candidate for beta, you see
what I am saying because I look at this and
I say okay.
Let us lay the foundation first, right, so
we have that then what do we do? Integration
by part so we start with alpha of x, h of
x.
So the integral a to b alpha of x h of x dx
= integral, how should I do this, A of x,
h of x between the limits a to b actually
I want that but you understand what I am saying,
I basically want and minus the integral a
of x h prime of x dx, right, that is not bad,
we can just go back now and substitute for
alpha of x h of x, I can just make this an
indefinite integral if you want but anyway
it is okay I will leave it as it is since
I have written it I will leave it.
And therefore we apply Lemma 2, you understand,
I have some function of x times h prime of
x, dx = 0 and our second Lemma basically said
this quantity must be a constant, okay, am
I making sense, see that is the idea of, that
is why you do these Lemmas have small, small
results along the way, they are like they
are the programming equivalent of writing
small functions that you can use to build
the reach the bigger objective, okay, that
is the idea.
So this tells me that beta of x – a of x
= constant or beta of x is if I differentiate
beta prime of x is alpha x, okay, that is
3 Lemmas, this belongs to as I said the segment
of the course that I call 3 Lemmas in the
theorem, so we have done the 3 Lemmas what
about the theorem? for the theorem I will
give you motivation, right, why have we done
all of this what is the point, okay.
So we had said in the beginning as I said,
I will tie this up to the material what we
have talked about in the beginning of the
semester as I said in the beginning what we
are looking at is functions, the solutions
that we are looking at, right, are functions,
the problems that we have at hand, the solutions
that we seek are all functions. A simple example
now would be you are at your dining hall or
whatever having breakfast this morning, you
wanted to come to this class.
There are any number of paths that you can
take from your dining hall to the class, am
I making sense and each one of those paths
is the function of in this case x y z, right,
since we are on the third floor in this case
x y z, right, you start off, you walk along
or you bike along but we assume that you walked
along, so start walking, there are different
ways by which you can get here, okay.
Some of you may forget make a turn near chemistry
building and head out in the wrong direction
and then maybe come through humanities and
science block and come here so it is a long
winded path, right, so the question that we
have now, nice, so there are lots of path,
right, it is nice to know that there are lots
of paths, so one block path is blocked you
can come by another path.
So but the question that we asked now right
which makes this interesting is, is there
a shortest path? Is there a safest path? right,
is there a most energy efficient path? summer
is coming is there is a path that is the coolest
path?, see you have a metric, you have a measure,
this is like our residue, to say that yes
I have what I want, okay, so you can ask this
question, so there is an issue of optimality
here.
What is the optimal path, what is the best
path in some sense okay, so if you say that
you have the best, what do you do normally
in calculus if you say I have the maximum
or minimum, what is that we normally do? “Professor
- student conversation starts” no no before
you get to the derivative, derivatives comes
later, we will go towards something that looks
like the derivative, derivative comes later.
You perturb it “Professor - student conversation
ends”, you disturb it so if you think that
you have a minimum, you disturb it and the
disturbance should cause the value of whatever
the measure that you are looking at to increase,
am I making sense, so if you say I am looking
for the shortest path, if you disturb the
path, then the length should increase, it
should be longer than the shortest path, any
other path should be longer than the shortest
path.
So the length should increase does that make
sense, okay, but clearly you always want to
start whatever the disturbance that you do
you always want to start at the dining hall
and end up in this class room. If you create
a disturbance that takes you from the dining
hall and takes you toward the wrong classroom
that does not help, right, so that explains
why h of a = h of b = 0, h is the disturbance,
right, to explain why is the function.
What is this peculiar function that I am talking
about where I keep saying the end points are
0 and it is a continuous function, it is continuous,
yah you are not going to teleport from one
point to another point, you are not going
to it would be nice, but you are not going
to sort of walk along and suddenly zap and
then you appear at some other point, right,
there is no discontinuity, the path is a continuous
path.
Okay so the path is the continuous path, so
you are going to start at one point, always
end up at the other point these points are
the same, you can change the path, but the
end points do not change, okay, so what you
do is you have h of a = h of b = 0, a is the
starting path, b is the ending path, am I
making sense, and you have continuous functions
then you can perturb with this h that is the
idea, okay, fine.
So in calculus of variations the usual way
by which we do this maybe I will leave that
there, so we 
look at, we will use the standard notation
calculus of variations.
Functional, argument is a function, I am going
to give you a path, a whole path, you understand,
the argument is a function, so this thing
is a function of a function, right, so it
is a functional = integral a to b F(x, y,
y prime) dx where as earlier y prime is dy/dx
obviously y is the function of x, fine, what
we want is, we want J(y), we want that y,
we want to find a function y so that J(y)
is the minimum, it is an extremum or a maximum,
right.
This could be some function J(y) could be
of profits, you want to maximise your profit,
right, this could be some function, it could
be the distance between 2 points and J(y)
is the measure of the distance, you want to
minimize the distance, or it is the time,
right or you want to maximize. This is the
function, it gives you, J(y) is the amount
of time that an airplane flies.
You want to maximize it to get endurance then
y is the function that will tell you what
is the longest maximize that, you understand,
these are all basically they take a function
as an argument and it returns a number, it
is a map, it maps a function, given a function
it maps the function into a number, you understand
what I am saying, so if our function y, it
is y prime has a derivative.
If a function happens to come from C1 defined
on a, b it maps it to the real line, am I
making sense, that is what this is doing,
it is taking a function and giving you a number,
just like I normed it, norm of the function
that is what it did, the norm of the function
basically swallowed a function and spit out
a number, the same thing, okay that is what
normed it, so it is not very different from
something that we have seen before.
Okay so we want to take derivatives, we think
back derivatives, the perturbed J (y + h),
what is h? h is our earlier friend h, 0 at
the end points, you understand and continuous,
a to b F(x y +h y prime + h prime) dx, okay,
and just like we do when we define a derivative
I subtract this, from this I subtract that,
so I get J(y+h) –J(y) = integral a to b
F(dx), so far, so good, what can I do now.
Lefthand side there is nothing much we found,
we want to find that out, righthand side is
the only thing, there is not anything that
we can do here, so we look at this Taylor
series, you look at this you think Taylor
series right, since I am thinking in terms
of derivatives, ignore the fact that we are
talking about functions, ignore the fact that
this is the map from functions to real number,
right now.
Since we are thinking about derivatives, what
are the derivate, what is the general sort
of symptom or definition that I gave for a
derivative, it is a liner transformation and
a direction. We know the direction, I have
perturbed it in the direction of h, we want
the liner transformation corresponding to
that, getting out of that, right. We want
to get the liner transformation, not corresponding
to that, but getting out of that.
So we have the difference so what it basically
means I am going to expand this using Taylor
series and keep only the liner term, right,
keep it only till liner because that is what
I want, I want the liner transmission.
So what do I have? integral a to b F(x, y,
y prime) + what is the second term of Taylor
series, h times dou F/dou y + h prime times
dou F/dou y prime – is that fine everyone.
I am just blindly doing Taylor series, just
manipulate the ink marks, manipulate the chalk
dust do not worry about oh this is the derivative
all of that kinds of stuff, remember what
we did when we did Flux Jacobian, substituting
q1, q2, q3.
If it helps you replace this by x, y and z,
instead of y prime, okay, think of it as x,
y and z, right so then this would be h times
dou F/dou y delta z times you understand what
I am saying, dou F/dou z that is it, this
is the Taylor series, right, and I have chopped
it off at the liner term, this of course cancels,
giving me the integral a to b, h dou F/dou
y + h prime dou F/dou y prime dx since it
is the liner part.
We call it the first variation it is given
the symbol delta J called the first variation
it is a change, it is a first variation like
it sounds like first derivative, like the
first variation, and if it is an extremum
this variation will be 0, fine. Now we are
ready to apply Lemma 3. Lemma 3 basically
says that if you have alpha of x h of x +
beta of x h prime of x dx = 0, 0 for any h
that you give right, any pertubation that
you give then beta prime of x = alpha of x.
That is beta prime is d/dx dou F/dou y prime
= dou F/dou y, is that fine everyone, these
equations are called we have seen this maybe
in your physics or something of that sort,
Euler Lagrange equation okay, fine. In your
physics most probably you heard about it as
a Lagrange equation, you would define the
Lagrange and then so on, right, so that comes
from the analytic dynamics point of view.
So they are called the Euler Lagrange equation,
is that fine, has any questions. So we have
managed, this is an interesting thing that
has happened here. So this is a differential
equation, right, in some sense this is like
a derivative. So we have managed basically
to go from an integral variational form which
was here, we managed to go from an integral
variational form J(y) which we want to minimize
or maximize or get the extrema.
Right get either the maxima or minima, you
managed to go from this form through this
process to a differential equation, so we
have gone from something that looks, so this
is like differentiating it in some fashion,
like taking a derivative and setting it equal
to 0 that is basically what we have done.
We wanted an extremum from that functional
and we have managed by some process of differentiation
to get a differential equation.
Is that okay, everyone, is that fine. Of course,
there is the equivalent, you could ask the
question if I give the differential equation
can I go back to the variational form, okay,
and just like differentiation and integration,
going from there to here is easier than going
from here back there, right, because now you
have to guess, you have to come up with the
variational problem and then turn around and
say, if I take the first variation of that
though I get the equation that I have at hand.
So it is like the equivalent of the integration
form, again involves guessing, right, so the
direct thing going from the variational problem
the optimization problem to here is relatively
easy, fine, is relatively straightforward,
very often there are times, you can ask the
question, why would you want to go from here
to there, there are times when this is very
messy and the variational form looks quite
simple and elegant.
Okay, maybe I will give you an example of
that a little later. Let me see if we can,
I will just set this up, we will see how far
we can take this today, so what was the example
that we talked about, we talked about distance
between 2 points right.
So I will take the distance between 2 points
a and b, that is a, that is b this is x axis,
right and what we want is we want y of x such
that length of the path I should not say distance
between 2 points, length of the path is shortest,
okay, the shortest path then you could identify
as the distance between 2 points and I have
actually changed though I gave the example
as from your dining hall to here.
I in an subtle way change the problem how
I change the problem? there are no obstacles
here, this is truly the straight line, there
are no buildings in between, there are no
obstacles, you can just walk the straight
line path which is what you should get, right
you can just walk the path, am I making sense,
so what is the length of this path, y(x)?
what is J(y)? integral a to b, remember square
root of 1 + y prime squared dx.
Okay, it is the square root of ds squared,
ds squared is dx squared + dy squared, finally
write it this way 
and F happens to be okay.
What is dou F/dou y? = 0, fine, what is dou
F/dou y prime? = 2y prime/square root of 1
+ y prime squared, right the 2 and the half
cancel, so the Euler Lagrange equation tells
us that dou F/dou y is 0, Euler Lagrange equation
tells us that d/dx of y prime/square root
of 1 + y prime squared = 0 or y prime/square
root of 1 + y prime squared is the constant
just say C. There are different ways we could
do this.
But anyway we can start from here integrating
appropriately or we can do indefinite integrals,
then it is alpha y prime, y prime squared
equals C times 1 + y prime squared. Therefore,
you always be careful when you square things,
you allow for spurious roots, therefore y
prime is 
squared if you want, you want me to keep it
simple, y prime squared is C/1-C, okay.
The 
other thing that you can do is you can integrate
this between a to x then you will get a lower
limit which is this quantity at a and then
you can manipulate if you feel more comfortable
doing that, so this tells you basically y
prime is a constant or y of x is a straight
line is that fine, okay, right, thank you.
