How Do I Use Formulas That I Found Elsewhere in Mathematica?

Using formulas is very simple. Just retype the formula, name it as a function, define your variables, and you are done.

For example, suppose you have found the formula for the magnitude of a dipole field in Cartesian coordinates.


The easiest way to input this formula is to use the BasicInput.nb palette.

  1. Open a new notebook or create a new cell in an open one by clicking below the last blue cell bracket.
  2. Open the BasicInput.nb palette by clicking the hyperlink, or select BasicInput from File->Palettes.
  3. Click [Graphics:Images/index_gr_2.gif].
  4. Type 1, and use the tabulator key to jump to the denominator.
  5. Click [Graphics:Images/index_gr_3.gif].
  6. Type (x+.
  7. Click [Graphics:Images/index_gr_4.gif].
  8. Type x, use the tabulator key to jump to the next placeholder, type 0, and press CONTROL-SPACE to jump out of the subscript.
  9. Type ), select the expression [Graphics:Images/index_gr_5.gif] with the mouse, click [Graphics:Images/index_gr_6.gif], and type 2.

To find out how you can type this input using keyboard shortcuts, see the documentation for keyboard shortcuts for either Microsoft Windows, Macintosh, or X.

After you input the rest of the formula in a similar manner, you can use plotting functions to visualize it immediately. Just plug in values for [Graphics:Images/index_gr_7.gif] and [Graphics:Images/index_gr_8.gif].



To use a formula more generally, you can easily represent it as a Mathematica function. Here is the textbook formula for the electric field of a number of radial wires carrying opposing currents organized on a unit circle.


Here is the same formula written as a Mathematica function. Note that function names are uppercase by convention, function arguments are enclosed in square brackets, and the independent variable is followed by an underscore in the function definition. All the other typeset elements were input using the BasicInput.nb palette.



Return to Top