Every mathematician has only a few tricks In Gian-Carlo Rota's "Ten lessons I wish I had been taught" he has a section, "Every mathematician has only a few tricks", where he asserts that even mathematicians like Hilbert have only a few tricks which they use over and over again.
Assuming Rota is correct, what are the few tricks that mathematicians use repeatedly?
 A: My favorite is perhaps the "commutator trick", i.e. "take commutators and see what happens". Some general things that may happen 1) the commutator touches less than the commutatorands 2) the commutator defies your abelian intuition.
I'm mostly familiar with 1) in the context of infinite groups, in particular finding generators for complicated groups, and 2) blew my mind to pieces as Barrington's theorem before I even knew any math.
I counted that a seventh of my papers use some type of commutator trick, but what really sold commutators to me was when I got a Rubik's cube as a christmas present.
A: A very useful generic trick:
If you can't prove it, make it simpler and prove that instead.
An even more useful generic trick:
If you can't prove it, make it more complicated and prove that instead!
A: From a physicist point of view I want to mention this trick and its generalization for operators:
      "Two commuting matrices are simultaneously diagonalizable"

(for physicists all matrices are diagonalizable). Of course the idea is that if you know the eigenvectors of one matrix/operator then diagonalizing the other one is much easier. Here are some applications.
1)The system is translation invariant : Because the eigenvectors of the translation operator are $e^{ik.x}$, then one should use the Fourier transform.  It solves all the wave equations for light, acoustics, of free quantum electrons or the heat equation in homogeneous media.
2)The system has a discrete translation symmetry: The typical system is the atoms in a solid state that form a crystal. We have a discrete translation operator $T_a\phi(x)=\phi(x+a)$ with $a$ the size of the lattice and then we should try $\phi_k(x+a)=e^{ik.a}\phi_k(x)$ as it is an eigenvector of $T_a$. This gives the  Bloch-Floquet theory where the spectrum is divided into band structure. It is one of the most famous model of condensed matter as it explains the different between conductors or insulators.
3)The system is rotational invariant: One should then use and diagonalize the rotation operator first. This will allow us to find the eigenvalue/eigenvectors of the Hydrogen atom. By the way we notice the eigenspace of the Hydrogen are stable by rotation and are therefore finite dimension representations of $SO(3)$. The irreducible representations of $SO(3)$ have dimension 1,3,5,... and they appears, considering also the spin of the electron, as the columns of the periodic table of the elements (2,6,10,14,...).
4)$SU(3)$ symmetry: Particle physics is extremely complicated. However physicists have discovered that there is an underlying $SU(3)$ symmetry. Then considering the representations of $SU(3)$ the zoology of particles seems much more organized (A, B).
A: Terence Tao wrote a paper, Exploring the toolkit of Jean Bourgain. The abstract reads:

Gian-Carlo Rota once asserted that "every mathematician only has a few tricks". The sheer breadth and ingenuity in the work of Jean Bourgain may at first glance appear to be a counterexample to this maxim. However, as we hope to illustrate in this article, even Bourgain relied frequently on a core set of tools, which formed the base from which problems in many disparate mathematical fields could then be attacked. We discuss a selected number of these tools here, and then perform a case study of how an argument in one of Bourgain's papers can be interpreted as a sequential application of several of these tools.

A: In combinatorics: shove it into OEIS, and see what's up.
Also, add more parameters!
Note: the Macdonald polynomials were introduced by adding more parameters to the Jack and the Hall-Littlewood polynomials.
The introduction of Macdonald polynomials unified a lot of cool stuff,
and they are now essential in the field of Diagonal harmonics.
A: Dennis Sullivan used to joke that Mikhail Gromov only knows one thing, the triangle inequality. I would argue that many mathematicians know the triangle inequality but not many are Gromov.
A: I went through all the responses, and I'm surprised that the following trick has not already been posted, given its ubiquity: Use antisymmetry in a partially ordered set. That is, if $a\le b$ and $b\le a$ then $a=b.$
Examples:

*

*Real numbers: $a\le b$ and $b\le a$ implies $a=b$ (can be helpful when directly showing equality is difficult)

*Divisibility of positive integers: $a\mid b$ and $b\mid a$ implies $a=b$ (extremely common in number theory)

*Subsets of a set: $a\subseteq b$ and $b\subseteq a$ implies $a=b$ (for example, in locus proofs of classical geometry)

