Mathematica : Mathematics & Statistics Home : University of Vermont
home
CEMS - The College of Engineering and Mathematical Sciences

Mathematica

Common Problems and How to Fix Them

  • My function won't plot.

    The most common reason a function won't plot is that it wasn't entered correctly when you defined it. Check for proper Mathematica syntax such as capital letters, proper use of square brackets around arguments of functions, and round parentheses for grouping. Make sure you have an underscore after your variable(s) in the definition of your function.

    Remember to use a space or an asterisk for multiplication. For example, to define a function for f(x)=xsinx use the following.

    f[x_]:=x Sin[x]

    If you run xSin[x] all together with no space, it will be interpreted as all one word "xSin"

  • This was working before, and now it's not.

    Try clearing your function(s) and re-executing.

    If you have quit Mathematica and come back, make sure you re-evaluate whatever functions (etc.) you were working with. Mathematica has no way of remembering what you did in a previous session!

  • What does the error Set::write : Tag (something) is Protected mean?

    This error commonly occurs if there is a conflict with a name. For example, you will get this error if you previously used the letter f to name a constant (or a Plot or what have you), and then you try to define a function f[x]. The way to fix it is to clear the offending symbol, in our example Clear[f], and then re-evaluate the definition that was failing. Alternatively, use new name instead of the one that gives the error message.

  • I can't get Solve to work.

    Make sure you use a double-equal sign in the equation you are trying to Solve.

    If you accidentally type a single-equal sign, you have permanently set the two sides of the equation equal, ruining whatever function(s) are involved. If this happens, you can fix it by clearing your function(s), then re-evaluate and try again.

  • Something isn't working right and I can't figure out why.

    Try clearing everything with Clear["`*"] and re-evaluate your work in order.

Contact UVM © 2013 The University of Vermont - Burlington, VT 05405 - (802) 656-3131