TITLE: Lagrangian Mechanics & Derivatives
QUESTION [10 upvotes]: I don't really know whether to put this in Physics forums since it is relating to Mechanics, or Math since the question is actually about the math being done. Don't criticize me over it.
So for the question: I was doing some review problems on Lagrange's equations, KE+PE, and I found this document.
In the first question's solution, the writer differentiates without explaining the step. They have these:
$$\begin{cases}
x = r \sin(\theta) \cos(\phi)\\[5 pt]
y = r \sin(\theta) \sin(\phi)\\[5 pt]
z = r \cos(\theta)
\end{cases}
$$
and this:
$$T = {m\over 2}(\dot x^2 +\dot y^2 +\dot z^2)$$
I never really studied the spherical coordinate system much, and obviously never thought about the derivatives of the conversion into Cartesian. Can someone find or explain the process of taking the derivatives of the first three equations, plugging into the equation for Kinetic Energy, and simplifying? There is a probably a different calculus method for the coordinate system, which I don't know. Thanks!
EDIT: While doing taking the derivatives, was the method used actually a separate form of calculus beyond I and II, or was it normal first-order differentiation? If so, how? Here is the part I am speaking of:

Solution: The kinetic energy is $T=\frac m2(\dot x^2+\dot y^2+\dot z^2)$. We substitute
$$\begin{cases}
x = r \sin(\theta) \cos(\phi)\\[5 pt]
y = r \sin(\theta) \sin(\phi)\\[5 pt]
z = r \cos(\theta)
\end{cases}
$$
Differentiating these, substituting into $T$, and simplifying, we find
$$T=\frac m2 (\dot r^2 +r^2\dot\theta^2+r^2\sin^2\theta\dot\phi^2).$$

REPLY [2 votes]: To convert the cartesian expression for kinetic energy,
$T = \dfrac{m}{2}(\dot x^2 + \dot y^2 + \dot z^2) \tag 1$
into sperical coordinates $r,\phi, \theta$ such that
$x = r \sin \theta \cos \phi, \tag 2$
$y = r\sin \theta \sin \phi, \tag 3$
$z = r\cos \theta, \tag{4}$
we merely need employ two standard results from elementary calculus, namely, the Leibniz product rule and the chain rule; the calculations are all in the realm of basic first-order differentiation using these two principles.  I will start by illustrating how these concepts apply to $z$ (4), since it is the simplest of the three expressions (2)-(4); from (4), by the product rule, where I use $\dot{}$ and ${}´$ both to represent the $t$-derivative,
$\dot z = \dot r \cos \theta + r (\cos \theta)'; \tag 5$
we apply the chain rule to (5):
$(\cos \theta)' = \left (\dfrac{d\cos \theta}{d\theta} \right ) \dot \theta = -\dot \theta \sin \theta; \tag 6$
thus (5) becomes
$\dot z = \dot r \cos \theta - r \dot \theta \sin \theta; \tag 7$
we similarly handle $x$ as in (2): again, the product rule yields
$\dot x = \dot r \sin \theta \cos \phi + r(\sin \theta)'\cos \phi + r\sin \theta (\cos \phi)', \tag 8$
and again we apply the chain rule, this time twice:
$(\sin \theta)' = \dfrac{d\sin \theta}{d\theta} \dot \theta = \dot \theta \cos \theta, \tag 9$
$(\cos \phi)' = \dfrac{d\cos \phi}{d \phi} \dot \phi = -\dot \phi \sin \phi; \tag{10}$
assembling (8)-(10) together:
$\dot x = \dot r \sin \theta \cos \phi + r\dot \theta \cos \theta \sin \phi - r\dot \phi \sin \theta \sin \phi; \tag{11}$
y a parellel procedure, first using the Leibniz and the chain rule, we also have
$\dot y = \dot r \sin \theta \sin \phi + r \dot \theta \cos \theta \sin \phi + r \dot \phi \sin \theta \cos \phi; \tag{12}$
with (7), (11)-(12) at hand, calculating $\dot x^2 + \dot y^2 + \dot z^2$ in sphericals involves no more than a good slug o' algebra; but there is really nothing to see in it that hasn't been very nicely and more than adequately presented by our colleagues David Morgante and 
Ahmed S. Ataalla.
So I think I'll leave off now.  My main point and interest here has been to point out how the Leibniz and chain rules, both results of basic calculus, are used to effect the transformation of the velocities, which then leads to the expression for $T$ in spherical coordinates, as others have shown.