A: Integration by parts has allegedly earned some people big medals.
A: Find something that can be computed (a special case, a simplification, or just something of the same flavor as the real problem). Then stare at the data and look for patterns.
A: For a finite set of real numbers, the maximum is at least the average and the minimum is at most the average.
Of course this is just the real version of the Pigeonhole Principle, but Dijkstra had an eloquent argument as to why the usual version is inferior.
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD10xx/EWD1094.html
A: Although Erdős was mentioned in the comments as perhaps having prompted this whole discussion, I'm surprised not to see the basic trick of "try a random object/construction" posted as an answer, which he used so often to such great success.
A: This trick is called “stupid argument” by some of my collaborators and me.
Let’s say you have a property that is defined on testing using cubes on all scales. Now you have some regular set (say again a cube or a ball) in which the property holds, that is, if you test with a cube that is contained in this regular set then it holds. You might come in this situation for example by local transformation of sets with this property, like flattening the boundary in PDE. Now to get it for all cubes you make the following case distinction: if the concentric cube of half the size is contained in the regular set, you use your assumption. Otherwise, the original cube contains a cube of 1/4 side length compared to the original one that is completely outside the regular set and for this one you get the property usually trivially.
Since this is a trick, I kept it somehow mysterious. Applicability includes things like measure theoretic dimensions, metric properties like porousity and so on and the exact details why it’s trivial “outside” and why testing with comparably smaller objects is ok depends a bit on the specific property one aims for.
A: The Fundamental Theorem of Calculus, that is
$$\int_0^1 \frac{d}{dt} \psi_t dt =\psi_1 - \psi_0.$$ This    "trick" is used throughout differential topology/geometry, for example in showing that the de-Rham cohomology is invariant or for a uniform bound on the period of a negative gradient flow line of the Rabinowitz action functional in constructing Rabinowitz--Floer homology. Actually, the trick consists of cleverly bringing the statement in question down to the form where one can apply the fundamnetal theorem of calculus. Also, in Floer theory in general, Ascoli's theorem (or Arzelà-Ascolis theorem) is used in an exceeding amount.
A: If an integer-valued function is continuous, it has to be constant.
This trick shows up in many places, such as the proof Rouché's theorem, and basic results about the Fredholm index.
A: Whenever you find yourself trying to implement inclusion–exclusion by hand ... stop immediately and start over using the Möbius $\mu$-function.
A: There is but one major trick, and furthermore, many of the other answers are applications of it. Let's call it

T R A N S L A T I O N

The idea is very simple; you translate your problem to a language in which it is simple to solve, so you solve it, and then (if necessary) translate your solution back to the original language. Alternatively, you can think of this as finding the right angle of attack to solve your problem.

*

*Conjugation? Say $W$ is a sequence of Rubik moves that twists two corners. Find moves $V$ that puts the corners you want to twist in the correct position. The n simply apply $VWV^{-1}$.

*Change of variables? Translate your integral in $x$ to an integral in $u$ (with translated differential and bounds of course). Find the antiderivative as a function of $u$, and translate back to a function of $x$ (or evaluate if definite).

*Diagonalization? Find an eigenbase (essentially a convenient language to understand your matrix). Change basis by conjugation, and your matrix action suddenly looks much simpler.

*Analytic geometry? Translate your geometric problem to convenient algebraic manipulations.

*etc.

A: If a function with connected domain is locally constant, then it is constant.
Connectedness doesn't need to be understood topologically: one manifestation of the trick is that a sequence whose consecutive terms are equal must be constant.
If the domain is nice enough, it extends to periodic functions as well (a locally periodic function has the same periodic pattern everywhere).
A: Using some form of Yoneda's Lemma, see your particular structure as representable functor in an abstract category where your desired constructions are obvious.
This functorial point of view is very nice in algebraic geometry.
A: John Allen Paulos has referred to the parable of the Texas sharpshooter a number of times.  To paraphrase:

A man driving across the US notices that in a west Texas town, there are a lot of barns with targets painted on their side.  Each of the targets have bulletholes directly within the bullseye.  Impressed, the man inquires in a local diner about the ace shooter who lives in the town.  The townsfolk inform him that a local resident just likes to shoot randomly at barns, and then later on will paint the target right where the bullets land!

