# Example of a functional

1. Jul 4, 2009

### CFDFEAGURU

Hello all,

I have been trying to fill in the gaps in the example of a functional given in chapter 3 of Hartle's book "Gravity" and I am not having much luck. I exhausted wikipedia for help to no avail. Does anyone know of or can provide a good simple example of a functional or just the Lagrangian?

Thanks

2. Jul 4, 2009

### jambaugh

Re: Functionals

A functional is simply a function whose domain is a set of functions. i.e. a functional is a mapping from a function to a number.

Example: [The value of the function at x=0]
maps cos to 1, maps sin to 0, and maps a polynomial to the value of its constant term.

Example: Given x as a function of t representing an arbitrary (smooth) particle trajectory,
$$x \mapsto S= \int_{t_1}^{t_2} \frac{m}{2} \dot{x}^2(t) - V(x(t)) dt$$

maps the whole trajectory of the particle to a single number, S we call the action. V is a potential function defining the potential energy for the particle at any position x.

This is the canonical action for a particle with mass m.
The action integral is the functional. The lagrangian is the integrand we use to define the functional. Generically we have:

$$x \mapsto S= \int_{t_1}^{t_2} L(x,\dot{x},\ddot{x},...)dx$$

Since a functional is also a type of function we can consider its differentials which are variations in the value of the functional $\delta S$ which depend on variations in the function itself. You will then see that $\delta S$ will be a functional depending on the function x(t) and its variation (functional differential) $delta x (t)$.

If you imagine an analytic function as defined by its power series expansion:
$$x(t) = x_0 + x_1 t + x_2 t^2 + \cdots$$
where the $x_k$ coefficients can then be though of as coordinates then you can think of the function itself as an infinite dimensional vector.

Thus a functional is a mapping (possibly non-linear) from this infinite dimensional vector space to a one dimensional vector space.

Note that the first example: [the value of the function at 0]
can be re-expressed also in integral form:

$$f \mapsto \int_{-\infty}^\infty f(x)\delta(x)dx$$
where we use the Dirac delta function.

More generally we might consider an operator which maps a vector to a vector or a function to a function. Example $\frac{d}{dx}$.

Most operators on functions can also be expressed in integral form but with an extra variable:

$$f\mapsto g: g(x) = \int_{y_1}^{y_2} f(y)W(x,y)$$

Some other examples of operators are e.g. Fourier and Laplace transforms.

In summary:
(ordinary) function maps value to value
functional maps function to value
operator maps function to function

3. Jul 4, 2009

### George Jones

Staff Emeritus
Re: Functionals

A general function $f$ is a mapping

$$f : A \rightarrow B,$$

where $A$ and $B$ are sets. Consequently, $f \left( a \right) = b$ for $a$ in $A$ and $b$ in $B$.

A functional is a special type of function where the elements of $A$ are themselves functions and $B$ is either the set of real numbers or the set of complex numbers.

Can you see why the Hartle's Lagrangian is a functional?

I don't have my copy of Hartle home with me, but if you want to ask specific questions about what Hartle does, I can have a look on Monday.

Obviously, James gave a much more detailed answer.[/edit]

4. Jul 4, 2009

### Bob_for_short

Re: Functionals

It is not really so. A functional is an integral where the integrand is considered as a variable, not a fixed function. Otherwise it is indeed a number.

5. Jul 4, 2009

### George Jones

Staff Emeritus
Re: Functionals

The definition of "functional" which James and I gave is the standard definition that is found in most functional analysis books.
This (with maybe slightly different wording) is a special (i.e., not general) type of functional.
No one said that a functional is a number.

6. Jul 4, 2009

### HallsofIvy

Re: Functionals

Yes, really so. What you give, an integegral which maps a function to a number by taking a specific integral is an example of a functional, not a general functional.

7. Jul 4, 2009

### CFDFEAGURU

Re: Functionals

The example given in Hartle is

