# Order of differentiation can be reversed?

1. Aug 7, 2007

### jhat21

1. The problem statement, all variables and given/known data
http://www.mathpages.com/home/kmath523/kmath523.htm
In trying to arrive at the Lagrange equations of motion, on the above website, I stumbled over a bit that involved reversing the order of differentiation in the equation (4):
d(partial)/d(partial)X1[(dx/dt)] = d/dt[d(partial)x/d(partial)X1]
the way i wrote it may be confusing. you can check the website for the original equation.

2. Relevant equations
The author justifies this reversal with d/dt = d(partial)/d(partial)t and the commutative property of partial differentiation. Quote:"Since x and X are both strictly functions of t, it follows that partial differentiation with respect to t is the same as total differentiation, and so the order of differentiation in the right-most term of (4) can be reversed (because partial differentiation is commutative)."
I buy that taking the partial derivative of x w/t is the same as d/dt, since here x= f(t),
so I feel fine with writing d(partial)/d(partial)t instead of d/dt when it is on the outside.
but if i then move the partial derivative w/t to the inside using the commutative property of partial derivatives, I cannot show that this is justified.

3. The attempt at a solution
Since taking the derivative of x w/respect to t, results in a function of t only, if i then take its partial derivative w/respect to X1, I get always zero?
But if i take the partial derivative first w/respect to X1, i get a function of X1 that I can take the derivative w/respect to t, and get a function of t?
I get two different results depending on the order I take derivatives!
How can this be justified?

x=f(X1,Y1)
for example,
x= X1 +Y1
= t^2 + 2t
d(partial)/d(X1) [x] = 1
d/dt(2t) = 0
I arrive at 0
d/dt[x] = 2t+2
d(partial)/d(X1) [2t+2] = 0? or 2(X1)^1/2 ---> = X1^-1/2 ?
I get always zero or something different...

what about x = X1^2 + Y1 = t^4 +2t
= 2X1
=4t
and
=4t^3+2
=0? or =4t? since 4t^3+2 = 4t(X1) +2

Ok. I think i see an explanation.
If x is first order in X1, then result is zero. -That was the first example.
If x is higher order than 1 in X1, the resulting expression in t contains X1 so therefore can be rewritten as f(t,X1) giving the desired result of f(t) when partial differentiated w/respect to X1
But rewrite t in terms of X1 *only* if they are exactly equal.
t does not equal (t^2)^1/2, so does not depend on t^2.
taking the partial derivative w/respect to t^2 then yields nothing
this explains why the first result is zero and not (X1)^-1/2

So the final explanation is that taking d/dt of x does not destroy any X1 that is left over, so I'm free to partial differentiate in X1 afterwards.
If i take partial derivative in X1 first, i only get no X1 left if i have first order, which would result in d/dt(c) = 0 anyways. If its higher order, then I get a function of X1 which differentiates nicely w/respect to t.
The partial derivative in X1 from the first method can be rewritten in t, as X1=f(t), so in the end we both get a nice function of t.

I see how it works now, but i haven't proved it. Any corrections or further explanations are welcome! if you can show me the proof I'd be glad to read it, thanks.

2. Aug 7, 2007

### jhat21

I noticed another thing

if you take the derivative w/t first, you need to note which expression is from Y1 and which is from X1.
Partial derivatives are commutative, but I can't justify changing the parital derivative back into total derivative d/dt.
Since,
d/dt[ (2t)^2 + t^2] = 8t +2t
but d(partial)/d(partial)X1 [8t+2t] should equal 4,
where 2t=X1, 8t=4X1 and 2t=constant from Y1. Y1 =t^2
not 8t+2t=10t=5X1 ---> 5!

d(partial)/d(partial) t should be meaningful in contrast to d/dt when it is the inside derivative, depending on what variable you're taking the outside derivative with respect to!

unless...
d(partial)/d(partial)X1 [(2t)^2 + t^2] = 2X1 +1/2X1
then d/dt(2.5X1) = 5
....
then it would be =5?!

which seems counter-intuitive because you are holding Y1 constant when partial differentiating w/respect to X1.....

If X1 and Y1 are both functions of t, then one has to be dependent on the other? So in this case, Y1 can't be held constant?
Then you are really differentiating everything... with respect to X1.
Then d(partial)/d(partial) X1 = d/dX1 too?

Then we can still treat the left over t's as constants and not functions of X1 if t does not depend on t^2 for example?

Please let me know if you see a mistake! Thanks again.