PATTERN RECOGNITION
Abstract patterns
When you do math, you must recognize abstract patterns that occur in
- Symbolic expressions
- Geometric figures
- 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.
Some examples of pattern recognition
Most of the examples in this article concern patterns in symbolic expressions rather than in geometric figures. In my experience, that is where most pattern recognition problems occur when students are beginning abstract math courses.
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\]
This example is revisited below.
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}})+C\] 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.
Patterns in definitions
A definition generally provides a pattern that you can use to verify something fits the definition, and even more important, it can be used in proofs.
Definition of "quadratic function"
Definition: A quadratic polynomial in $x$ is an expression of the form $a{{x}^{2}}+bx+c$ with $a\neq 0$.
Examples
- $-5{{x}^{2}}+32x-5$ 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 ${1\cdot {x}^{2}}+0\cdot x+(-1)$.
- So is $3x(x-2)+4$: Use the distributive law to rewrite this as \[3x^2-6x+4=3x^2+(-6)x+4\]
Dependence on conventions
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. In texts for undergraduates, the authors may assume that you know they are using real numbers, but in fact the definition works for complex numbers as well.
Definition of "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$.
- "$x^2+(y-1)^2$ is at most $5$" means that
$x^2+(y-1)^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 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}}-2x-1=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\leftarrow-2$
- and $c\leftarrow-1$.
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!)
- Do Not Be Anguished: Force the expression to fit the definition of quadratic function:
- Write $3{{x}^{2}}-7$ as $3{{x}^{2}}+0\cdot x-7$, so $a=3$, $b=0$ and $c=-7$.
- Then put those values into the quadratic formula and you get $x=\pm \sqrt{\frac{7}{3}}$.
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! |
Some bothersome types of pattern recognition
Reverse recognition
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
The product rule means that the integral of \[f'(x)g(x)+f(x)g'(x)\] is $f(x)g(x)+C$. This is useful -- you can immediately determine that\[\int 2x\sin x+x^2\cos x\,dx=x^2\sin x+C\] You know that the derivative of $x^2$ is $2x$ and the derivative of $\sin x$ is $\cos x$, so the left side fits the chain rule.
This is the sort of pattern recognition that can occur after a delay, resulting in slapping your head and saying, "But that's obvious -- why didn't I see that before!?" See ratchet effect and don't feel bad. That happens to mathematicians all the time.
Pattern recognition often occurs
after you quit thinking about the problem
and then come back to it.
This particularly happens if you take time out for a short time and get some exercise, but it also occurs overnight -- even in the middle of the night. Try it!
More viscious version of the example
Reverse recognition may require transforming what you are looking at. Consider \[\int 2x(\sin x+0.5x\cos x)\,dx\]
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}}$.
This example induces the ratchet effect in many students.
Example
The assertion
\[{{x}^{2}}+{{y}^{2}}\ge 0\ \ \ \ \ \text{(1)}\]
has as a special case
\[(-x^2-y^2)^2+(y^2-x^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 never, 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 also ratchet effect.
- 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
Example
The rule for integration by parts says that
\[\int{f(x)\,g'(x)\,dx=f(x)\,g(x)-\int{f'(x)\,g(x)\,dx}}\]
\[\begin{equation}\begin{split}\int{f(x)\,g'(x)\,dx=f(x)\,g(x)-\int{f'(x)\,g(x)\,dx}}\end{split}\end{equation}\]
Suppose you need to find $\int{\log x\,dx}$. s(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)=\log x$ and $g(x)=x$. (Then $f'(x)=\frac{1}{x}$ and $g'(x)=1$.) Therefore \[\begin{equation}\begin{split}\int{\log x}\, dx&= \int{1\cdot\log x}\, dx\\ &=x\log x-\int{x\frac{1}{x}}\, dx\\ &= x\log x-\int{1}\, dx\\ &=x\log x-x+C\end{split}\end{equation}\]
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. 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.
The triangle $ACB$ with labels is actually the same triangle as $ABC$ with labels by flipping $ABC$ over the vertical line through $B$.
This theorem 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.
Note that the calculation in the example of integration by parts to find the integral of $\log, x$ involves reversing the order of the items being substituted.
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 $3\,|\,6$ because $6=2\times 3$ ($q$ is $2$ in this case). But "$3\,|\,7$" is false because there is no integer $q$ for which $7=q\times 3$.
- An equivalent definition of division says that $m\,|\,n$ 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:
- "$m\,|\,n$" means that there is an integer $q$ for which $n=qm$.In these two expressions, $m$ and $n$ occur in opposite order.
- "$m\,|\,n$" 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.
- I taught these notation in courses for computer engineering and math majors for years. Some of the students stayed hopelessly confused through several lectures and lost points repeatedly on homework and exams by getting these symbols wrong.
Syntax
The problems with integer division mentioned in the previous section is not helped by the fact that "$|$" and "$/$" are similar but have very different syntax:
- "$m\,|\,n$" 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).
- A majority of the students didn't have so much trouble with this kind of syntax. I have noticed that many people have no sense of syntax and other people have good intuitive understanding of syntax. I suspect the second type of people find learning foreign languages easy.
- Many of the articles in the references below concern syntax.
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.
- Pattern recognition and me. 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).