Goal: to write Newton's law in arbitrary coordinates. For F we assume there exists a potential, so we want a simple way to evaluate gradients; and for the ma side of Newton's law we want also a derivation from some scalar, which is easier to write than the vector a.
Gradients
Given a function f of any number of variables, one defines the gradient as the set of its partial derivatives.
The gradient at a point P describes the change of the function away from P to linear order:

One can also interpret the d in this formula as the gradient operator: then it tells us how df, the gradient of f, is expanded in terms of a basis dx, dy, dz ... If x, y, z are the usual rectangular coordinates, then dx = grad x = (1, 0, 0) is indeed a unit vector in the xdirection. The same chain rule holds for any coordinates q_{1}, q_{2}, ..., so that the gradient of f has the simple components ¶f/¶q_{1}, ¶f/¶q_{2}, ... in the basis dq_{1}, dq_{2} ..., which in general will not be orthonormal. (Nor will dq_{1} always point in the "q_{1}direction". Instead it will be orthogonal, as a vector, to the surfaces q_{1} = const).
Examle: Let q_{1} = (x^{2} + y^{2})^{h}, q_{2} = y, where x, y are the usual rectangular coordinates Then dq_{1} = 2xdx + 2ydy = (2x, 2y) = 2r = radially pointing vector of size r, and dq_{2} = dy = (0, 1) = unit vector in ydirection  definitely not an orthonormal basis, but cooked up in such a way that getting the components of the gradient is easy. So if f(q_{1}, q_{2}) = q_{1}  q_{2}^{2} we have

Position and Velocity Space
To write Newton's law using this simple expression for the gradient we will need a in the same screwy basis (also called "coordinate basis", as opposed to a "physical" orthonormal basis). Start with a simpler problem: how to write v that way. But v is defined only along the trajectory of a particle, unlike the result of taking a gradient. Instead we declare v to be independent variables from r. (Recall that in thinking of a function as a function of one or several functions, we can be pretty arbitrary: f(t) = ^{1}/_{2}at^{2} + vt + c can be f(u, v) = u + v + c where u(t) = ^{1}/_{2}at^{2}, v(t) = vt or f(w) = ^{1}/_{2}a(w^{2}  (v/a)^{2})) + c where w(t) = t + (v/a), or ...). This makes some sense considering that at a point (at t=0) we have to specify independently the velocity of a particle to get a unique motion.
So we think of v as living in a separate vector space, with basis d_{v}v_{x}, d_{v}v_{y}, d_{v}v_{z} where the subscript v indicates that the partial derivative is to be taken with respect to v. Since the rectangular component v_{x} can be written as ¶(^{1}/_{2}v_{x}^{2})/¶v_{x}, ..., we have

In rectangular components the basis dx, dy, dz is the same as d_{v}v_{x}, d_{v}v_{y}, d_{v}v_{z}  either is given as (1,0,0), (0,1,0), (0,0,1). By a stroke of luck this is also so in any other coordinates q_{1}, q_{2}, q_{3}, provided that the q's are functions only of the x's, not of the v's or x^{·}'s. This is eaily shown by another application of the chain rule. We'll leave out the subsripts and sums over them, the main idea is that if q = q(x) then


Example: If a force F (with potential U) acts on a particle in a very viscous medium with retarding force kv we can neglect the acceleration, so that the law of motion become F = kv. To write this in polar coordinates r, f we note v^{2} = r^{·2} + (rf^{·})^{2}.
Then the coordinate fcomponent of F is ¶U/¶f. (That's the big simplification). The corresponding fcomponent of v is ¶(^{1}/_{2}v^{2})/¶f^{·} = r^{2}f^{·}, hence the law of motion in the fdirection becomes ¶U/¶f = r^{2}f^{·}, which is the same equation as one gets by taking the usual "physical" or unitbasis components (except multiplied on both sides by a factor r).
Moral: one gets a correct equation, but it is not necessarily a physical velocity. In this case the RHS is more nearly an angular momentum (but the mass is missing ...)
The RHS (ma) of Newton's laws
There is no getting around it: when your vector quantities are expressed in a basis that changes from point to point, and you want a (total) time derivative, you must differentiate both the components and the basis vectors. But in the present formalism both terms become simple (well .. simpler, anyway).
First, it is highly suggestive to talk not about v, but about p = mv: then p = Ñ_{v} T where T = ^{1}/_{2}mv^{2}, the kinetic energy.
Next, let's evaluate dp/dt for the RHS of Newton's law. Again we'll write just one term, as if in 1D. (If you put _{i} on the terms and a å_{i} in front of the whole thing you'll get the expression in 3D or more):



Example of an application
A spring (zero unstretched length) hangs from a point, with a mass m on the other end. The mass can move anywhere in a vertical plane. What are the equations of motion in terms of r (length of spring) and q (angle of spring with vertical)?
We let U = 0 at the suspension point, then it is easy to write U in terms of r and q:
U = mgrcosq+ ^{1}/_{2} kr^{2}
To find T you pretty much have to know the physical components of v, that is, to know that the component in the rdirection is r^{·}, and in the qdirection it is rq^{·}. Since these are in an orthonormal system we square and add to get v^{2}. (Alternatively we could write the relation between r, q and x, y, e.g. x = rsinq, differentiate (x^{·} = r^{·} sinq+ r cosqq^{·}), square and add.) Anyway,
T = ^{1}/_{2} m (r^{·2} + (rq^{·})^{2}
With this we have no longer need to think about vector components explicitly, only about partial derivatives (remembering that there are four independent variables, r, theta, r^{·} amd q^{·}, and correspondingly four different partial derivatives.
The ingredients for Eq (3) are

mg cosq kr = ^{d}/_{dt}mr^{·}  mrq^{·2} = mr^{¨}  mrq^{·2}
and for q_{2} = q:
mg sinq = ^{d}/_{dt}mr^{2}q^{·} = 2mr r^{·} q^{·} + mr^{2}q^{¨}
These are the equations of motion  easily written down, not easy to solve (except in the limit of small q.
Of course, one first integral is given by the total energy = T + U = const.