Question
I have some experience with Sage and Matlab. Both mathematical software packages require you to have the '*' sign when multiplying symbolic variables with integers. For example, in Matlab you have to define a function as f = 3*x instead of f = 3x. The latter throws a Error: Unexpected MATLAB expression in between the 3 and the x.
Attempts
I have done a google search of why the '*' is required with little luck. I found a Intro to Sage documentation which states the following:
[e]xponents are '^', and multiplication must be '*'. (There are good reasons for this.)
What exactly is this "good reason"?
I found a stack exchange answer that hints at potentially why this is the case:
(And maybe also worth mentioning is that of course a CAS like Mathematica has to be told how to interpret something like ab and thus we'll have to write "" with space inbetween which makes it look and feel more like "a b's".)
However, I am confused by this comment since defining a function as f = 3 x with a space between the 3 and the x still throws the same error in Matlab. If humans are able to identify that 3x is 3*x, how come popular mathematical software packages cannot?
The short answer is that the programs weren't designed that way because and the designers didn't want to put the development time or take the performance hit in order to anticipate every possible way a user might want to multiply. But this needs a bit more explanation.
It would make sense for the example you gave for f=3x to be automatically changed to f=3*x, but if you replaced the 3 with another variable y, a program like MATLAB would assume you wanted to multiply a new variable xy that you forgot to initialize. there are other situations where the user's intent would be ambiguous without a * (as illustrated by some comments on this answer). It would be possible for MATLAB to look at each equation and try and determine when the user needed a *, but this would require both computation and development time. It would also make code less consistent and easy to read.
There are software tools that more intuitive than MATLAB and Mathematica that will recognise 3x as 3*x (such as Wolfram Alpha), but this is because the target audience is more broad and intuitiveness is valued over speed and, to a certain extent, capability.