# Conventions used for ordering math expressions

Consider the following expressions:

a) $\;\dfrac{1}{x} - \dfrac{x}{x^2+1}$

b) $\;\dfrac{1}{x} + \dfrac{-x}{x^2+1}$

c) $\;\dfrac{1}{x} - \dfrac{x}{1 + x^2}$

d)$\;- \dfrac{x}{1 + x^2} + \dfrac{1}{x}$

They are all equivalent. In the book I'm reading, they are seemingly arbitrarily using all four forms above. As a programmer, it annoys me a lot because I think consistency is important and this book's authors are not being consistent.

So my question is if there are any math conventions which states which of the above four alternatives is the best to use? It there aren't and the answer is it depends, then what does it depend on?

E.g: No one would consider writing $x^2 + 1 + 2x^7 + x - x^3$. Instead, everyone thinks it should be $2x^7 - x^3 + x^2 + x + 1$. Why can't that thinking be applied to expressions other than polynomials?

• As a programmer do you insist on using "tab" or do you insist on "five spaces." Arguments, or conditions about this, are usually just as ridiculous.
– user335907
Commented Feb 10, 2017 at 16:54
• Why are those inconsistent? Commented Feb 10, 2017 at 16:54
• I find that c) is easiest on the eye. One reason is that (together with a) is the simplest (fewest symbols). My preference over a) is just taste... often I'd place the $x^2$ as the last (as in c)) if it were smaller than $1$. Commented Feb 10, 2017 at 16:54
• The all have the same value, just as 5+7 and 2*6 have the same value. But the "mean" different things and which is better is for context. Any rule to say one is preferred ovet the other would be pointlessly arbitrary and useless and make every thing harder. Commented Feb 10, 2017 at 16:56
• Okay, ... now you've set me off.... I think consistency is not at all important and is the hobgoblin of tiny minds. Okay, I don't really but sheesh, no, those aren't inconsistent and any method to force them to one convention would stifle the ability to work as different expressions will arise by what is pertininent for which context. Commented Feb 10, 2017 at 17:03

There is no fixed convention. If an author makes any conscious decisions in this regard, they will be to present calculations in a form that makes them as easy to follow as possible, based on psychological considerations.

Consistency will often be a part of this, but consistency can mean different things in different situations. For example, in one case it might be advantageous to order the terms of a polynomial by increasing powers of $x$ (such as when you're interested in behaviour near $x = 0$), and in another by decreasing powers (for $x \to + \infty$).

In general, the ordering is frequently such that the important terms are placed at the beginning, and less important ones (for example terms that end up being negligible in some argument) near the end. But in other cases your main consideration may be to make some equality $A = B$ as obvious as possible by having corresponding terms in corresponding positions.

Of course, the considerations for computer algebra systems are likely to be completely different than those for human readers.

• +1 Particularly for the first paragraph.You answered explicitly the OP's "what does it depend on?". Commented Feb 10, 2017 at 17:23

There is a programming context relevant to this "problem" which someone has thought about before.

It is an issue in the area of the mathematical language processing required when automatically assessing student answers in online mathematical homework and examinations.

Many online homework systems claim to correctly grade equivalent answers. Some automatic assessment software is better than others and it is a work still in progress.

An extensive discussion of this topic may be found in this 2015 paper by Andrew S. Lan, Divyanshu Vats, Andrew E. Waters, Richard G. Baraniuk.