(V(x)=0) defines a free particle moving between points $$_{}x$$A at $$_{}t$$A and $$_{}x$$B at $$_{}t$$B

In Newtonian physics with a constant velocity of ($$_{}x$$B-$$_{}x$$A)/T, where T=$$_{}t$$B-$$_{}t$$A When half of the time, T, has elasped the particle is at the position ($$_{}x$$B+$$_{}x$$A)/2

Now we compare the action of this path satisfying Newton's laws with paths that move from $$_{}x$$A with a constant velocity to some different position X in total time T/2 and then with a different constant velocity to get to $$_{}x$$B in time T. The action S(X) for these paths is a function of X, which is easy to calculate from S[x(t)]=$$\int$$dt L((x$$^{.}$$(t),x(t)) (The limits of integration are $$_{}t$$A to $$_{}t$$B) because the velocity is constant on each leg, namely, (X-$$_{}x$$A)/(T/2) on the first leg and ($$_{}x$$B-X)/(T/2) on the second. The action along any leg with a constant velocity, V, for a time, t, is mV$$^{}2$$t/2

The sum of both legs is

S(X)=m[($$_{}x$$B-X)^2+(X-$$_{}x$$A)^2]/T

The extremal paths are defined where dS/dX = 0.

The subsequent answer is given, but is that all this is required is to take the derivative of S(X) and then set it equal to zero and then solve for X?

8. Jul 4, 2009

### Fredrik

Staff Emeritus
Re: Functionals

Your notation makes that a pain to read. As for your last question, I'm not sure if you mean "is that all that's required...", "is all this required...", or something else entirely.

One thing you can do to find the function that minimizes the action functional is to consider a one-parameter family of functions $x_\epsilon$ such that $x_0$ is the function that minimizes the action:

$$0=\frac{d}{d\epsilon}\bigg|_0 S[x_\epsilon]=\int_{t_1}^{t_2}dt \frac{d}{d\epsilon}\bigg|_0 L(x_\epsilon(t),\dot x_\epsilon(t))=\cdots$$

This condition gives you the Euler-Lagrange equations, which is what you use instead of Newton's second in this formulation of classical mechanics.

Note that the Lagrangian L is just a function of several variables (in this case just two). For example $(a,b)\mapsto b^2/2+V(a)$ is the Lagrangian of a single point particle in one dimension. If we instead consider the map $x\mapsto L_t[x]=L(x(t),\dot x(t))$, Lt is a functional. Actually, it's a different functional for each value of t.

What if the domain of definition is some unspecified vector space. Wouldn't you still call it a functional?

9. Jul 4, 2009

### Bob_for_short

Re: Functionals

If we speak of action S, then the integrand is not only variable function but also an unknown function. So S depends strongly on the integrand. Than is why it is called "functional" (nearly function). A simple integral with a known (fixed) function is a number, not a functional.

The Lagrange equations serve to find the unknown variables. No one injects them, when found, into the action expression. Nobody cares of the action value on the real trajectory.

10. Jul 4, 2009

### Fredrik

Staff Emeritus
Re: Functionals

I see what you're saying Bob. It's like when people call f(x) a "function". I always find that annoying. f(x) is a number. f is a function. f is the map that takes x to f(x). What you're saying is the corresponding statement for functionals. S[f] isn't a functional. It's just a number. S is a functional. It's the map that takes f (any f in the domain of definition) to S[f].

That's a valid point, but I think it's clear that both George and James understand that. When Jambaugh said "is a mapping from a function to a number" it would have been better to say something like "is a mapping from a set of functions to a set of numbers", but I think it's clear from the rest of what he said that that's what he meant.

11. Jul 4, 2009

### Bob_for_short

Re: Functionals

Yes, I agree, and I believe they understand it right. I just wanted to explain to the author of OP that there is difference between X(t) before finding it and after that. For example, Hamiltonian H is a form containing unknown variables x and p. When found and injected into H, they give the system energy E which is a number. Unfortunately they often denote unknown variables and the equation solutions with the same symbols.

