I think a lot of my confusions when I first learned calculus would have been eliminated with a notation that clearly expressed that derivatives operate on whole functions, not on values. So the derivative of f(x) at x=0 is not some function of f(0), but it is derivative(f)(x). Also, even without derivatives, sometimes the expression f(x) refers to the whole function, sometimes just a particular value of it at a specific x.
I don't know if higher-order functions are really that tough to teach/understand but I think it would actually simplify and demistify many things.
Currently, of the widespread notations I like this one best:
f(x0) = d/dx (sin(x)*cos(x)+x^2) | x=x0 (with the last part in subscript)
I also miss variable scoping from math writing and it disturbs me that variable names often carry semantics, like p(x) and p(y) can be the probability density functions of random variables X and Y (so p is a different function depending on the name of the input variable that you substitute so it doesn't actually operate on real numbers, but (string, number) pairs). I'd prefer to explicitly mark the functions as p_X(x) and p_Y(y).
Similar things come up a lot with differential equations where you don't really know whether something (like y or u) is supposed to be a function (of x or t) or "just" a variable.
Despite the general opinion among laypeople that math notation is very precise and unambiguous, I find that it's often very sloppy and unless you already understand the context very well, it can easily be misleading. Math notation is somewhere between normal natural language and programming languages, and depending on the writer it may be closer to one or the other.
One can argue that this is necessary for compactness.
Part of it is the brevity, and part of it is the shortcuts. E.g. when I did my masters, one thing I quickly realised was that papers that expressed an algorithm using mathematical notation almost always lacked essential details.
My impression is that it's too obvious when there are too large leaps in code, whereas in mathematical notation everyone accepts leaps that can obscure that essential details have been left out.
E.g. you'd have papers on thresholding of images for OCR (deciding what is background and what is foreground) where it turned out the results were highly dependent on certain values represented by certain variables that were never defined, for example, putting in a situation of reconstructing parameters by trial and error if you wanted to reproduce the results.
Today I'm immediately suspicious if results are presented as maths outside of fields where the maths is essential (and sometimes even then) as I see it as having a tendency to be used to gloss over sloppy work or save space by leaving out essential details.
I'm sure this is not the case in all fields, and that people with a more extensive maths background will be able to fill in more of those leaps without much effort, and so it might very well be acceptable in some fields. But to me a notation that makes it that easy to hide missing details is a liability.
Code's easy for me (unless "mathy" in appearance like Haskell) but mathematical notation's always made me feel dyslexic.
I'd love to see this beauty or clarity or whatever that people find in mathematics, but I've never caught even a hint of it. Seems like it needs a good IDE to make up for deficiencies in its language.
That's because code has documented and testable semantics whereas mathematical notation is more by convention than anything. It's in between natural language and code in terms of ambiguity, but is sufficiently flexible and clear to practitioners that it remains the best way to communicate to other practitioners.
...that's the thing actually: in programming syntax defines semantics because "syntax" is executed and in practice "it means what it does (what is executed)".
(Linguists would want to murder me for saying this, I know.)
That's why some programming languages can even be defined by implementation. (Though as a programmer I try my best to avoid these languages...)
I think one of the problems is that calculus teaches us the ideas that there's an construction called a derivative, but in reality there's lots of different kinds of derivatives with different semantics and types. For the vast amount of applied math and engineering work, the two we need are the total (Fréchet) derivative:
Candidly, unless you really know your problem, we virtually always want the total derivative since it gives rise to things like gradients and Hessians, which are useful objects that we can store in memory.
Now, the reason that I bring these two up is that their spaces, or really their types, are different. Given a function f:X->Y, the total derivative is a linear operator from X to Y:
(total) f'(x) \in L(X,Y)
The directional derivative is an element in the space Y:
(dir) f'(x;dx) \in Y
Now, at this point, the notation is screwed up since we used Lagrange notation for both. The reason that we can get away with this is that under certain assumptions, that are mostly satisfied in the things we care about, we have that:
f'(x)dx = f'(x;dx)
Alright, so why should we care? Leibniz and Newton notation do a terrible job at capturing this information. Lagrange and Euler notation do a good job at this. For your example:
f(x0) = d/dx (sin(x)cos(x)+x^2) | x=x0
The types don't line up because sin(x)cos(x)+x^2 is value, literally a real number, not a function. Using the above, I would write this as:
(x \in R |-> sin(x)cos(x)+x^2)'(x0)
In LaTeX |-> would be \mapsto. This types correctly in the definitions above since
x \in R |-> sin(x)cos(x)+x^2 \in [R -> R]
and
(x \in R |-> sin(x)cos(x)+x^2)'(x0) \in L(R,R)
Of course, you probably wanted the value and not the function, which explains why we cheat in 1-D. So, we really should write:
(x \in R |-> sin(x)cos(x)+x^2)'(x0) 1 \in R
where we feed it the direction 1. And, yes, this is slightly more cumbersome that we may want, which is why there's a huge number of different notations. However, I do assert that the above generalizes properly all the way into infinite dimensions (Hilbert spaces) and provides a good foundation for typing out mathematical codes.
By the way, if anyone is looking for a book that does this right in my opinion, Rudin's "Principles of Mathematical Analysis" is amazing and his notation is good. For infinite dimensions, I prefer Zeidler's "Nonlinear Functional Analysis and Its Applications." Personally, what I look for is what I call properly typed notation that gives us easy access to useful tools like gradients, Taylor series, chain rule, and implicit and inverse function theorems. Again, most engineering and applied math work requires these theorems everywhere, so I find it best to keep them clean.
I don't know if higher-order functions are really that tough to teach/understand but I think it would actually simplify and demistify many things.
Currently, of the widespread notations I like this one best:
f(x0) = d/dx (sin(x)*cos(x)+x^2) | x=x0 (with the last part in subscript)
I also miss variable scoping from math writing and it disturbs me that variable names often carry semantics, like p(x) and p(y) can be the probability density functions of random variables X and Y (so p is a different function depending on the name of the input variable that you substitute so it doesn't actually operate on real numbers, but (string, number) pairs). I'd prefer to explicitly mark the functions as p_X(x) and p_Y(y).
Similar things come up a lot with differential equations where you don't really know whether something (like y or u) is supposed to be a function (of x or t) or "just" a variable.
Despite the general opinion among laypeople that math notation is very precise and unambiguous, I find that it's often very sloppy and unless you already understand the context very well, it can easily be misleading. Math notation is somewhere between normal natural language and programming languages, and depending on the writer it may be closer to one or the other.
One can argue that this is necessary for compactness.