I'm an undergraduate math major and sometimes I find proofs that seem to use algebraic 'tricks' to reach their conclusions. The 'trick' that I see most often is a change of variable or the use of an obscure identity, and intuitively I have no idea how someone would realize that this is a viable option.
Is there a field of study that concerns itself with 'trick' algebraic operations, or maybe a field of study that explains how to determine if/when a change of variable/identity substitution might be an appropriate technique given a situation?
For a specific example, I'll reference the proof of the equation for the expectation of the power of a Bernoulli random variable. I can't imagine how someone would discover this proof.
We will now examine the properties of a binomial random variable with parameters $n$ and $p$. To begin, let us compute its expected value and variance. Now,
$$\begin{align} E[X^k] &= \sum_{i = 0}^ni^k\binom{n}{i}p^i(1 - p)^{n - i}\\ &= \sum_{i = 1}^ni^k\binom{n}{i}p^i(1 - p)^{n - i} \end{align}$$
Using the identity, $$i\binom{n}{i} = n\binom{n - 1}{i - 1}$$ gives
$$\begin{align} E[X^k] &= np\sum_{i = 1}^ni^{k - 1}\binom{n - 1}{i - 1}p^{i - 1}(1 - p)^{n - i}\\ &= np\sum_{j = 1}^{n - 1}(j + 1)^{k - 1}\binom{n - 1}{j}p^j(1 - p)^{n - 1 - j} && \overset{\text{by letting}}{j = i - 1}\\ &= npE[(Y + 1)^{k - 1}] \end{align}$$