12. Jul 4, 2009

### jambaugh

Re: Functionals

One of the virtues of natural language in literature is a detriment in mathematics and that is ambiguity. I like to distinguish: "f is a mapping from (set) A to (set) b" from "f maps a (in A) to b (in B)."
Symbolically we use distinct arrows to make this clear:
$$f:A \to B$$
$$f:a\mapsto b$$
this second being equivalent to saying f(a)=b.

Another minor distinction, remember that the Lagrangian is not itself the functional. It together with the domain of integration uniquely defines the action functional so for practical purposes we identify the choice of Lagrangian with the choice of action functional.

13. Jul 6, 2009

### CFDFEAGURU

Re: Functionals

Fredrik,

Sorry for the poor use/abuse of the Latex for the illustration of the mathematics. What I meant to say was that once you obtain this equation S(X)=m[(B-X)^2+(X-A)^2]/T. Is the solution to this equation found by calculating the derivative, setting the derivative equal to zero and then solving for X?

14. Jul 6, 2009

### Fredrik

Staff Emeritus
Re: Functionals

That example is pretty weird. The goal is to find the function x (out of all the continuous real-valued functions of one real variable) that makes S[x] as small or as large as possible, and you're only considering functions that have a graph that consists of two straight lines.

15. Aug 16, 2009

### CFDFEAGURU

Re: Functionals

Hello all,

Thanks for the advice and definitions above. Here is the problem given in Hartle's book. This is problem 5 in chapter 3.

Consider the functional

S[x(t)] = $$\int[(dx(t)/dt)^2+x^2(t)]dt$$

The integral is from zero to T. (Can someone show me how to create an integral with the limits of integration in LaTex?)

Find the curve x(t) satisfying the conditions x(0)=0, x(T)=1. which makes S[x(t)] an extremum. What is the extremum value of S[x(t)]? Is it a maximum or a minimum?

Note: This is not a homework problem. I am teaching myself GR and I just need some help here.

Any help on this would be greatly appreciated.

Thanks
Matt

16. Aug 16, 2009

### Fredrik

Staff Emeritus
Re: Functionals

Option 1: $$\int_a^b$$ Option 2: $$\int\limits_a^b$$

First note that S is the functional and that S[x] is a number. The expression S[x(t)] doesn't make sense since it's a functional acting on a number. (See #10). Also note that the integral is of the form

$$\int_0^T L(x'(t),x(t)) dt$$

and that L is just a polynomial in two variables. There are three options here: a) use the Euler-Lagrange equations, b) derive the E-L equations for an arbitrary L, and then use them for this specific L, c) derive the E-L euqations for this specific integral.

The way I like to derive the E-L equations starts like this: Let x be the function that maximizes or minimizes the integral, and let $\{x_\epsilon\}$ be a one-parameter family of functions with $x_0=x$. Now we must have

$$0=\frac{d}{d\epsilon}\bigg|_0 S[x_\epsilon]$$

If you figure out the appropriate way to rewrite the right-hand side, you have found the Euler-Lagrange equations. Post #3 in this thread does this calculation for for a scalar field theory, so you can check that out if you get stuck, but I recommend that you try it yourself first. (Oops, now I see that I omitted some details in the other thread, but it should still be useful).

Last edited: Aug 16, 2009
17. Aug 16, 2009

### jambaugh

Re: Functionals

Quick hair splitting note: With regard to earlier discussion on definitions the notation used:
$$S[x(t)]$$
is really bad (but common) since a.) it implies S is a function (via composition) of t which relates to b.) t is a variable of integration and shouldn't appear anywhere outside the integral in which it is defined. It should rather read
$$S[x]$$
Focusing on this distinction may help better understand the process about which you asked.

With regard to latexing integral limits, when you want to put limits on latex integral simply use the sub-script, super-script ops.

\int_a^b f(x)dx

