I work with piecewise functions a lot in the courses I teach, and sometimes to do a quick reality check I would enter a piecewise function on Mathematica. Mathematica (the old version 5 I have) can do piecewise functions by declaring a function beginning with a replaceable parameter:
After this, I press <ESC>pw<ESC><CTRL+ENTER> and I get:
with four placeholders for math expressions and their restrictions, which can be added by pressing CTRL+ENTER. I can add more by pressing CTRL+ENTER again. If I want an exponent, I type the base, then CTRL+6 then my exponent. Mathematica 5 makes it only partially clear what keyboard shortcuts to use for math expressions so that you don’t have to go to the pallette each time, but they are there.
Also the hints are not always there if you glide your mouse on the palette, so you will need to look for “keyboard shortcuts” in the documentation.
Here is a table of some shortcuts you might frequently use:
|x3||Ctrl+6||Superscript or exponent|
|Ctrl+Spacebar||Moves cursor out of a formula by 1 level|
|Ctrl+Enter||Adds another matrix row or creates a 2×2 if one does not exist|
|∞||ESC+\infty+ESC||One of many TEX-style ways of getting special characters|
|Δ||ESC+D+ESC||Greek capital delta|