0

I am confused by the fact that on Wolfram Alpha x(2)/x(2) = 1 but 2(x)/2(x) = x^2. Could someone explain what rules are being used here?

Chris_F
  • 175

1 Answers1

2

It's probably interpreting the first as $\frac{x(2)}{x(2)}$ and the second as $2\frac{(x)}{2}(x)$.

Note that things like $\rm letter(number)$ often refer to evaluating functions, not multiplication. This is why it won't necessarily split the $x$ and the $2$ in the expression $x(2)$ from each other.

Edit: in fact W|A even tells you this is how it's interpreting your input:

enter image description here

anon
  • 151,657
  • I'm sure of that. I'd like to know why it is doing this. The fact that it could possibly be ambiguous as to whether x is a function or variable does not seem like it would be relevant here. – Chris_F Aug 16 '14 at 07:32
  • @Chris_F Of course it's relevant: if $x$ is a function then you can't interpret x(2)/x(2) as $\frac{x(2)}{x}2$, because you can't split the $x$ and the $2$ from each other! – anon Aug 16 '14 at 07:33
  • Hmm, I see what you mean now, but it still does not make sense. It's not really ambiguous. There is not function named x so it should know already that x(2) is the same as 2(x). – Chris_F Aug 16 '14 at 07:35
  • @Chris_F That's extremely wrong, people type unspecified functions into W|A all the time. As a CAS it's able to manipulate not just variables but functions too. You can for example type a differential equation with an initial value condition into W|A and it will solve for the function for you (if it's nice enough). Given this functionality and the demand by users for it, W|A must err on the side that's most helpful to people, which means in this case it chooses to interpret it as a function. Most would never write $x(2)$ when they meant $2x$, but they'd always write $x(2)$ for a function. – anon Aug 16 '14 at 07:37
  • Yes, a function x could be defined, but one was not. If it had been, then it truly would have been ambiguous and Wolfram would not be able to interpret the input. – Chris_F Aug 16 '14 at 07:39
  • @Chris_F W|A deals with people who don't have experience with programming or computer algebra systems, so it's programmed to make reasonable assumptions about things in order to account for users being unable to write things clearly and in a standard format. This is unlike Mathematica, where you would have to explicitly tell it what's a function and what isn't. – anon Aug 16 '14 at 07:40
  • What I mean to say is the fact that W|A gives an answer to x(2)/x(2) and not an error to the effect of "no function by the name of x" means that W|A knows full well that x is a variable being multiplied by juxtaposition, not a function, so why would it treat it differently? – Chris_F Aug 16 '14 at 07:43
  • @Chris_F The fact that W|A didn't return an error saying "you haven't defined a function" does not mean W|A didn't interpret it as a function. Like I've said multiple times now, W|A handles unspecified functions inputted by users all the time. As I said earlier, you could type in a differential equation and not tell W|A the letter is a function, and W|A will automagically figure out that it's supposed to be a function, just like W|A looks at the expression x(2)/x(2) with the letters/numbers ordered as it is to automagically determine that x is (most likely) a function. – anon Aug 16 '14 at 07:45
  • W|A is unable to interpret the input funcx(2)/funcx(2). Based on what you've said, I would have expected it to yield an answer of 1. – Chris_F Aug 16 '14 at 07:49
  • @Chris_F Mathematicians (and hence math students) almost always use single letters for variables and functions, not strings of letters like programmers do. Type in x(2)/x(3) and see what you get. Does it cancel out the xs? Nope. If you type in (x*2)/(x*3) it does cancel out the $x$s. Because then it's clearly a variable. (Note if you type in (x2)/(x3) W|A automagically believes you forgot to type in ^ signs, so it interprets it as (x^2)/(x^3)! See how it makes assumptions and fills in the blanks for the user?) – anon Aug 16 '14 at 07:55