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?
x3
is a valid variable name,3x
is not. $\endgroup$