Are formal characters like \[FormalA] to be used differently than other symbols?



I noticed that Mathematica has a set of special 'Formal' characters such as \[FormalA], \[FormalB] , etc.. In the front end, it looks like a character with a dot above and below:

formal characters

It is not clear from the built-in documentation how these characters are to be used.

Would someone demonstrate?


Posted 2013-02-05T20:45:14.370

Reputation: 18 597

1Version 10 now has formal Greek letters, too. – J. M.'s ennui – 2015-11-19T11:08:24.253

2@R.M. Not all formal symbols are protected: \[FormalDelta] is but \[FormalPhi] is not Protected. According to TechSupport, this is by design, as some formal symbols are used internally, some are not. This is aggrevating, as one cannot rely on that a formal symbol has no global value set by the user. – István Zachar – 2015-12-02T10:25:20.120

@R.M. Out of curiosity, would you know in which version of Mathematica \[Formal] characters were introduced? – QuantumDot – 2015-12-26T20:47:54.087


Formal symbols are Protected, so they can't be assigned values (by default). So you can use it as a way of ensuring that your definitions don't have stray values. It has been used several times on this site (see some of the posts here for examples), although I don't think a question has been asked explicitly about it.

– rm -rf – 2013-02-05T20:50:12.903



Very often, especially new Mathematica users stumble over the following error: They gave, maybe hours ago, a symbol a value like x=3, and later they try to use it where a function really expects a symbol:

Mathematica graphics

This leads of course to an error, because the Minimize call does not see the x, but only its value. The same happens when you try to derive this with D or Dt or Integrate expressions. Although the error message is very clear, most people get very confused and try to change their whole calculation.

Exactly for those situations, the formal parameter characters are made. They all share the attribute Protected which states that you cannot simply assign a value to them. Therefore, you can use them in situations where you maybe derive expressions or proof formulas or where you minimize an expression

Mathematica graphics


Posted 2013-02-05T20:45:14.370

Reputation: 109 574

2This is a nice issue for the beginner's pitfalls question too – Dr. belisarius – 2013-02-06T02:41:21.383


I would like to point out that the shortcut to write out formal symbols is :$a:, where : is typed using Esc. See the documentation here.


Posted 2013-02-05T20:45:14.370

Reputation: 161