 last class we are discussing about the how to optimize a functional, functional is nothing but a function of a function. So, if you recollect this one that we our problem is there that a is a point and b is another point, then our problem is to minimize j is a functional which is expressed mathematically t 0 to t f, then v x of t which is a function of x dot of t and t d t. So, this point a is a point b is a point both the points are fixed and this is the t and this is x of t. So, a and b both are fixed that time at time t is 0 the point a and its coordinates is you can say this one t 0 x of t 0 this one and this coordinate is at time t is t f this coordinate is t f x of t f our problem is to find a trajectory between the two fixed point a and b in such a way. So, that the functional is optimized either maximize or minimize that is our problem. So, let us call this is our optimal trajectory x star of t and near about this optimal trajectory there is another trajectory is there which is nevering of this trajectory that is called that is a star. So, x a is equal to x star of t plus delta x of t this one. So, our problem is I told you find that the optimal trajectory x such that this functional is minimized. So, for that one if you recollect we consider first that what is the incremental what is called functional agree that means del j we found out and del j is a two parts after doing the Taylor series expansion. And their first part of what is called is called is the necessary condition for the functional to be minimized or maximized and second variation in functional is a first variation of functional we denoted by del j and second variation of the functional is del square j and higher terms of the Taylor series expansion we have neglected that if this. So, our first condition this delta of j is the increment of the functional agree increment of the change in functional values and delta j is first variation in functional value and delta square j is second variation in functional value. So, our first condition is delta j must be equal to 0 that is the necessary condition in order to get this one. We got it in step three if you recollect yesterday that what we got it we got it that del j is equal to t 0 to t f delta v x dot whole transpose and this value evaluate this is the nothing by vector this value evaluate along the trajectory then multiplied by delta x delta x is the change in coordinates of x when it is moving along the neighboring trajectory of optimal trajectory x star. And then second part is del v del v del x dot t whole transpose and put this value evaluate the value x is equal to x star x dot is equal to x star multiplied by delta x star. So, this second term of this one yesterday we have shown how to simplify this one the second term I have written it here say instead of delta x t by definition d of d t delta x t into d t as it is. So, nothing but if you consider this is v delta t delta t you can consider something like this cancelled. So, delta v d v and this whole quantity is known to use which is constant. So, u d v integration from 0 to t 0 t f I can write is nothing but a u v and its limit 0 to t 0 to t f minus v del v del u this is the del u and I multiply d t and d t this one. So, this things at this term we can express into sum of two terms. Now, look at this one because both the points are fixed a point is fixed along the optimal trajectory or along the part of trajectory which is very close to the optimal trajectory both the ends a and b are fixed. So, this delta x t if you see there since both the ends are fixed then I write delta x at t is equal to 0 is nothing but a 0 and delta x t is equal to t f is equal to 0 since if you see our delta a of x t is nothing but a x star of t plus delta x of t and t is equal to t 0 x of t 0 x of x star of t both are both are at the same point. So, delta x t delta x t must be 0. So, that is why this is there similarly at t is equal to t f here at t is equal to delta x t t is equal to t f delta x t is 0 because x star of t and x a star of x a t is equal to a both are same below. So, delta e is 0 if you put this condition here the first term will not come into the picture only this term. So, this the second term of this first variation of functional can be written as this term when both the ends are fixed. So, keeping that things in mind delta j now I can write it here if you use the this expression in equation number 3 equation number 3 then I can write it you see this limit is t 0 to t f delta v transpose this when x is equal to find out this value x t is equal to x star x dot t is equal to x star into delta x this is replaced by this one d of d t del v x dot of t transpose evaluate this values x t is equal to x star t x dot t is equal to x star into delta x I have considered let us call x is a scalar variable x dot is a scalar variable. So, whether you multiply because delta x I keep it here. So, if you do this one from equation 3 I can write from equation 3 and using the expression and replacing that del v dot del x dot of t whole transpose x t is equal to x star of t x dot t is equal to x dot star of t delta x dot of t into d t that things again whole thing. So, this limit is t 0 to t f this I can replace by equal to minus that from equation replacing that quantity minus this quantity is replacing by this one t 0 to t f d of d t del v dot del x dot of t whole transpose put the values evaluate the values x of t is equal to x star of t and x dot t is equal to x star dot of t. This in this equation you just put it then into this into what you can write it this into our del of x del of x into d t. So, if you put in equation 3 replacing this by this then finally, we will get the expression like this way integration t 0 to t f t 0 to t f and this is del v dot del x t whole transpose minus d of d t del v dot del x dot of t whole transpose that this curly bracket then put x t is equal to x star of t x dot of t is equal to x star x dot star of t into delta x t into d t. So, if you put this equation it represents of this here and after simplification I will get it this let us call this equation is 4. Now, this is a left hand side is a delta j. So, in order to become that functional to be optimized either x extremal or minimal then what is called this del j must be 0. If you recollect the or lemma which we will discuss yesterday that if t 0 to t f and g of t delta x t into d t is equal to 0 if and only if g t is and g t is a continuous function g t is equal to 0 for any value of any for any for every not for every point of every point over the interval over the interval t 0 to t f. That means, this quantity is 0 if and only if necessary and sufficient condition g t will be 0 for every point over the interval if it is so. So, I will apply this lemma here. So, you see whole thing I can con g t which is a continuous function at t is equal to x t is equal to x star and x dot is x dot star because I am doing the Taylor series expansion around the point x star around the optimal trajectory path. So, this is our g t this is x t this is not equal to 0. So, this quantity will be 0 provided this is equal to 0. So, using the so necessary condition for optimality del j must be equal to 0 and by using lemma we can say this del j will be 0 provided this is equal to 0. This implies using that lemma using lemma that what we have discussed now or lemma is there g is a continuous function over the interval t 0 to t f and this g t if you have multiplied by non 0 delta incremental change in delta x into t over the interval t 0 to t f it will be 0 if and only if g t is 0 for every point over the interval t 0 to t f that is this and using this lemma I can write that this 0 means this must be 0. So, our del v dot del x of t because this is a column vector transpose row vector multiplied by del delta x if it is x is a multivariable case if it is a single variable transpose is not necessary. So, this transpose d of d t del v dot del x dot of t whole transpose this you evaluate these values at now x is equal to x star x dot is equal to x dot star I simply write star means x t is replaced by x dot star x t is replaced by x star of t and x dot t is replaced by x dot star of t along the trajectory of optimal trajectory path. So, this equal to 0 if you write transpose that will be 1 cross n if x is a vector agree if you remove this transpose then it will be 1 cross r if you remove the transpose then it will be a if you remove the suppose we remove the transpose this will be x of x t minus d of d t del v dot del x dot of t agree this evaluate this value at x is equal to x star x dot is equal to x star if you evaluate this value is equal to 0 where the dimension is n cross n. So, this equation is known as this equation is known as Euler's Lagrange equation and it is the necessary condition for the functional to be optimized either maximum or minimum, but it is the necessary condition for this one a function to be optimized. Next we have to check whether the functional is a minimum or maximum that sufficient condition we have to check it is same as what we did it for the what is called static optimization problems. So, and if you see this one v is a function of x and x dot and t. So, if you differentiate this one with expect to x dot it will be coming function of x dot and so on and again your differential with respect to t. So, this will be a second derivative of x will come. So, this is nothing but a second order differential equation and second order differential equation if x is a single variable case if x is a vector then we will get for n 2 n differential equation from this because for each variable for each variable x 1 we will get 2 differential equation. If you have a n such variables are there the function that integral part that v is expressed of this the integral part of this integral this and this x is a n cross 1 then how many variables are there n variable for each variable we will get second order differential equation. So, all together it will be a twice n differential equation in general this differential equation are non-linear time varying equation. So, if you solve this Euler's equation you will get the necessary condition for this one. So, the solution of this one and it is a you can say it is a if x is a scalar then it is a second order differential equation if x is a vector of dimension n then it will be a twice n differential equation they are coupled each other. So, now this next is the solution the curve the curve x star of t a solution of Euler's equation x star of t is equal to x which is a function of t c 1 and c 2 and c 1 c 2 are the initial what is called not not initial integration constant integration constant. Suppose x is a single variable case it is a second order differential equation we have a two integration constant and that integration constant can be found out from initial and final condition of the problem. Suppose x is a n variable case then we will get that how many constant are two n constants will get it and that two n constant two n constant we can find out by using initial and final value conditions. So, if you make it the remarks about the what is called Euler's regulation equation and this is nothing but a what is called necessary condition if functional is to be what is called optimized this is the necessary condition. That means what is the necessary condition del j is equal to 0 implies that Euler's equation must be satisfied this Euler's equation for that one you find out the solution of x t x of t and that is the optimal trajectory which will which will give you the minimum or maximum value of the functional. So, this now remarks on what we have seen Euler's equation is a non-linear differential equation why it is non-linear because after getting the Euler's equation you will get this is the product of either x into x dot or x dot into x double dot or x square into x dot or x square into x double dot and so on. So, it is a non-linear differential equation first first remark says the Euler's equation may become non-linear differential equation since products or power of x double dot t x dot of t and x of t may appear in the may appear in the in Euler's regulation equation this is first thing. Second thing that what is called knowing the initial and final value the two point initial and final point because x may be n dimensional but one point is there a that is what we have considered knowing the initial point a and this is the final point b the two points are there in that sense it is called two point boundary value non-linear differential equation two point boundary value value problem t w t two point t p b b p two point p again the solution of such type problems non-linear differential equation is not a easy task to do this one. So, generally people can solve this problem using the what is called numerical technique one can use numerical to find out this one next point. So, your things solution of solution of non-linear t p b b p is quite difficult analytically quite difficult in analytically difficult tux in analytically agree but and often solved with numerical techniques. Third is if Euler's Lagrange equation is satisfied that it indicates that Euler's Lagrange equation is satisfied in it indicates that we have a external value of the functional either minimum or maximum. If does not satisfy the Euler's equation agree it indicates that functional value j does not have any optimal value of this functional value if does not satisfy E L conditions. So, we can write the first remark the E L equation Euler's Lagrange equation is not satisfied is not satisfied for any function this indicates that the optimal that the optimum does not exist does not exist for that functional. So, we have to satisfy this one otherwise this does not exist for the optimal value of the functional. So, let us see in multi dimensional case now that I told you if it is x is n variables are there. So, we will get two n differential equation again two n couple differential equation which we need to solve for finding out the solution of what is called optimal trajectory x which will optimize the functional. So, now multi dimensional functional just extension of single variable case suppose j is a function which is a function of x 1 t x 2 t dot x n of t and it is also function of derivatives x dot of t x 2 dot of t dot x n dot of t and this is function of time which is equal to is t 0 to t f v x 1 of t x 2 of t dot dot x n of t. Similarly, x is derivative it also depends derivative dot dot x n of t dot into t and d t. So, this is the multi dimensional case. So, what is the necessary condition for let us call two fixed point both the points are in n dimensional space that we have a two points are there a and b and both the points are fixed. That means, optimal trajectory starts with a point ends with b point. That means, it starts a point ends with b point and never this is the optimal trajectory for the functional to be optimized and never out of this optimal trajectory there is another trajectory x a t which is equal to x star of t plus delta x t which is very small perturbation from along the trajectory x star. So, both the point are fixed, but we have a n dimensional variables this one. So, what is the necessary condition necessary condition when both the points both the points this is a point are fixed is same as this one. What previously we used to write a t if you see that if you see that one or this differentiation of a scalar quantity with respect to a if it is a scalar with respect to x. Then this differentiation with respect to x is a scalar. Suppose, x is a vector then differentiates with respect to vector which will give you the column vector is nothing but a gradient of v with respect to x. This is nothing but a gradient of v with respect to x dot and then because if you do this one column vector and then you multiplied by sorry differentiate with respect to time. So, in short if I write it like this way is nothing but a gradient of x gradient of which function v dot which v is function of x x dot of t and t you take the gradient of x with respect to x this indicate with respect to x agree with respect to x minus d of d t. Take the gradient of v x of t x star of t x dot of t t. So, you get the gradient of v with respect to x dot agree that you that you multiply the differentiate with respect to this then you will get it. So, this is the Euler's equation I am writing same equation only using the symbol gradient here. So, that equation will be n cross 1 that one. That means each if you see this one del v of del x 1 del v of del x 1 del v of del x 2 del x 1 that expression del v of del x 1 minus d of d t del v del x 1 dot is equal to 0 agree is equal to 0 whose dimension is scalar that will write inside. That means it is a second order differential because I am differentiated with respect to x 1 dot with respect to time is a second order differential equation. So, and if you see this gradient of v with respect to where you can write where gradient of v with respect to v is function of x x dot of t and I am doing with respect to x is nothing but a del v dot del x 1 del v dot del x 2 dot dot del v dot del x n. So, what is the dimension of this one n cross 1 and each is a x 1 x 2 x 3 is dimension then gradient of v gradient of v with respect to x dot what will write it same thing del v del x 1 dot del v del x 2 dot and dot dot last will be del v dot del x n dot of t this and this again dimension is there and this quantity again if you differentiate you see what will get it. This is the function of x 1 dot you will get it then again you are differentiated x 2 double dot. So, whole expression or less expression for each variable you will get second order differential equation. We have a and such differential equation we will get twice n differential equation of that one. So, and ultimately if you write it this one I can write it del v this expression mode x i of t minus d of d t is equal to del v with respect to x i dot of t this whole thing is equal to 1 cross 1 and i varies from 1 to n because we have a n variables are there. So, let us call now we go instead of a specific problem both the ends of that our trajectory is fixed then we can go for more general problem. So, our problem more general problem is like this way one end is fixed other end is free. So, one of the one of the end point is fixed while other is free. So, let us see the corresponding diagram for this one or again our job is here this is the functional which is a function of x t x dot of t and t 0 to t f b x of t x dot of t t d t. We have to find out the trajectory of x t optimal trajectory of such that this functional is optimized either maximized or minimized and what we making one end of this trajectory is fixed other end of the trajectory is free. So, this is the one and this is the other point is b then you have a this is the t f this is the fixed point a which is time t is 0 this time is free t f plus delta t f and this is our optimal trajectory. We assume this is the optimal trajectory which will minimize this what a functional and near about the optimal trajectory there is another trajectory is there x a of t is equal to x star of t plus delta x t this point is d. So, now and we have a this point if you see this one what is this corresponding coordinate of this one b b coordinate what is the coordinate of a immediately I can write it coordinate of a x t x t 0 of t what is the coordinate of b is nothing but a t f x of t f x star of t f or you can try x star of this one x t f this two coordinates. Now, so our point c this is the point c and coordinate of point c is what c t 0 plus t f and what is this one that value x t f t is equal to t f x t f plus x t f plus delta x delta x t f. So, or I you can write it x a t f plus delta t f what is this coordinate. So, this nothing but a x star x star t f x star t f plus delta x t f x star t f is what t f plus delta t f and x is equal to t t is equal to what t f plus delta t f. So, you see t is what t is x t f plus delta t f then this is t f plus delta t f that is what I am writing x star t f plus delta t f value and delta x x t f plus delta t f this is the coordinate of this one. Let us call this value is what is called b point is free is not fixed it can be anywhere here here here now from here to here what is this values at t is equal to t f what is the value of that one is nothing but a delta x at t is equal to t f delta x t f then at this point at time t is equal to t f what is this one this is nothing but a delta x t f plus delta t f which I am denoting by a delta x f delta x f this one and this is delta x t f and this value if you see this one is nothing but a delta x t is equal to t f plus delta t f which I am writing in x delta x suffix f. So, this is 0 this is time t and this is the value of x of t expression. So, we are job is here one point is fixed this is the fixed point and b point is free. So, what you have to find out you find out b point is free means x t f x t f x star t f is free t f is free. So, our job is to find out a optimal trajectory x star t such that this functional is this is t f that functional value will be optimized then this is our problem but b is free. So, now near about the optimal trajectory we have considered another neighborhood trajectory of x star is x a t which is x star of t delta x t. So, now we can describe this things like this way let the left hand point a is fixed right hand point b is free. Our problem is just now you mentioned it our problem is to find a trajectory x star of t starting at point a on which a problem is find out the trajectory starting at on which the functional value j is equal to t 0 to t f b x t x dot of t t d t can be can achieve its extremum value or extremal value can achieve its extremum or extremal value. So, that is our problem this is our problem. So, we will proceed in the same manner as we did for the two points of the trajectory is fixed we will just identically will proceed in the same manner. So, our solution if you see that is why we are considering that we have a adjacent adjoining we are just joining a and c consider an adjoining trajectory specified by x of t is equal to x star of t plus delta x of t joining which two point a point and c joining t 0 x of t 0 or x star of t 0 and t f plus delta t f and x star of t you can write it extra no problem plus delta x f what is delta x f delta x t is equal to t f plus delta t which I am writing delta x suffix f that is this one. So, now what will do it first again you first find out the incremental value of the functional that means del j del j incremental value of the function, but now our time is you see from t 0 to t f plus delta f time interval because t is free. So, it is t 0 to t f plus delta t f that is if you see that one is the delta t f and our functional value is along the what is called adjacent trajectory that means x v of t x star of t plus delta x of t delta x of t in comma x dot star of t plus delta x dot of t again this into time this function of time already we have written of d t minus t 0 to t f v t x star of t plus x dot star of t d t. So, this is the incremental value of the functional and it has a two parts because if you consider the Taylor series expansion in the same manner that will keep the first variation of the functional and second variation of the functional other variation of functional is neglected because delta x is very close to the optimal trajectory of this one. So, it is cube it can neglecting. So, for necessary condition what is the necessary condition the first variation of the functional value will be 0 assigned to 0 this is our necessary condition. So, let us call this is equation number 1 from equation number 1 what we can write it I split up into t 0 to t f plus t f to t f plus delta t f this integral part. So, from equation 1 delta j is equal to t 0 to t f v t x star of t plus delta x of t x dot star of t plus delta x dot of t this into d t plus t 0 t f to t f plus delta t f. So, this part I split up into two integral part this and this is argument is same x star of t plus delta x t plus x dot star of t plus delta x dot of t d t minus whatever the along the trajectory t f along the optimal trajectory this v t x star of t x dot star of t d t. If you recollect this one from this and this one we have computed this one earlier case when both the points are fixed this we have done only the difference when both the point first we have already done only the difference is there here that one end point is fixed another end point is free in this problem. So, let us see let us call this is the equation number 2. So, now we consider mainly concentrate with this term the second term of equation 2 consider now consider the second term of 2. So, what is the second term of this 2 t 0 t f to t f plus delta t f v t x star of t plus delta x t plus x dot star of t plus delta x dot of t the whole d t. Now look at this point you find out the this significant part of this one value along the neighborhood of the optimal trajectory the function value this is a scalar quantity find the this scalar quantity function value along the what is called neighborhood of that optimal trajectory what we have consider x a of t along that one you find out the function value for each time up to t plus delta t f. So, what we expected it is something like this let us call it is something like this it is t f I am just magnifying that one is a t f plus delta t f what is this area under this curve during this period that means this one if it is a v t x star delta x t then me along the x a and this is x dot star t plus x dot star of t if it is this one what is that this area under this curve I can find out because delta t f is very small though I am amplified to show you this one this nothing but a area approximately I can write it area under this rectangular curve. So, this I can write it what is this point at t f what is the value of function value of this one at t is equal to t f this value function agree that means this multiplied by this. So, this rectangular area will be same as the whole shaded curve because t f is very small even though so amplified this one. So, I can write it this is nearly equal to if you see nearly equal to v t x star of t delta x t plus x dot star of t delta x dot of t find out the value of the function at t is equal to t f that is what I am telling at t is equal to t f you find out this value and this ordinate multiplied by f is a delta small delta t f is your what is called area under this curve into delta t f this is the area under the approximately because t f is very small. So, this I can write it this nearly equal to if you do the Taylor series expansion of that one this it is nothing but a v t x star of t plus x dot star of t agree this plus v dot of this x of t whole transpose agree. If it is a vector then this transpose you have to if it is a scalar transpose is not necessary at all. So, this if you are because this Taylor series expansion at t is equal to t f t is equal to t f because first time I will write the Taylor series expansion then I will do whole thing I will write t is equal to t f this into delta x del of x t plus del v dot del x dot of t whole transpose then your because along the trajectory of this then this is equal to x dot of t agree this whole thing nearly equal to I have written it that one agree and what is this value I am around the x star that is why x star I have written it this one that whole thing if you write from here to here evaluate at time t is equal to t f multiplied by delta t f agree multiplied by this. So, if I push it delta t f here delta x t into delta t f both are very small quantity you can neglect that one and if you do this one delta x dot it is also very small delta t f is small this you can so this whole quantity after multiplying by delta x is delta t you can neglect it the whole quantity after multiplying delta x dot of t you can neglect. So, naturally this equal to del v x star of t x dot star of t t is equal to t f into delta t f that what we just mentioned from the graph this you see value of the function at t is equal to t f v f function multiplied by delta t will give you the approximate value of the area under this curve from when you are integrating t f to t f plus delta t f, but delta t f is very close to t f this. So, this is the important relationship we got it this one. So, if you see this one this whole term this the second term of this one I can just replace by this one. Now, what about this two things we have seen earlier this two terms we can further simply because you do the Taylor series expansion of that one then this and this will be cancelled agree then first term of this one will left over here agree. So, if you see this one further that let us call this is equation number three you have given equation number two here this one the whole thing then equation number three is that one using equation number three using three in two we get first variation of the functional del j is equal to t 0 to t f I am not repeating this one what I did it here if you recollect this one this term you do it as before when both the points are fixed to do the Taylor series expansion then first order terms second order terms you retain it and higher order terms you negative then you will get it this type of things del v dot del x of t whole transpose star del of x t minus d v d t that del v dot del x dot of t whole transpose del v dot del x dot of t whole star del x dot of t this then this whole thing is d t plus there is a initial and final condition is there del v dot del x dot of t whole thing transpose del x t when limit is from t 0 to t f please see our earlier example plus that term the second term of this one we have shown it is nothing but at this term then that term is v t x star of t plus x dot star of t this t is equal to t f into delta t f into delta t f now see this one the a point is fixed delta x term will not be there at t is equal to 0 but only the t f is free so this term with delta t f will be there as it is it will be there and this term will be there in out of this lower limit and upper limit lower limit will not be there because a point is fixed delta t x is fixed delta t x is 0 then only the upper limit of t f will be there. So, we will see next class how we will simply by ultimately what is the necessary condition we will get to find the optimum value of the functional. So, we will stop it here now.