Correct way to write multiple argument functions

In summary: The equation of a circle would be written as ##\sqrt {1-x^2}## with no mention of y , since y is a function of x?The equation of a circle would be written as ##\sqrt {1-x^2}## with no mention of y , since y is a function of x?
  • #1
plob
13
1
TL;DR Summary
Isn't it incorrect or at least sloppy to write a function as having multiple arguments when one or more of the arguments are not independent?
Hi,
This is on the wikipedia entry for the Euler Lagrange equation. Here is a link.

https://en.wikipedia.org/wiki/Calculus_of_variations#Euler–Lagrange_equation
The notation I am confused about is this:

1571700090263.png


Aren't the y(x) and the y'(x) unnecessary to list as arguments when x is already one of the arguments? Or to reverse the question: Wouldn't the x be unnecessary to list as an argument if y(x) and y'(x) are already listed as the 2 arguments? But listing all three of them together like that doesn't seem right. It implies all three of them need to be given as input in order to uniquely determine L, which clearly is incorrect, right?
 

Attachments

  • 1571700057202.png
    1571700057202.png
    1.4 KB · Views: 216
Physics news on Phys.org
  • #2
I am not sure whether this developed historically or whether it is a deliberate redundancy. From a physical point of view it makes sense to write the Lagrangian like that, namely a function of time, location and velocity. These are the three parameters which define any physical model. And even the implicit function theorem in mathematics concludes ##F(x,y)=F(x,g(x))##.

This notation was already used in Noether's original paper (1918). She says that her framework is based on Lie's work, who dealt with transformations of a system of partial differential equations (1891).

Hence the answer to your question is, that it is the way we write differential equation systems, where all implicit dependencies are noted in the list of variables. I admit, I haven't dug deeper where that notation originated.
 
  • Like
Likes berkeman
  • #3
By that token the equation of a circle woukd be written as ##\sqrt {1-x^2} ## with no mention of y , since y is a function of x?
 
  • #4
WWGD said:
By that token the equation of a circle woukd be written as ##\sqrt {1-x^2} ## with no mention of y , since y is a function of x?
Good point, except that it would be ##\pm \sqrt{1-x^2}##. The variables ##y(x)## and ##y'(x)## are not necessarily given as explicit functions!
 
  • #5
plob said:
Summary: Isn't it incorrect or at least sloppy to write a function as having multiple arguments when one or more of the arguments are not independent?

It's sloppy and mathematically ambiguous, but very natural in physics. If we are thinking of physics, we think of "variables" in terms of physical quantities. A physical quantity may be mathematically expressed in terms of other physical quantities in various ways. For example, "velocity" may be expressed as a function of time or a function of position. If we think of another quantity such as "momentum" as being determined by "velocity" we aren't thinking about whether "velocity" denotes a particular function v(t) or v(x) or v(something else) because "velocity" has a physical reality. It's the mathematicians who worry about whether "v" means v(t) or v(x) or just an independent variable v.

I find it difficult to navigate the typical presentations of the calculation of variations and similar topics in physics because of the mathematical ambiguity present in the notation.

plob said:
The notation I am confused about is this:

1571700090263-png.png
1571700090263-png.png


Aren't the y(x) and the y'(x) unnecessary to list as arguments when x is already one of the arguments?

As I understand the notation we imagine ##L## to be a function of 3 independent variables ##L(a,b,c)##. Then we imagine a different function that is created by requiring that ##a = x, b = y(x)## and ##c= y'(x)##. However, we don't give this different function its own name such as G(x). We just exhibit G(x) as a composition of ##L(a,b,c)## with other functions.

Ambiguity becomes a problem when we must interpret notation like ##\frac{\partial L}{\partial x}##.

Suppose ##L(a,b.c) = a^2 + 3c^2 +2ab ##. On the one hand, the traditional notation for a function uses arguments ##x,y,z##. So ##\frac{\partial L}{\partial x} ## might be interpreted to mean "Take the partial derivative of ##L## with respect to its first argument. In terms of ##a,b,c##, that result is ##2a + 2b##.

On the other hand, if we have explicit requirements such as ##a = x, \ b = x^3,\ c = 3x^2##, a mathematician might consider intepreting ##\frac{\partial L}{\partial x} ## as bad notation for ##\frac{ d ( x^2 + 3(3x^2)^2 + 2(x)(x^3))}{dx}## and compute whatever that comes out to. I've never seen a physics text where this is the correct interpretation.
 
  • Like
Likes plob
  • #6
WWGD said:
By that token the equation of a circle woukd be written as ##\sqrt {1-x^2} ## with no mention of y , since y is a function of x?
##\sqrt {1-x^2} ## is not an equation...
 
  • #7