Although parable is often referred to as a fallacy of logical reasoning, there appears to be more of a mathematical trick to the logic - namely, conditioning on a random event may be fruitful, even if the probability of the specific random event is low.
This Texas sharpshooter parable to me seems similar to, for example, the post-selection tricks of scatter-shot boson sampling and variants used in recent (2020) experiments.  Therein one has limited control over the generation of individual photons, so one merely post-selects on the particular $M$ crystals that generated the photons.
A: Those of us who are old enough may remember http://www.tricki.org/
Localize + complete, taking a hypersurface section, and using the socle are useful tricks in commutative algebra.
A: Hölder's inequality
and the special cases, Cauchy-Buniakovski-Schwarz
A: Not sure if...
well, what the...
Find a duality. Play duals against each other.
A: I couldn't resist adding one of my own: "Apply linearity of expectation".
For example in Barbier's incredibly elegant approach (Buffon's Noodle) to Buffon's Needle Problem.
A: What worked very well for the French school of algebraic geometry (but it seems to predate them!) is the "French trick" of turning a theorem into a definition. See e.g. this post for some examples and background on the term.
A: If $1-x$ is invertible, then its inverse is $1 + x + x^2 + \cdots $. This is the second most useful "trick" I know, after "look for the [symmetric] group acting on you thing", but someone else already mentioned it.
A: If $r,s $ are elements of a ring, then $1-rs$ invertible implies  $1-sr$ is invertible (and it is a trick: you can make an educated guess for the  formula for the inverse of $1-sr$ from that for $1-rs$). This can be used to find quick proofs of: (a) in a Banach algebra, ${\rm spec\ } rs \cup \{0\} = {\rm spec}\ sr \cup \{0\}$ (which in turn yields the nonsolvability of $xy-yx = 1$---all one needs is boundedness and nonemptiness of the spectrum); (b) the Jacobson radical (defined as the intersection of all maximal right ideals) is a two-sided ideal; and probably some other things I can't think of right now ...
A: In the course of working with Hervé Jacquet and reading many of his papers on automorphic forms and the relative trace formula, I feel like he got an amazing amount of mileage out of clever use of change of variables.
I remember a conference where all the speakers gave extremely hard-to-follow talks using very sophisticated machinery, and then Jacquet gave a talk with a very nice result and about 45 minutes of it was going through an elementary proof (once you knew the setup) that boiled down to a clever sequence of change of variables.
A: Two come to mind for me.

*

