Examples with Graphics and Conditional Definitions
As a another example, let's define the Sign function. It should be -1 when its argument is negative, 0 when its argument is zero, and +1 when its argument is positive. There are lots of ways to write this function, there is no best way. Whatever works is good.
Here we write our own version, we don' t "name'' the pattern because it is not needed in the function definition. It is a bit harder to read this way, but I use it here to be instructive.
Functions with Conditional Definitions
In thermodynamics, x ln(x) appears frequently in expressions that involve entropy. The variable x is restricted to 0 ≤x≤1.
Created by Wolfram Mathematica 6.0 (06 September 2007) | ![]() |