Mark44 said:
##\sqrt {1-x^2} ## is not an equation...
Please read the OP. S/he wants to avoid mention of dependent variables, as they believe these are redundant. Since y depends on x then, according to this, it should not be mentioned.
 
  • #8
I did read the OP as well as subsequent posts. My comment had to do with your post:
WWGD said:
By that token the equation of a circle woukd be written as ##\sqrt {1-x^2} ## with no mention of y , since y is a function of x?
The above is still not an equation...
 
  • #9
Mark44 said:
I did read the OP as well as subsequent posts. My comment had to do with your post:
The above is still not an equation...
It is a reductio ad absurdum, it is what would result if the advice was followed to the letter ; since y depends on x, it should not be mentioned according to the edit original suggestion.
 
  • #10
WWGD said:
It is a reductio ad absurdum, it is what would result if the advice was followed to the letter ; since y depends on x, it should not be mentioned according to the suggestion.
The context of the OP's question was arguments of functions, not equations, so I don't see your point as being relevant.
 
  • #11
Mark44 said:
The context of the OP's question was arguments of functions, not equations, so I don't see your point as being relevant.
Well, y depends on x , so why, according to this criterion mention both? I don't know all of Mathematics but I do know what an equation is. At any rate, I saw this as a consequence of this idea. Fresh seems to have seen it similarly.
 
  • #12
Mark44 said:
The context of the OP's question was arguments of functions, not equations, so I don't see your point as being relevant.
Yes, and eliminating redundant use of arguments . Why mention both x and y(x) in the same expression?
 
  • #13
WWGD said:
Fresh seems to have seen it similarly.
I don't think he would agree that ##\sqrt{1 - x^2}## is an equation.
 
  • #14
Mark44 said:
I don't think he would agree that ##\sqrt{1 - x^2}## is an equation.
It is pretty clear to anyone who has taken precalc that it is not an equation. It is what would result if their method was applied to the letter; the absurdity i mentioned would result. Edit: moreover it _is_ an equation because the y is implied.
 
  • #15
