Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The signature of the function on the left hand side is f0(x) and of the one on the right hand side is f(u,v). The latter function signature is not f(u(x),v(x)), that would be a very grave mistake (and it would make the chain rule useless).

On the right hand side, it is not lambda x: f(u(x), v(x)) that the differential operator ∂/∂u (or ∂/∂v) is applied on—because the former would be a function of x.

(I use only x rather than (x,y) for simplicity so you can see where a big problem would lie)

Be aware that the notation in ∂f/∂x = ∂f/∂u ∂u/∂x + ∂f/∂v ∂v/∂x is already very simplified and the actual whole thing would be (in somewhat more modern Leibniz notation--as opposed to the one in the footnote):

∂/∂x f0(x) = ∂/∂u f(u(x),v(x)) ⋅ ∂/∂x u(x) + ∂/∂v f(u(x),v(x)) ⋅ ∂/∂x v(x)

Where (as is usual) the (...) without space in front (sigh) denotes function calls, and the ∂/∂x f0 makes a new function (with the same formal parameters as the original f0).

Note that the function call is done on that new function (this order of precedence is the usual in mathematics). Also, the multiplication (⋅) is done after the function calls, on actual numbers. And the + here adds numbers.

Also, it is assumed that the two functions f0 and f are connected via the equation f0(x) = f(u(x),v(x)), which is implied. (the right one is called function composition and could be written f0(x) = fo(u,v)(x), but that's an entire extra chapter to define that)

Understanding what exactly is going on where in here is already the basis for fluid dynamics.

The footnote tries to have globally unique names, so you have funny things like u = g(x,y). Ugh. For programmers, it is normal that the formal parameters of a function f (those are u and v) and the global function u are different things, so we don't need to do what the footnote did.

For clarity:

  f0(x) := ...
  f(u,v) := ...
  u(x) := ...
  v(x) := ...
Note: There's also Lagrange's notation for differential operators--but in my opinion it's useless for functions of more than one parameter. There, the first-order derivative of f would be f'. Chain rule of our example cannot be written there as far as I know. The best you could do is f0'(x) = f???(u(x),v(x)) ⋅ u'(x) + f???(u(x),v(x)) ⋅ v'(x) where the ??? is what I wouldn't know how to write. Maybe f.x and f.y or something--but that's totally arbitrary.

Note: The names of the formal parameters have no meaning outside of the function (right?), so it makes sense to just have a "differentiate first argument" operator D1 and a "differentiate second argument" operator D2 instead. Then the chain rule is: D1 f0(x) = D1 f(u(x),v(x)) ⋅ D1 u(x) + D2 f(u(x),v(x)) ⋅ D1 v(x). Again, the function calls are only made after you got the new function from the D1 or D2.

Also, evaluating an expression like f(u(x),v(x)) works just like it would in C.

Be aware that the definition of u(x) itself cannot contain u (that is very important), only x. So f(u(x),v(x)), even if written in symbolic equations, will NOT contain u or v in the end, only x-es.

For example if u(x) := 5 ⋅ x and v(x) := 3 ⋅ x and f(u,v) := 7 ⋅ u + v, then f(u(x),v(x)) = 7 ⋅ 5 ⋅ x + 3 ⋅ x. No u or v left.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: