Abstract patterns
This post is a revision of the article on pattern recognition in abstractmath.org.
When you do math, you must recognize abstract patterns that occur in
 Symbolic expressions
 Geometric figures
 Relations between different kinds of math structures.
 Your own mental representations of mathematical objects
This happens in high school algebra and in calculus, not just in the higher levels of abstract math.
Examples
Most of these examples are revisited in the section called Laws and Constraints.
At most
For real numbers $x$ and $y$, the phrase “$x$ is at most $y$” means by definition $x\le y$. To understand this definition requires recognizing the pattern “$x$ is at most $y$” no matter what expressions occur in place of $x$ and $y$, as long as they evaluate to real numbers.
Examples
 “$\sin x$ is at most $1$” means that $\sin x\le 1$. This happens to be true for all real $x$.
 “$3$ is at most $7$” means that $3\leq7$. You may think that “$3$ is at most $7$” is a silly thing to say, but it nevertheless means that $3\leq7$ and so is a correct statement.
 “$x^2+(y1)^2$ is at most $5$” means that
$x^2+(y1)^2\leq5$. This is true for some pairs $(x,y)$ and false for others, so it is a constraint. It defines the disk below:
The product rule for derivatives
The product rule for differentiable functions $f$ and $g$ tells you that the derivative of $f(x)g(x)$ is \[f'(x)\,g(x)+f(x)\,g'(x)\]
Example
You recognize that the expression ${{x}^{2}}\sin x$ fits the pattern $f(x)g(x)$ with $f(x)={{x}^{2}}$ and $g(x)=\sin x$. Therefore you know that the derivative of ${{x}^{2}}\,\sin x$ is \[2x\sin x+{{x}^{2}}\cos x\]
The quadratic formula
The quadratic formula for the solutions of an equation of the form $a{{x}^{2}}+bx+c=0$ is usually given as\[r=\frac{b\pm
\sqrt{{{b}^{2}}4ac}}{2a}\]
Example
If you are asked for the roots of $3{{x}^{2}}2x1=0$, you recognize that the polynomial on the left fits the pattern $a{{x}^{2}}+bx+c$ with
 $a\leftarrow3$ (“$a$ replaced by $3$”)
 $b\leftarrow2$
 and $c\leftarrow1$.
Then
substituting those values in the quadratic formula gives you the roots $1/3$ and $1$.
Difficulties with the quadratic formula
A little problem
The quadratic formula is easy to use but it can still cause pattern recognition problems. Suppose you are asked to find the solutions of $3{{x}^{2}}7=0$. Of course you can do this by simple algebra — but pretend that the first thing you thought of was using the quadratic formula.
 Then you got upset because you have to apply it to $a{{x}^{2}}+bx+c$
 and $3{{x}^{2}}7$ has only two terms
 but $a{{x}^{2}}+bx+c$ has three terms…
 (Help!)
$3{{x}^{2}}7$ as $3{{x}^{2}}+0\cdot x7$, so $a=3$, $b=0$ and $c=7$.
This is an example of the following useful principle:
Write zero cleverly. 
I suspect that most people reading this would not have had the problem with $3{{x}^{2}}7$ that I have just described. But before you get all insulted, remember:
The thing about really easy examples is that they give you the point without getting you lost in some complicated stuff you don’t understand very well. 
A fiendisher problem
Even college students may have trouble with the following problem (I know because I have tried it on them):
What are the solutions of the equation $a+bx+c{{x}^{2}}=0$?
The answer
\[r=\frac{b\pm
\sqrt{{{b}^{2}}4ac}}{2a}\]
is wrong. The correct answer is
\[r=\frac{b\pm
\sqrt{{{b}^{2}}4ac}}{2c}\]
When you remember a pattern with particular letters in it and an example has some of the same letters in it, make sure they match the pattern! 
The substitution rule for integration
The chain rule says that the derivative of a function of the form $f(g(x))$ is $f'(g(x))g'(x)$. From this you get the substitution rule for finding indefinite integrals:
\[\int{f'(g(x))g'(x)\,dx}=f(g(x))+C\]
Example
To find $\int{2x\,\cos
({{x}^{2}})\,dx}$, you recognize that you can take $f(x)=\sin x$and $g(x)={{x}^{2}}$ in the formula, getting \[\int{2x\,\cos ({{x}^{2}})\,dx}=\sin ({{x}^{2}})\] Note that in the way I wrote the integral, the functions occur in the opposite order from the pattern. That kind of thing happens a lot.
Laws and constraints
 The statement “$(x+1)^2=x^2+2x+1$” is a pattern that is true for all numbers $x$. $3^2=2^2+2\times2+1$ and $(2)^2=(1)^2+2\times(1)+1$, and so on. Such a pattern is a universal assertion, so it is a theorem. When the statement is an equation, as in this case, it is also called a law.
 The statement “$\sin x\leq 1$” is also true for all $x$, and so is a theorem.
 The statement “$x^2+(y1)^2$ is at most $5$” is true for some real numbers and not others, so it is not a theorem, although it is a constraint.

The quadratic formula says that:
The solutions of an equation
of the form $a{{x}^{2}}+bx+c=0$ is
given by\[r=\frac{b\pm
\sqrt{{{b}^{2}}4ac}}{2a}\]This is true for all complex numbers $a$, $b$, $c$.
The $x$ in the equation is not a free variable, but a “variable to be solved for” and does not appear in the quadratic formula. Theorems like the quadratic formula are usually called “formulas” rather than “laws”.  The product rule for derivatives
The derivative of $f(x)g(x)$ is $f'(x)\,g(x)+f(x)\,g'(x)$
is true for all differentiable functions $f$ and $g$. That means it is true for both of these choices of $f$ and $g$:
 $f(x)=x$ and $g(x)=x\sin x$
 $f(x)=x^2$ and $g(x)=\sin x$
But both choices of $f$ and $g$ refer to the same function $x^2\sin x$, so if you apply the product rule in either case you should get the same answer. (Try it).
Some bothersome types of pattern recognition
Dependence on conventions
Definition: A quadratic polynomial in $x$is an expression of the form $a{{x}^{2}}+bx+c$.
Examples
 $5{{x}^{2}}+32x5$ is a quadratic polynomial: You have to recognize that it fits the pattern in the definition by writing it as $(5){{x}^{2}}+32x+(5)$
 So is ${{x}^{2}}1$: You have to recognize that it fits the definition by writing it as ${{x}^{2}}+0\cdot x+(1)$ (I wrote zero cleverly).
Some authors would just say, “A quadratic polynomial is an expression of the form $a{{x}^{2}}+bx+c$” leaving you to deduce from conventions on variables that it is a polynomial in $x$ instead of in $a$ (for example).
Note also that I have deliberately not mentioned what sorts of numbers $a$, $b$, $c$ and $x$ are. The authors may assume that you know they are using real numbers.
An expression as an instance of substitution
One particular type of pattern recognition that comes up all the time in math is recognizing that a given expression is an instance of a substitution into a known expression.
Example
Students are sometimes baffled when a proof uses the fact that ${{2}^{n}}+{{2}^{n}}={{2}^{n+1}}$ for positive integers $n$. This requires the recognition of the patterns $x+x=2x$ and $2\cdot
\,{{2}^{n}}={{2}^{n+1}}$.
Similarly ${{3}^{n}}+{{3}^{n}}+{{3}^{n}}={{3}^{n+1}}$.
Example
The assertion
\[{{x}^{2}}+{{y}^{2}}\ge 0\ \ \ \ \ \text{(1)}\]
has as a special case
\[(x^2y^2)^2+(y^2x^2)^2\ge
0\ \ \ \ \ \text{(2)}\]
which involves the substitutions $x\leftarrow {{x}^{2}}{{y}^{2}}$ and $y\leftarrow
{{y}^{2}}{{x}^{2}}$.
Remarks
 If you see (2) in a text and the author blithely says it is “never negative”, that is because it is of the form \[{{x}^{2}}+{{y}^{2}}\ge 0\] with certain expressions substituted for $x$ and $y$. (See substitution and The only axiom for algebra.)
 The fact that there are minus signs in (2) and that $x$ and $y$ play different roles in (1) and in (2) are red herrings. See ratchet effect and variable clash.
 Most people with some experience in algebra would see quickly that (2) is correct by using chunking. They would visualize (2) as
\[(\text{something})^2+(\text{anothersomething})^2\ge0\]
This shows that in many cases
chunking is a psychological inverse to substitution
 Note that when you make these substitutions you have to insert appropriate parentheses (more here). After you make the substitution, the expression of course can be simplified a whole bunch, to
\[2({{x}^{4}}+{{y}^{4}})\ge0\]
 A common cause of error in doing this (a mistake I make sometimes) is to try to substitute and simplify at the same time. If the situation is complicated, it is best to
substitute as literally as possible and then simplify
Integration by Parts
The rule for integration by parts says that
\[\int{f(x)\,g'(x)\,dx=f(x)\,g(x)\int{f'(x)\,g(x)\,dx}}\]
Suppose you need to find $\int{\log x\,dx}$.(In abstractmath.org, “log” means ${{\log }_{e}}$). Then we can recognize this integral as having the pattern for the left side of the parts formula with $f(x)=1$ and $g(x)=\log \,x$. Therefore
\[\int{\log x\,dx=x\log x\int{\frac{1}{x}dx=x\log \,xx+c}}\]
How on earth did I think to recognize $\log x$ as $1\cdot \log x$??
Well, to tell the truth because some nerdy guy (perhaps I should say some other nerdy guy) clued me in when I was taking freshman calculus. Since then I have used this device lots of times without someone telling me — but not the first time.
This is an example of another really useful principle:
Write $1$ cleverly. 
Two different substitutions give the same expression
Some proofs involve recognizing that a symbolic expression or figure fits a pattern in two different ways. This is illustrated by the next two examples. (See also the remark about the product rule above.) I have seen students flummoxed by Example ID, and Example ISO is a proof that is supposed to have flummoxed medieval geometry students.
Example ID
\[xy=e\ \ \ \ \text{and}\ \ \ \ yx=e \ \ \ \ (1)\]
In this situation, it is easy to see that $x$ has only one inverse: If $xy=e$ and $xz=e$ and $yx=e$ and $zx=e$, then \[y=ey=(zx)y=z(xy)=ze=z\]
\[x{{x}^{1}}=e\ \ \ \text{and}\ \ \ {{x}^{1}}x=e \ \ \ \ (2)\]
To prove the theorem, I must show that $x$ is the inverse of ${{x}^{1}}$. Because $x^{1}$ has only one inverse, all we have to do is prove that
\[{{x}^{1}}x=e\ \ \ \text{and}\ \ \ x{{x}^{1}}=e\ \ \ \ (3)\]
But (2) and (3) are equivalent! (“And” is commutative.)
Example ISO
This sort of double substitution occurs in geometry, too.
The point is that although triangles $ABC$ and $ACB$ are the same triangle, and sides $BC$ and $CB$ are the same line segment, the proof involves recognizing them as geometric figures in two different ways.
This proof (not Euclid’s original proof) is hundreds of years old and is called the pons asinorum (bridge of donkeys). It became famous as the first theorem in Euclid’s books that many medieval students could not understand. I conjecture that the name comes from the fact that the triangle as drawn here resembles an ancient arched bridge. These days, isosceles triangles are usually drawn taller than they are wide.
Technical problems in carrying out pattern matching
Parentheses
In matching a pattern you may have to insert parentheses. For example, if you substitute $x+1$ for $a$, $2y$ for
$b$ and $4$ for $c$ in the expression \[{{a}^{2}}+{{b}^{2}}={{c}^{2}}\] you get \[{{(x+1)}^{2}}+4{{y}^{2}}=16\]
If you did the substitution literally without editing the expression so that it had the correct meaning, you would get \[x+{{1}^{2}}+2{{y}^{2}}={{4}^{2}}\] which is not the result of performing the substitution in the expression ${{a}^{2}}+{{b}^{2}}={{c}^{2}}$.
Order switching
You can easily get confused if the patterns involve a switch in the order of the variables.
Notation for integer division
 For integers $m$ and $n$, the phrase “$m$ divides $n$” means there is an integer $q$ for which $n=qm$.
 In number theory (which in spite of its name means the theory of positive integers) the vertical bar is used to denote integer division. So $36$ because $6=2\times 3$ ($q$ is $2$ in this case). But “$37$” is false because there is no integer $q$ for which $7=q\times 3$.
 An equivalent definition of division says that $mn$ if and only if $n/m$ is an integer. Note that $6/3=2$, an integer, but $7/3$ is not an integer.
 Now look at those expressions:
 “$mn$” means that there is an integer $q$ for which $n=qm$.In these two expressions, $m$ and $n$ occur in opposite order.
 “$mn$” is true only if $n/m$ is an integer. Again, they are in opposite order. Another way of writing $n/m$ is $\frac{n}{m}$. When math people pronounce “$\frac{n}{m}$” they usually say, “$n$ over $m$” using the same order.
 “$mn$” is a symbolic assertion: it is either true or false.
 “$n/m$” is a symbolic expression whose value is a number depending on $n$ and $m$.
Math notation gives you no clue which symbols are operators (used to form expressions) and which are verbs (used to form assertions).
References
 Abstractmath article on the grammar of the symbolic language of math (“grammar” includes syntax and semantics.)
 Syntax trees in mathematicians’ brains. Gyre&Gimble post.
 Algebra is a difficult foreign language. Gyre&Gimble post.
 Mathematics and linguistic ability. Gyre&Gimble post.
 Patterns of Proof in abstractmath.org. Textbooks in abstract math generally give proofs without telling you what the pattern of proof is.
 Ratchet effect in abstractmath.org. Contains an example of pattern matching.
 Chronicle of Higher Education article on teaching syntax.
 Wikipedia on the syntax of programming languages.
 Wikipedia’s main article on syntax (nearly useless).
This work is licensed under a Creative Commons AttributionShareAlike 2.5 License.