Re: TraditionalForm bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg66069] Re: TraditionalForm bug?
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Fri, 28 Apr 2006 06:33:17 -0400 (EDT)
- References: <7B896DFE-0B74-4E2B-A5C0-D6FCBDE2B69F@mimuw.edu.pl>
- Sender: owner-wri-mathgroup at wolfram.com
On 27 Apr 2006, at 22:06, Andrzej Kozlowski wrote:
> I just noticed something in my version of Mathematica:
>
> $Version
>
> 5.1 for Mac OS X (October 25, 2004)
>
> which certainly looks like a bug that should have been spotted a
> long time ago. The "bug" is simply this. Evaluate
>
> In[14]:=
> Sin'
>
> Out[14]=
> cos(#1)&
>
> This is fine. But now simple convert the above input to
> TraditionalForm and evaluate it again:
>
> In[15]:=
> \!\(\*FormBox[
> SuperscriptBox["sin", "â?²",
> MultilineFunction->None], TraditionalForm]\)
>
> Out[15]=
> \!\(\*FormBox[
> SuperscriptBox["sin", "â?²",
> MultilineFunction->None], TraditionalForm]\)
>
> What happens is that Mathematica converts Sin` to sin` and then
> forgets what sin means. This does not happen if you do the same
> with an argument:
>
> In[17]:=
> Sin'[x]
>
> Out[17]=
> cos(x)
>
> In[18]:=
> \!\(\*FormBox[
> RowBox[{
> SuperscriptBox["sin", "â?²",
> MultilineFunction->None], "(", "x", ")"}], TraditionalForm]\)
>
> Out[18]=
> cos(x)
>
> The embarrassing thing is that I discovered this while trying to
> show my students the advantages of functional notation, and in
> particular the fact that one can refer to functions and their
> derivatives without introducing unnecessary variables. Of course
> this is true, but if you sue TraditionalForm form input! This
> reminds me that there was recently a discussion of whether
> TraditionalForm is or is not suitable for this purpose. I recall
> that Paul Abbott and Daniel Lichtblau expressed opposing views and
> I was tempted to enter the fray but decided to stay out, because
> while my heart sided with Paul my brain did not. As is often the
> case the brain seems to have been right.
>
> Andrzej Kozlowski
Perhaps I was a bit too harsh, since this works:
(sin(#)&)'
cos(#1)&
So things are not quite as bad as I wrote above, we can still use
functional notation and derivatives as long as we remember to write
sin(#)& instead of sin etc.
Still, this means that TraditionalForm is not quite as "traditional"
as one would wish it to be.
Andrzej Kozlowski