Iteration

Some functional equations involve repeated application of the function, such as

f(f(x)),f(f(x)),
f(f(f(x))),f(f(f(x))),

or even longer chains.

This is called iteration.

Example

Find all functions f:R→Rf:\mathbb R\to\mathbb R such that

f(f(x))=x+2f(f(x))=x+2

and

f(x+2)=f(x)+2f(x+2)=f(x)+2

for all real numbers xx.

The first equation says that applying ff twice increases the input by 22.

If we guess that ff is linear, say

f(x)=ax+b,f(x)=ax+b,

then

f(f(x))=a(ax+b)+b=a2x+ab+b.f(f(x))=a(ax+b)+b=a^2x+ab+b.

We need

a2x+ab+b=x+2.a^2x+ab+b=x+2.

As such

a2=1.a^2=1.

If a=1a=1, then

f(x)=x+b.f(x)=x+b.

Then

f(f(x))=x+2b,f(f(x))=x+2b,

so b=1b=1.

This gives

f(x)=x+1.f(x)=x+1.

If a=−1a=-1, then

f(x)=−x+b.f(x)=-x+b.

Then

f(f(x))=x,f(f(x))=x,

which does not work.

So the natural linear solution is

f(x)=x+1.f(x)=x+1.

Substitution confirms that it satisfies both equations.

Symmetry

Many functional equations contain two variables and remain similar after swapping them.

For example, if an equation holds for all xx and yy, then it also holds after exchanging xx and yy.

Example

Find all functions f:R→Rf:\mathbb R\to\mathbb R such that

f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y)

and

f(xy)=f(x)f(y)f(xy)=f(x)f(y)

for all real numbers xx and yy.

Set y=0y=0 in the first equation:

f(x)=f(x)+f(0),f(x)=f(x)+f(0),

so

f(0)=0.f(0)=0.

Set y=1y=1 in the second equation:

f(x)=f(x)f(1).f(x)=f(x)f(1).

If there exists some xx with f(x)≠0f(x)\neq 0, then

f(1)=1.f(1)=1.

Now set x=y=1x=y=1 in the first equation:

f(2)=f(1)+f(1)=2.f(2)=f(1)+f(1)=2.

Also by repeated addition,

f(n)=nf(n)=n

for all positive integers nn.

This example shows how combining equations and simple substitutions can build information in increments.

A full classification over the real numbers requires more care, but contest problems often include enough restrictions to force the intended solution.

Guess and Verify

In many intermediate problems, the solution is a simple function such as:

f(x)=x,f(x)=x,
f(x)=x+c,f(x)=x+c,
f(x)=cx,f(x)=cx,

or

f(x)=ax+b.f(x)=ax+b.

It is often useful to guess a possible form, substitute it into the equation, and then prove that no other functions work.

Example

Find all linear functions f:R→Rf:\mathbb R\to\mathbb R such that

f(x+y)=f(x)+f(y)+3f(x+y)=f(x)+f(y)+3

for all real numbers xx and yy.

Assume

f(x)=ax+b.f(x)=ax+b.

Then

f(x+y)=a(x+y)+b=ax+ay+b.f(x+y)=a(x+y)+b=ax+ay+b.

On the other hand,

f(x)+f(y)+3=(ax+b)+(ay+b)+3=ax+ay+2b+3.f(x)+f(y)+3=(ax+b)+(ay+b)+3=ax+ay+2b+3.

Thus

b=2b+3.b=2b+3.

So

b=−3.b=-3.

There is no restriction on aa, so all linear solutions are

f(x)=ax−3.f(x)=ax-3.

Substitution confirms that all such functions work.

Worked Examples

Example 1

Find all functions f:R→Rf:\mathbb R\to\mathbb R such that

f(x+y)=f(x)+yf(x+y)=f(x)+y

for all real numbers xx and yy.

Set x=0x=0:

f(y)=f(0)+y.f(y)=f(0)+y.

Let

c=f(0).c=f(0).

Then

f(y)=y+c.f(y)=y+c.

So the only possible functions are

f(x)=x+c.f(x)=x+c.

Substituting back:

f(x+y)=x+y+cf(x+y)=x+y+c

and

f(x)+y=x+c+y.f(x)+y=x+c+y.

They are equal, so every function

f(x)=x+cf(x)=x+c

works.

Example 2

Find all functions f:R→Rf:\mathbb R\to\mathbb R such that

f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y)

and f(1)=3f(1)=3, assuming ff is linear.

Since ff is linear, write

f(x)=ax+b.f(x)=ax+b.

Set x=0x=0 in the functional equation:

f(y)=f(0)+f(y),f(y)=f(0)+f(y),

so

f(0)=0.f(0)=0.

So

b=0.b=0.

Since

f(1)=3,f(1)=3,

we get

a=3.a=3.

Therefore,

f(x)=3x.f(x)=3x.

Substitution confirms that this function works.

Example 3

Find all functions f:R→Rf:\mathbb R\to\mathbb R satisfying

f(f(x))=xf(f(x))=x

and

f(x)+x=0f(x)+x=0

for all real numbers xx.

The second equation gives

f(x)=−x.f(x)=-x.

Now check the first equation:

f(f(x))=f(−x)=x.f(f(x))=f(-x)=x.

So

f(x)=−xf(x)=-x

works.

Example 4

Find all functions f:R→Rf:\mathbb R\to\mathbb R such that

f(xf(y)+x)=xy+f(x)f(xf(y)+x)=xy+f(x)

for all real numbers xx and yy.

Set x=1x=1:

f(f(y)+1)=y+f(1).f(f(y)+1)=y+f(1).

This tells us that ff takes every value of the form y+f(1)y + f(1), which is every real number. So ff is surjective.

It also tells us that ff is injective, if f(a)=f(b)f(a)=f(b), then f(a)+1=f(b)+1f(a)+1=f(b)+1, so f(f(a)+1)=f(f(b)+1)f(f(a)+1)=f(f(b)+1), giving a+f(1)=b+f(1)a+f(1)=b+f(1), hence a=ba=b.

Now set y=0y=0:

f(xf(0)+x)=f(x).f(xf(0)+x)=f(x).

Since ff is injective, we can remove ff from both sides:

xf(0)+x=x.xf(0)+x=x.

For all x≠0x \neq 0, this gives f(0)=0f(0)=0.

Set x=1x=1 again, f(f(y)+1)=y+f(1)f(f(y)+1)=y+f(1). Setting y=0y=0: f(f(0)+1)=f(1)f(f(0)+1)=f(1), so f(1)=f(1)f(1)=f(1), which is consistent.

Now guess f(x)=xf(x)=x. Then f(xf(y)+x)=xy+xf(xf(y)+x)=xy+x and xy+f(x)=xy+xxy+f(x)=xy+x. These match, so f(x)=xf(x)=x is a solution.

To confirm uniqueness, from x=1x=1 we have f(f(y)+1)=y+f(1)f(f(y)+1)=y+f(1). Setting y=−f(1)y=-f(1) gives f(f(−f(1))+1)=0f(f(-f(1))+1)=0, so f(−f(1))+1=0f(-f(1))+1=0 (since ff is injective and f(0)=0f(0)=0), meaning f(−f(1))=−1f(-f(1))=-1. Continuing with specific substitutions, one can show f(1)=1f(1)=1, then f(n)=nf(n)=n for all integers, extend to rationals, and use monotonicity (which follows from the original equation) to conclude f(x)=xf(x)=x for all real xx.

This example combines multiple techniques, one substitution gives surjectivity and injectivity, another uses injectivity to remove ff and find f(0)f(0), and guess and verify is used to complete it.

Key Contest Insight

Functional equations are usually solved by building information gradually.

A typical solution does not usually come from only one substitution. Instead, you collect facts such as:

  • the value of f(0)f(0),
  • whether ff is injective,
  • whether ff is surjective,
  • how ff behaves at special inputs,
  • and whether the equation suggests a linear or constant form.

Once a candidate function is found, always substitute it back into the original equation to verify that it works.

Strategy Tips

  • Start with simple substitutions such as 00, 11, x=yx=y, and y=−xy=-x.
  • Check whether the domain allows your substitution.
  • Try to find f(0)f(0) and f(1)f(1) early.
  • If you see f(A)=f(B)f(A)=f(B), consider proving injectivity.
  • If every value can be written as f(x)f(x), use surjectivity.
  • If the equation contains f(f(x))f(f(x)), think about iteration.
  • If a simple function seems likely, guess it, test it, and then prove it is forced.
  • Always verify all proposed solutions.

Common Pitfalls

  • Substituting values that are not in the domain.
  • Assuming the function is continuous or linear when this is not stated.
  • Proving that a function is possible but forgetting to prove uniqueness.
  • Forgetting to substitute the final answer back into the original equation.
  • Cancelling or applying injectivity before it has been proved.
  • Ignoring constant solutions.

Practice Problems

