TITLE: When is a multivariable function independent of one of it's input variables?
QUESTION [0 upvotes]: This question is in the context of variational calculus and Lagrangian mechanics. 
Consider a function $f(y,y^.,x)$. Here, by $y^. = \frac{dy}{dx}$
If $f$ is independent of $x$, shouldn't this mean that both 
$\frac{df}{dx} = 0$ and $\frac{\partial f}{\partial x} = 0$ ?
This seems intuitive to me, but I'm not sure, since $y$ and $y^.$ would depend on $x$ anyway. 
I reasoned that the partial derivative would account for explicit $x$ dependence and the total derivative would account for the implicit dependence through $y$ and $y^.$ .
Also, do we normally consider $y$ and $y^.$ to be independent themselves within Lagrangian mechanics, because if not, I'm having trouble with the above reasoning.

REPLY [1 votes]: Think of the possible ways a particle can move along a straight line. Suppose you know the particle's position at any moment in time: such a piece of information will be called a path.
If you want to graph the particle's position with respect to time, you draw a curve in a plane, so one dimension represents the straignt line and the other dimension represents time. Then every possible path taken by the particle is given a curve in the plane.
Now suppose you want to picture how the particle's velocity changes over time.
You add yet another dimension to your plane, which represents velocity, obtaining a three dimensional space. Then for any given path, you obtain a curve in the three dimensional space, which shows geometrically the position and velocity of the particle at any moment.
If the curves corresponding to two different paths have an intersection point, this means that there is a moment in time at which the particle passes throught the same point on the straight line with the same velocity.
But now the advantage is that if you want to picture just position and velocity, you can project the spatial curve to the position-velocity plane.
Even if two paths go through completely different points on the straight line, their projections to the time-velocity plane might very well have intersections.
Well, where am I going?
In this context (and this is indeed the appropiate geometrical picture for this kind of problems) your $f$ is a function which assigns a number to every point of this three dimensional space, i.e., $f:\mathbb R^3\to\mathbb R$. The function $f$ is there previous to the consideration of a path (on the straight line) which generates a spatial curve. The partial derivatives of $f$ are exactly the derivatives of $f$ in the time, position and velocity directions (without refering to a given spatial curve). So the phrase "$f$ is independent of time (which corresponds to your variable name $x$)" is equivalent to the assertion that the partial derivative of $f$ in the direction of time is $0$; i.e., the function $f$ is constant along any line in $\mathbb R^3$ parallel to the time axis, which in the praticle-moving-in-a-straight-line picture means "if the particle doesn't move at all, then $f$ is constant even if time passes".
In contrast, the so-called total derivative can only be defined with respect to a path. Let's call $\gamma$ the spatial curve associated to a given path, it is a function $\mathbb R\to\mathbb R^3$. Then the total derivative is the derivative of the function $f\circ\gamma:\mathbb R\to\mathbb R$, which you can calculate using the chain rule. Then the assertion that the total derivative of $f$ vanishes, geometrically corresponds to the fact that $f$ is constant along the spatial curve $\gamma$ (i.e., $f\circ\gamma$ is a constant function), which can happen even if $f:\mathbb R^3\to\mathbb R$ it is not a constant function.
{"set_name": "stack_exchange", "score": 0, "question_id": 3674329}