parses to:
$$\int_a^b f(x)dx$$
similarly with \sum in Sigma summation notation.

Now with regard to finding the extremum of the action, this is the classic variation problem in the derivation of the Euler-Lagrange equations. See http://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation" [Broken]

For a given Action Lagrangian:
$$S[x] = \int_{0}^{T}L(x(t),\dot{x}(t)) dt$$

the classic solution to the extremum problem $\delta S = 0[/tex] is that x must satisfy the E-L equations: $$\frac{d}{dt} \left( \frac{\partial L}{\partial \dot{x}} \right) = \frac{\partial L}{\partial x}$$ Note that if x is a vector this form still holds for each component. Simply view it as having a suppressed index $$x\ \to x_\mu,\quad \dot{x}\to \dot{x}_\mu$$. The term in parenthesis of the RHS of the E-L equation: $$P=\frac{\partial L}{\partial \dot{x}}$$ is called the canonical momentum and the right hand side of the equation is called the canonical force so that the E-L equation takes the classic form: $$\dot{P} = F$$ and you'll note for Lagrangians of the form: $$L(\dot{x},x) = \frac{1}{2}\dot{x}^2 - V(x)$$ you get the usual: $$P = m\dot{x}, \quad F = - \frac{\partial V}{\partial x}$$ However you can apply to more exotic systems where you have say an x dependend "mass" or linear terms with respect to the velocity. Finally in GR and other field theories you will in the canonical treatment of the fields you will have a lagrangian density where now not just t but (t,x,y,z) are the independent variables of integration. The form of the Euler-Lagrange equations is still the same form if you look at it right. [EDIT] Oops! Forgot to mention that your boundary conditions simply become boundary conditions on the E-L equations. Since the E-L equations are second order differential equations you will have two free variables of integration for which you can solve to satisy the BC. Last edited by a moderator: May 4, 2017 18. Aug 16, 2009 ### CFDFEAGURU Re: Functionals So for the problem I stated above, My integrand is $$(dx(t)/dx)^2$$ + $$x^{2}(t)$$ My question is this. What do I do with this integrand? I am formally schooled in calculus but this Lagrangian viewpoint is lost on me. I am trying to gain help through baby steps with this problem. So, please a clear concise step by step walkthrough would be excellent. Thanks Matt 19. Aug 16, 2009 ### Fredrik Staff Emeritus Re: Functionals Why not just do what I described in my previous post? 20. Aug 16, 2009 ### CFDFEAGURU Re: Functionals I understand the process in the post, I just don't know how to apply it. I learn very effectively by seeing an example of the implementation of mathematics. If you can please show me how to solve this problem I would be very happy. 21. Aug 16, 2009 ### Fredrik Staff Emeritus Re: Functionals $$L(x'(t),x(t))=x'(t)^2+x(t)^2$$ Euler-Lagrange: $$0=\frac{\partial L}{\partial x(t)}-\frac{d}{dt}\left(\frac{\partial L}{\partial x'(t)}\right)=2x(t)-\frac{d}{dt}(2x'(t))=2(x(t)-x''(t))$$ For the derivation of the Euler-Lagrange equation, at least try, and tell us where you get stuck. Edit: Oops, I got a sign wrong. Should be OK now. Last edited: Aug 16, 2009 22. Aug 16, 2009 ### CFDFEAGURU Re: Functionals Okay, now I think I can get going with this. I will seek help when I get stuck. Thanks alot Fredrik, Matt 23. Aug 16, 2009 ### Fredrik Staff Emeritus Re: Functionals I found a mistake in the thread I linked to in #16. I posted a correction in that thread, so make sure you read that too. Note that [itex]\partial_\mu$ in that calculation corresponds to d/dt in the calculation you should do.

24. Aug 16, 2009

### CFDFEAGURU

Re: Functionals

There is no link in #16.

25. Aug 16, 2009

### Fredrik

Staff Emeritus
Re: Functionals

Yes there is.