Derivation of Lagrange's Equation [duplicate]

So I was going through the derivation of the Lagrange's Equation given in Goldstein. And I have doubts about some of the steps. I would appreciate some clarifications on them.

First: $$\frac{d}{dt} \frac{\partial r_i }{\partial q_j} = \frac{\partial \dot{r_i}}{\partial q_j }$$

So in the above step, it looks like something, as shown below, was done:

$$\frac{\partial (\frac{d}{dt} r_i)}{\partial q_j}$$

If so, how rigorous is this? And could someone guide me on its proof with a bit more rigour?

My second doubt is:

$$\frac{\partial v_i }{\partial \dot{q_j}} = \frac{\partial r_i}{\partial q_j}$$

It looks like the following was done:

$$\frac{\partial (\frac{d r_i}{{dt}}) }{\partial (\frac{dq_j}{dt})}$$

And the $$dt_s$$ were cancelled out. Please also guide me through the proof of the above.

Edit: So my second doubt was cleared, but still can't wrap my head around the first one. The question as to why $$\frac{d}{dt} \frac{\partial r_i }{\partial q_j} = \frac{\partial \dot{r_i}}{\partial q_j }$$ is not answered explicitly. Sorry if I missed it in one of the links. But is it simply an interchange of the derivatives?

So meanwhile I tried the following:

$$\frac{dr_i}{dt} = \sum_k \frac{\partial r_i }{\partial q_k}.\dot{q_k} + \frac{\partial r_i}{\partial t}$$

Taking $$\frac{\partial \dot{r_i}}{\partial q_j}$$which then is reduced to:

$$\frac{\partial^2 r_i}{\partial q_j^2} + \frac{\partial}{\partial t}(\frac{\partial r_i}{\partial q_j})$$

So if I can reduce the above to $$\frac{d}{dt}(\frac{\partial r_i}{\partial q_j})$$, then I am done.But I can't seem to find my way from here.

marked as duplicate by Qmechanic♦ classical-mechanics StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 3 at 7:42

• The velocity and acceleration don't vary independently. And about the second doubt, the $x$ is not a variable, it's a function of time. And Lagrangian is a functional. – Abhas Kumar Sinha May 4 at 10:01
• Hints: 1. Use how ${\bf r}_i$ depends on the $q$ and $t$ variables. 2 Work out what both sides of the eq. are. 3. See that they are equal. – Qmechanic May 4 at 12:24