StatusSourceProblem NameDifficultyTags
Berkeley Math CircleHard
Show TagsFunctional Equations, Induction / smoothing
Berkeley Math Circle: Monthly Contest 7Hard
Show TagsFunctional Equations, Simple Equations
Berkeley Math CircleHard
Show TagsFunctional Equations, Quadratic functions
Berkeley Math CircleHard
Show TagsFunctional Equations, Polynomial operations
Berkeley Math Circle Monthly Contest 3Hard
Show TagsExistential quantifiers, Functional Equations
Berkeley Math Circle Monthly Contest 6Hard
Show TagsFunctional Equations, Recurrence relations
Berkeley Math CircleHard
Show TagsFunctional Equations
Berkeley Math Circle Monthly Contest 1Hard
Show TagsFunctional Equations, Induction / smoothing, Injectivity / surjectivity
Berkeley Math Circle: Monthly Contest 6Hard
Show TagsFunctional Equations, Polynomials, Recurrence relations
Berkeley Math Circle Monthly Contest 4Hard
Show TagsFunctional Equations, Induction / smoothing
Berkeley Math Circle Monthly Contest 8Hard
Show TagsFunctional Equations, Recurrence relations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
HMMT 1998Hard
Show TagsFunctional Equations
Harvard-MIT Math TournamentHard
Show TagsFunctional Equations
Berkeley Math Circle Monthly Contest #1Hard
Show TagsFunctional Equations
Harvard-MIT Math TournamentHard
Show TagsFunctional Equations
USA IMO 2003Hard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations, Linear and quadratic inequalities
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations, Simple Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
1st Annual Harvard-MIT November TournamentHard
Show TagsFunctional Equations
IMO 2008Hard
Show TagsFunctional Equations
11th Annual Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
13th Annual Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations, Polynomial operations
Harvard-MIT November TournamentHard
Show TagsFunctional Equations, Recurrence relations
Harvard-MIT November TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations
Team Selection Test Selection TestHard
Show TagsFunctional Equations
15th Annual Harvard-MIT Mathematics TournamentHard
Show TagsFunctional Equations, Polynomial operations
Harvard-MIT Mathematics TournamentHard
Show TagsExponential functions, Functional Equations, Logarithmic functions
HMICHard
Show TagsFunctional Equations, Injectivity / surjectivity
Berkeley Math Circle Monthly Contest 4Hard
Show TagsFunctional Equations, Induction / smoothing, Polynomial operations, Sums and products
Berkeley Math Circle Monthly Contest 4Hard
Show TagsComplex numbers, Functional Equations, Recurrence relations, Roots of unity
HMMT 2014Hard
Show TagsFunctional Equations, Recursion, bijection
IMO Team Selection Team Selection TestHard
Show TagsFunctional Equations
HMMT November 2014Hard
Show TagsFunctional Equations
HMMT FebruaryHard
Show TagsFactorization techniques, Functional Equations, QM-AM-GM-HM / Power Mean
HMMT November 2015Hard
Show TagsFunctional Equations, Greatest common divisors (gcd), Recurrence relations
HMMT November 2015Hard
Show TagsFunctional Equations, Logarithmic functions
HMMT NovemberHard
Show TagsFunctional Equations, Recurrence relations
Berkeley Math Circle: Monthly Contest 2Hard
Show TagsFunctional Equations
Berkeley Math Circle: Monthly Contest 2Hard
Show TagsFunctional Equations
February 2017Hard
Show TagsFunctional Equations
USA TSTSTHard
Show TagsDivisibility / Factorization, Functional Equations, Polynomials
HMMT November 2019Hard
Show TagsFunctional Equations
HMMT February 2019Hard
Show TagsFunctional Equations
HMMT February 2019Hard
Show TagsFunctional Equations, Recurrence relations
Berkeley Math Circle: Monthly Contest 6Hard
Show TagsFunctional Equations
HMMT February 2019Hard
Show TagsFunctional Equations, Recursion, bijection
Bay Area Mathematical OlympiadHard
Show TagsColoring schemes, extremal arguments, Functional Equations, Invariants / monovariants
USA TSTSTHard
Show TagsFunctional Equations
Berkeley Math Circle: Monthly Contest 5Hard
Show TagsFunctional Equations
HMMT February 2020Hard
Show TagsFunctional Equations
HMMT Spring 2021 Guts RoundHard
Show TagsFunctional Equations, Recurrence relations
USAJMOHard
Show TagsFunctional Equations, Other
HMMT November 2022Hard
Show TagsFunctional Equations
HMMT November 2022Hard
Show TagsFunctional Equations, Sums and products
Berkeley Math CircleHard
Show TagsFunctional Equations, Injectivity / surjectivity
HMMT February 2022Hard
Show TagsFunctional Equations, Symmetric functions
HMIC 2023Hard
Show TagsFunctional Equations, Injectivity / surjectivity
HMMT FebruaryHard
Show TagsFunctional Equations, Polynomial operations, Quadratic functions
HMMT FebruaryHard
Show TagsComplex numbers, Functional Equations, Polynomial operations
HMMT NovemberHard
Show TagsFunctional Equations, Integers
USA TST Selection Test for 67th IMO and 15th EGMOHard
Show TagsExistential quantifiers, Functional Equations
United States of America — TST Selection TestHard
Show TagsFloors and ceilings, Functional Equations, Jensen / smoothing

Module Progress:

Join the Discord Community!

Stuck on a problem, or don't understand a module? Join the Discord and get help with your doubts while making more math friends.