You can use the Note package , but this leads to other problems. So here is your original equation:
In[1]:= Solve[b + as^2 == 0, s^2] During evaluation of In[1]:= Solve::ivar: s^2 is not a valid variable. >> Out[1]= Solve[b + as^2 == 0, s^2]
Now Symbolize
s ^ 2, so a normal Mathematica evaluator treats it like any other character
In[2]:= Needs["Notation`"] In[3]:= Symbolize[ParsedBoxWrapper[SuperscriptBox["s", "2"]]] In[4]:= Solve[b + as^2 == 0, s^2] Out[4]= {{s^2 -> -(b/a)}}
The problem is that s ^ 2 is really regarded as just another character, for example
In[6]:= Sqrt[s^2]
A workaround is to replace s ^ 2 with s * s, since Symbolize
only affects user-entered expressions (i.e., at the level of interpretation of the entered box structures)
In[7]:= Sqrt[s^2] /. s^2 -> ss // PowerExpand Out[7]= s
Simon
source share