WWGD said:
Yes, and eliminating redundant use of arguments . Why mention both x and y(x) in the same expression?
To emphasize the fact that in an equation such as F(t, s, v) = 0, both s and v are functions of t (as in a differential equation involving position and velocity.
 
  • Like
Likes plob
  • #16
Mark44 said:
To emphasize the fact that in an equation such as F(t, s, v) = 0, both s and v are functions of t (as in a differential equation involving position and velocity.
But the OP wants to do away with this.
 
  • #17
WWGD said:
But the OP wants to do away with this.
Ask fresh to give you his take. He found no problem with my post in that regard.
 
  • #18
WWGD said:
It is what would result if their method was applied to the letter; the absurdity i mentioned would result.
Then I think you are misunderstanding what the OP is asking.
WWGD said:
Edit: moreover it _is_ an equation because the y is implied.
Now that is absurd.
 
  • #19
Mark44 said:
Then I think you are misunderstanding what the OP is asking.
Now that is absurd.
I think it is you who are misunderstanding both.
 
  • #20
Mark44 said:
Then I think you are misunderstanding what the OP is asking.
Now that is absurd.
Bingo.t is the result of implementing the idea to the letter. Bring in two math mentors and I will abide by what they say on this matter.
 
  • #21
Please don't misquote me by quoting only part of what I wrote. What I said was absurd was this statement:
WWGD said:
Edit: moreover it _is_ an equation because the y is implied.
Is the = implied as well?
To get back on-topic, the OP was questioning why it would be valid to write L(x, y(x), y'(x)). Certainly y(x) could represent ##\sqrt{1 - x^2}## or whatever, and similar for y'(x), but neither y(x) nor ##\sqrt{1 - x^2}# is an equation.

The OP's question seems to have been answered, so I'm closing this thread before we get even further off-topic. @plob, if you're still uncertain, please send me a PM and I'll reopen the thread.

Edit: Thread reopened.
 
Last edited:
  • #22
WWGD said:
By that token the equation of a circle woukd be written as √1−x21−x2 with no mention of y , since y is a function of x?
Hi WWGD
Since the equation for the graph of a circle, which would be

x2+y2=constant

is not even a function ...it is neither a function of y or x... I am not clear on the relevance this has to my OP, which is about functions and their arguments. Perhaps you wouldn't mind elaborating?

Or, perhaps what you meant was...

y=(1-x2)1/2

which, by contrast, actually is a function, and you mean to suggest I ought to have a problem with the inclusion of both y and x if I am being consistent with the concerns I express in my OP.

But if so, I am curious what you found in my OP that would suggest to you my having a problem with including both the 'y' and the 'x' in y=(1-x2)1/2, a single-argument function of the form ƒ(x)=y(x)? Thanks
 
Last edited:
  • #23
plob said:
Hi WWGD
Since the equation for the graph of a circle, which would be

x2+y2=constant

is not even a function ...it is neither a function of y or x... I am not clear on the relevance this has to my OP, which is about functions and their arguments. Perhaps you wouldn't mind elaborating?

Or, perhaps what you meant was...

y=(1-x2)1/2

which, by contrast, actually is a function, and you mean to suggest I ought to have a problem with the inclusion of both y and x if I am being consistent with the concerns I express in my OP.

But if so, I am curious what you found in my OP that would suggest to you my having a problem with including both the 'y' and the 'x' in y=(1-x2)1/2, a single-argument function of the form ƒ(x)=y(x)? Thanks
Sorry if I came of as glib, just wanted to make the point that some level/amount if redundancy may not necessarily be a bad thing.
 
  • #24
That is fine. Yes, this has actually been shown to me by others, i.e., that while not a strict mathematical necessity, interdependent function arguments can sometimes help to emphasize the role of certain physical quantities when dealing with the sciences
 
  • Like
Likes WWGD
  • #25
The fundamental and reasonable difference is the following:

  1. ##\mathcal{L}(x)=0## is a system of functions. It can be literally anything.
  2. ##\mathcal{L}(x,y(x),y'(x))=0## is a system of differential equations.

The latter carries more specification than the former: We are invited to consider the system under several perspectives: time, location or speed dependency. Each of them will result in different insights into the system. E.g. it automatically implies, that ##x \longmapsto y(x)## is differentiable. It also allows to consider different paths ##(t,x(t)) \longmapsto y(x(t))##, which we wouldn't see, if we wrote down a specific one to eliminate ##y(x)##. The notation stresses that there are two more quantities ##y,y'## which have a separate physical (or geometrical) meaning! Hence the notation is on one hand more specific, and on the other more general. This implies that they are not equivalent and serve different purposes.
 
  • Like
Likes WWGD
  • #26
Stephen Tashi said:
It's sloppy and mathematically ambiguous, but very natural in physics. If we are thinking of physics, we think of "variables" in terms of physical quantities. A physical quantity may be mathematically expressed in terms of other physical quantities in various ways. For example, "velocity" may be expressed as a function of time or a function of position. If we think of another quantity such as "momentum" as being determined by "velocity" we aren't thinking about whether "velocity" denotes a particular function v(t) or v(x) or v(something else) because "velocity" has a physical reality. It's the mathematicians who worry about whether "v" means v(t) or v(x) or just an independent variable v.

I find it difficult to navigate the typical presentations of the calculation of variations and similar topics in physics because of the mathematical ambiguity present in the notation.
As I understand the notation we imagine ##L## to be a function of 3 independent variables ##L(a,b,c)##. Then we imagine a different function that is created by requiring that ##a = x, b = y(x)## and ##c= y'(x)##. However, we don't give this different function its own name such as G(x). We just exhibit G(x) as a composition of ##L(a,b,c)## with other functions.

Ambiguity becomes a problem when we must interpret notation like ##\frac{\partial L}{\partial x}##.

Suppose ##L(a,b.c) = a^2 + 3c^2 +2ab ##. On the one hand, the traditional notation for a function uses arguments ##x,y,z##. So ##\frac{\partial L}{\partial x} ## might be interpreted to mean "Take the partial derivative of ##L## with respect to its first argument. In terms of ##a,b,c##, that result is ##2a + 2b##.

On the other hand, if we have explicit requirements such as ##a = x, \ b = x^3,\ c = 3x^2##, a mathematician might consider intepreting ##\frac{\partial L}{\partial x} ## as bad notation for ##\frac{ d ( x^2 + 3(3x^2)^2 + 2(x)(x^3))}{dx}## and compute whatever that comes out to. I've never seen a physics text where this is the correct interpretation.
Hi Stephen thanks. I think I get what you mean 'a mathematician might consider intepreting ... as bad notation for ...' but I'm not 100% positive. You mean that since L is uniquely determined, i.e. single valued, with respect to x, it should be a regular rather than a partial derivative and that is the bad notation?
 
  • #27
fresh_42 said:
The fundamental and reasonable difference is the following:

  1. ##\mathcal{L}(x)=0## is a system of functions. It can be literally anything.
  2. ##\mathcal{L}(x,y(x),y'(x))=0## is a system of differential equations.

The latter carries more specification than the former: We are invited to consider the system under several perspectives: time, location or speed dependency. Each of them will result in different insights into the system. E.g. it automatically implies, that ##x \longmapsto y(x)## is differentiable. It also allows to consider different paths ##(t,x(t)) \longmapsto y(x(t))##, which we wouldn't see, if we wrote down a specific one to eliminate ##y(x)##. The notation stresses that there are two more quantities ##y,y'## which have a separate physical (or geometrical) meaning! Hence the notation is on one hand more specific, and on the other more general. This implies that they are not equivalent and serve different purposes.
Hi fresh42 do the arrow symbols you are using indicate one-to-one mapping?
 
  • #28
plob said:
Hi fresh42 do the arrow symbols you are using indicate one-to-one mapping?
They indicate a function, not necessarily a bijective one. The point is, and differential calculus was primarily created to solve physical problems, that the variables all have a physical meaning and we want to know their dependencies.

Consider for example a particle of mass ##m## in a gravitational potential ##U(\vec{r})=\dfrac{U_0}{\vec{r\,}^{2}}##. The Lagrange function with ##\vec{r}=(x,y,z,t)=(x_1,x_2,x_3,t)## of this problem is
$$
\mathcal{L}(\vec{x},\vec{r}(\vec{x}),\dot{\vec{r}}(\vec{x}))=T-U=\dfrac{m}{2}\,\dot{\vec{r}}\,^2-\dfrac{U_0}{\vec{r\,}^{2}}
$$
where ##\vec{x}=(x_1,x_2,x_3,t)## is a point in spacetime. If we resolve this into the variables then we will get a mess of expressions in ##x_i## and ##t## and nobody sees anything. But if we keep it implicit with ##\vec{r}## and ##\dot{\vec{r}}## we do not only see that it is the sum of kinetic and potential energy, it is also far easier to handle. And we can easier examine a path ##\gamma\, : \,t \longmapsto \vec{r}(t)## through this potential, which otherwise would be a long and messy expression in ##\gamma(t)_i## and ##t##. But mainly the dependence ##kinetic\,+\,potential## would be lost.
 
  • #29
fresh_42 said:
... But mainly the dependence ##kinetic\,+\,potential## would be lost.
Did you mean minus?
 
  • #30
plob said:
Did you mean minus?
I meant the linguistic "and". The different mathematical signs say that they are interchangeable: less potential means higher velocity and vice versa.
 
  • #31
plob said:
You mean that since L is uniquely determined, i.e. single valued, with respect to x, it should be a regular rather than a partial derivative and that is the bad notation?

Yes, that's what I mean, but we really shouldn't call the function "L". The physics approach doesn't introduce a new name for the function created by substituting functions of x for the arguments of L.

Think about what we teach students in secondary school about functions. A function has a domain and co-domain. If two functions have a different domain, they are not the same function. If "L" was the name of a unique function, it would have a unique domain. In the case at hand, the domain of L is triples of real numbers. When we create a different function whose domain is single real numbers, we shouldn't call that function "L" - without apologizing to our classes of secondary school students!

You may find notation like ##\frac{dL}{dx}## used to indicate a "total derivative" of the unnamed function. That notation may be used alongside the notation ##\frac{\partial L}{\partial x}## , which indicates a partial derivative of ##L## with respect to its first argument.
 
  • Like
Likes plob

1. What is the correct syntax for writing a multiple argument function?

The correct syntax for writing a multiple argument function is as follows: function functionName(argument1, argument2, argument3) { // function code } The function name is followed by parentheses, which contain the arguments separated by commas. The function code is then enclosed in curly braces.

2. How do I pass arguments into a multiple argument function?

To pass arguments into a multiple argument function, you simply need to include the values for each argument within the parentheses when calling the function. For example: functionName(value1, value2, value3); These values will then be assigned to the corresponding arguments within the function.

3. Can I have a mix of required and optional arguments in a multiple argument function?

Yes, you can have a mix of required and optional arguments in a multiple argument function. Required arguments are those that must be included when calling the function, while optional arguments have default values assigned to them and can be omitted when calling the function. Optional arguments are typically placed at the end of the argument list.

4. How can I access the arguments passed into a multiple argument function?

You can access the arguments passed into a multiple argument function by using the arguments keyword within the function code. This keyword returns an array-like object containing all the arguments passed into the function. You can then access individual arguments using their index, starting from 0.

5. Is there a limit to the number of arguments I can pass into a multiple argument function?

There is no set limit to the number of arguments you can pass into a multiple argument function. However, it is generally recommended to keep the number of arguments to a minimum to avoid confusion and improve the readability of your code. If you find yourself needing a large number of arguments, it may be a sign that your function could be simplified or broken down into smaller functions.

Similar threads

Replies
36
Views
3K
Replies
5
Views
2K
  • Programming and Computer Science
Replies
26
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
842
  • Linear and Abstract Algebra
Replies
15
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
859
  • Atomic and Condensed Matter
Replies
2
Views
2K
  • Differential Equations
Replies
1
Views
700
  • Math Proof Training and Practice
3
Replies
93
Views
6K
Back
Top