*"When in doubt, differentiate!" -Chern (or so I've heard).
As a result, it's been useful for me to check the implications of $d^2=0$ on differential forms.


*I have not used it in research (I have moved away from analysis somewhat),  but I love trying to use Jensen's inequality when I come across an analysis problem. If I recall correctly, I solved two problems on my analysis prelim exam using said inequality.
A: Proof "tricks" that are routinely used by many:

*

*Induction

*Contradiction

Computational and proof "tricks":

*

*Interchanging the order of summation/integration

*Counting the same thing in multiple ways

*Looking for patterns (compute special cases, etc.)

Less applicable to as many problems, but still applicable to a wide range of problems in fields like Computer Science, we have the Repertoire Method.
More specialized in mathematics, there are also various methods related to exponential sums, e.g., van der Corput's, Vinogradov's, etc.
A: Geometrise!
It worked well for Newton in his Principia when he didn't think that mathematicians would swallow the results he had found for calculus.
For Lie, when he considered PDEs and their solutions.
It worked well for Minkowski when he geometrised Special realtivity and this was helpful for Einsteins work on GR; although he has said that he didn't think of his theory as geometrical, he thought of physically as a unification of inertia and gravity.
Also for Noether when left a note about Betti numbers were better understood as groups and also lectured on them.
It also worked well for Zariski and Grothendieck when they geometrised lots of number theory.
Also Mechanise!
It worked for Archimedes when calculating various volumes.
It also worked for Witten, when he given a problem by Atiyah when he asked Witten to discover a physical understanding of the HOMFLY knot invariant.
A: Taylor expansion. Much of the classical theory of statistics (and some of its modern extensions) revolves around performing a second-order Taylor expansion of the likelihood.
A: Maybe more than a "trick," but if you want to investigate a sequence
$a_0,a_1,\dots$, then look at a generating function such as $\sum
a_nx^n$ or $\sum a_n\frac{x^n}{n!}$. If you are interested in a
function $f:\mathrm{Par}\to R$, where $R$ is a commutative ring and
$\mathrm{Par}$ is the set of all partitions $\lambda$ of all integers
$n\geq 0$, then look at a generating function $\sum_\lambda
f(\lambda) N_\lambda b_\lambda$, where $\{b_\lambda\}$ is one of the standard
bases for symmetric functions and $N_\lambda$ is a normalizing factor
(analogous to $1/n!$). For instance, if $f^\lambda$ is the
number of standard Young tableaux of shape $\lambda$, then
$\sum_\lambda f^\lambda s_\lambda = 1/(1-s_1)$, where $s_\lambda$ is a
Schur function. If $f(\lambda)$ is the number of square roots
of a permutation $\lambda\in\mathfrak{S}_n$ of cycle type $\lambda$,
then
$$ \sum_\lambda f(\lambda)z_\lambda^{-1} p_\lambda = \sum_\lambda
  s_\lambda = \frac{1}{\prod_i (1-x_i)\cdot \prod_{i<j} (1-x_ix_j)},
  $$
where $p_\lambda$ is a power sum symmetric function and
$z_\lambda^{-1}$ is a standard normalizing factor.
A: The Renormalization Group trick:
Suppose you have some object $v_0$ and you want to understand a feature $Z(v_0)$ of that object. First identify $v_0$ as some element of a set $E$ of similar objects. Suppose one can extend the definition of $Z$ to all objects $v\in E$. If $Z(v_0)$ is too difficult to address directly, the renormalization group approach consists in finding a transformation $RG:E\rightarrow E$ which satisfies $\forall v\in E, Z(RG(v))=Z(v)$, namely, which preserves the feature of interest. If one is lucky, after infinite iteration $RG^n(v_0)$ will converge to a fixed point $v_{\ast}$ of $RG$ where $Z(v_{\ast})$ is easy to compute.
Example 1: (due to Landen and Gauss)
Let $E=(0,\infty)\times(0,\infty)$ and for $v=(a,b)\in E$ suppose the "feature of interest" is the value of the integral
$$
Z(v)=\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{\sqrt{a^2\cos^2\theta+b^2\sin^2\theta}}\ .
$$
A good transformation one can use is $RG(a,b):=\left(\frac{a+b}{2},\sqrt{ab}\right)$.
Example 2: $E$ is the set of probability laws of real-valued random variables say $X$ which are centered and with variance equal to $1$. The feature of interest is the limit law of $\frac{X_1+\cdots+ X_n}{\sqrt{n}}$ when $n\rightarrow\infty$. Here the $X_i$ are independent copies of the original random variable $X$.
A good transformation here is $RG({\rm law\ of\ }X):={\rm law\ of\ }\frac{X_1+X_2}{\sqrt{2}}$.
A: Andre Weil's slogan that where there is a difficulty, look for the group (that unravels it).
I take this to mean something more aggressive than a truism to note and use group structure; more like "exploit the full potential of representation theory in all its manifestations after seeking out whatever obvious and hidden symmetries exist in the problem".
A: The chapter ‘A Different Box Of Tools’ of Surely You're Joking, Mr Feynman was named for a particular trick Richard Feymnan used:

[Calculus For The Practical Man] showed how to differentiate parameters under the integral sign — it's a certain operation.  It turns out that's not taught very much in the universities; they don't emphasise it.  But I caught on how to use that method, and I used that one damn tool again and again.

(pp.86–87)
A: (1) Double-counting, which can also be described as counting the same thing in two ways. Very useful, and at least as powerful as interchanging summation order.
(2) Induction. When there is a natural number size parameter, one can always consider trying this.
(3) Extremal principle, which is ultimately based on induction, but looks very different. For example, the Sylvester-Gallai theorem has an extremely simple proof using this.
A: Existence as a property: You want to find an object that solves a given equation or a given problem. Generalize what you mean by object so that existence becomes easy or at least tractable. Being an object is now a possible property you might prove about your generalized object.
Having already something you can prove properties about is often both mathematically and psychologically easier than searching in the void.
Some examples:

*

*Algebraic closures: In your original field, you don't know whether your polynomial has zeros, but in the algebraic closure it does. If you can show that it is Galois invariant, then it is actually in the original field. (Given that complex numbers are an algebraic closure (though unknown at the time of their conception), this is maybe the most classical of these examples.)

*Representability of moduli problems: Often it is hard to show that a moduli problem is representable by a quasi-projective variety. This is what lead Weil to define general varieties so that he could represent a moduli problem. If your moduli problem does not have automorphisms and you can produce an ample line bundle, you can show afterwards that it is actually represented by a quasi-projective variety.

*Partial differential equations: Often it is much easier to find generalized solutions (Sobolev functions or a distribution). Then the existence of a classical solution is a regularity property of you generalized solution.

A: A common trick is compactification. First prove that a space admits a compactification, e.g.

*

*Gromov's compactness theorem for manifolds with positive Ricci curvature and bounded diameter

*Gromov's compactness theorem for pseudoholomorphic curves

*the integers with the profinite topology has compactification the profinite integers $\hat{\mathbb{Z}}$

*The space of hyperbolic 3-manifolds with basepoints in the thick part with respect to the Gromov-Hausdorff topology is compact

*Geometrically finite Kleinian groups maybe be compactified (sometimes) by adjoining the domain of discontinuity (the conformal compactification)

*the space of curves on a surface compactifies to projective measured lamination space

*The space of probability measures on a compact space is compact with respect to weak* convergence (I guess this is not a compactification, but really a proof of compactness in the right topology)

*Surfaces in $R^3$ with bounded area and fixed boundary may be compactified by the space of integral currents with the flat distance.
Once one has a compact space, one can analyze the objects one is interested in by taking infinite sequences, extracting a subsequence in the limit, and analyzing this limit, sometimes obtaining a contradiction if the limit does not lie in the original space one was considering. E.g. I used this approach to analyze exceptional Dehn fillings of cusped hyperbolic 3-manifolds.
A: There's the quote in Bell's Men of Mathematics attributed to Jacobi: "You must always invert", as Jacobi said when asked the secret of his mathematical discoveries. Sounds apocryphal but it is certainly a nice suggestion.
A: In homotopy theory: if something is hard to compute, build an infinite tower that converges to it and induct your way up the tower. This includes spectral sequences, Postnikov towers, and Goodwillie calculus.
In category theory: apply Yoneda's Lemma.
Other common tricks in category theory:

*

*Swap the order of colimits.

*Embed into a presheaf category (e.g., Giraud's Theorem).

*Reduce to the case of representable functors.

In an old mathoverflow answer, I wrote several more common tricks in category theory, including

*

*Localization: shifting view so that two objects you previously viewed as different are now viewed as the same.

*Replacing an object by one which is easier to work with but has the same fundamental properties you are trying to study.

*Mapping an object to a small bit of information about the object. Showing that two are different because they differ on this bit.

A: $$
\sum_{i=1}^m\sum_{j=1}^n a_{i,j}=\sum_{j=1}^n\sum_{i=1}^m a_{i,j}
$$
(and its variants for other measure spaces).
I still get misty-eyed whenever I read something that capitalizes on this trick in an unpredictable way.
A: The second derivative test (i.e. "a smooth function has a local maximum at a critical point with non-positive second derivative.") is endlessly useful.
When you first see this fact in Calculus, it might not seem so powerful. However, there are countless generalizations (e.g. the maximum principle for elliptic and parabolic PDEs), which play an important role in analysis.
A: Scott Aaronson has taken a stab at articulating his own methodology for upper-bounding the probability of something bad.  He was inspired by a blog post by Scott Alexander bemoaning how rarely experts write down their expert knowledge in detail.
A: If, on a probability space, $\int_\Omega X\,dP = x$, then there is some $\omega$ such that $X(\omega)\ge x$.
A: A closed discrete subset of a compact space is finite!
A: Let $\mathcal{M}$ be the set of all mathematicians of all times. When you write:

Assuming Rota is correct, what are the few tricks that mathematicians use repeatedly,

it seems that you interpreted Rota's words as follows:

There is a set of tricks  $\mathcal{T}$, with $|\mathcal{T}|\ll 10^{10}$, such that every $m\in\mathcal{M}$ uses only tricks from $\mathcal{T}$,

when in fact he meant:

For every $m\in\mathcal{M}$, there is a set of tricks $\mathcal{T}_m$, with $|\mathcal{T}_m|\ll 10^{10}$, such that $m$ uses only tricks from $\mathcal{T}_m$.

Therefore, you should first specify $m$ to get a description of $\mathcal{T}_m$. Most of the posted answers address indeed this kind of question after having selected a suitable subset $S\subset \mathcal{M}$.
