Functions, Exponents & Logarithms

Composition, inverses and iteration, functional equations, floor and fractional part, exponent and logarithm laws with domain checks, comparing huge numbers, and graph transformations.

≈2–4 problems per paper10 lessons6 worked examples30 practice problems3 videos

On the AMC 12 this topic appears in roughly two to four problems per paper, and it covers the full difficulty range. Early problems (#5–10) test direct evaluation of compositions, exponent and logarithm laws, and floor sums. Middle problems (#11–20) combine two ideas, such as a logarithmic equation with a domain check, a floor count over blocks, or an iteration with a period. The hardest problems (#21–25) are functional equations whose solutions need a clever substitution, or comparisons of very large numbers that reduce to a monotonicity argument about ln⁡xx\frac{\ln x}{x}.

Study in a deliberate order. First make the exponent and logarithm laws automatic, since almost every later problem rewrites terms in one base or one logarithm base. Then learn the three reduction moves that recur throughout the topic: substitute t=axt=a^{x} for exponential equations, change logarithms to a single base, and replace floor sums by block counts. Build domain checking into your routine for logarithm problems, not as a last step.

Problems here are easy to set up and easy to get wrong, so verify each answer by substituting it back into the original statement. This is the cheapest way to catch the traps covered in each lesson, and it is the habit that separates a correct score from a near miss on the contest.

Helpful first: Algebraic Manipulation

1.Composition and inverses

A function is a rule that assigns each input exactly one output, and composition chains two rules: (f∘g)(x)=f(g(x))(f\circ g)(x)=f(g(x)). The first thing to notice is that order matters. Applying gg first and then ff is almost never the same as applying them in the other order. With f(x)=x+3f(x)=x+3 and g(x)=x2g(x)=x^2, we get f(g(x))=x2+3f(g(x))=x^2+3 but g(f(x))=(x+3)2g(f(x))=(x+3)^2, and these already disagree at x=0x=0.

To evaluate a composition, work from the inside out. Evaluate the innermost function at the given input, then feed that number into the next function. Many contest errors come from computing f(2)f(2) when the problem asks for f(g(2))f(g(2)). A clean habit is to write the intermediate value on scratch paper, such as g(2)=5g(2)=5, before applying ff to it.

A function ff has an inverse exactly when it is one-to-one on its domain, meaning distinct inputs always give distinct outputs (the horizontal line test). The defining property is f−1(f(x))=xf^{-1}(f(x))=x and f(f−1(y))=yf(f^{-1}(y))=y. In practice you rarely need a formula for f−1f^{-1}. To compute f−1(c)f^{-1}(c), solve f(x)=cf(x)=c for xx; the solution is f−1(c)f^{-1}(c). This turns an inverse question into an ordinary equation, which is the most useful fact in the lesson.

Why does this work? If ff is one-to-one and f(a)=cf(a)=c, then aa is the only input with output cc, so sending cc back to aa is a well-defined rule, and that rule is f−1f^{-1}. Two consequences follow. First, (f∘g)−1=g−1∘f−1(f\circ g)^{-1}=g^{-1}\circ f^{-1}: the order reverses, like taking off socks after shoes. Second, if f(x)=ax+bf(x)=ax+b with a≠0a\neq 0, then f−1(y)=y−baf^{-1}(y)=\frac{y-b}{a}, which you can confirm by composing: f ⁣(y−ba)=yf\!\left(\frac{y-b}{a}\right)=y.

Injectivity is the hidden hypothesis. The map x↦x2x\mapsto x^2 has no inverse on all of R\mathbb{R} because 22 and −2-2 both map to 44. A composition can therefore fail to be invertible even when both pieces are nice, and you must check one-to-one-ness on the domain you are actually using before writing f−1f^{-1} or (f∘g)−1(f\circ g)^{-1}.

KEY FACTS
  • (f∘g)(x)=f(g(x))(f\circ g)(x)=f(g(x)): evaluate the inner function first
  • f−1(c)=af^{-1}(c)=a exactly when f(a)=cf(a)=c, provided ff is one-to-one
  • (f∘g)−1=g−1∘f−1(f\circ g)^{-1}=g^{-1}\circ f^{-1}
  • If f(x)=ax+bf(x)=ax+b, then f−1(y)=y−baf^{-1}(y)=\dfrac{y-b}{a}

Spot it: The problem nests one function inside another, or asks for f−1(c)f^{-1}(c) where ff has no convenient closed-form inverse.

COMMON MISTAKES
  • Evaluating the outer function first, so f(g(2))f(g(2)) is treated as g(f(2))g(f(2))
  • Reporting f−1(c)f^{-1}(c) as 1/f(c)1/f(c) instead of the input that produces cc
TRY IT

Let f(x)=2x+3f(x)=2x+3 and g(x)=x2−1g(x)=x^2-1. Find the sum of all real xx satisfying f(g(x))=g(f(x))f(g(x))=g(f(x)).

Practise this lesson (3 problems) →

2.Iteration, fixed points and periodicity

Iterating a function means applying it repeatedly: f2(x)=f(f(x))f^{2}(x)=f(f(x)), f3(x)=f(f(f(x)))f^{3}(x)=f(f(f(x))), and in general fnf^{n} is the nn-fold composition. This is not the nnth power of f(x)f(x); the superscript counts compositions, and context usually makes this clear. Iteration questions typically ask for fn(x0)f^{n}(x_0) with nn huge, and the trick is almost never to carry out nn steps.

The key object is the orbit of a starting point: x0, x1=f(x0), x2=f(x1),…x_0,\ x_1=f(x_0),\ x_2=f(x_1),\dots. Compute terms until a value repeats. If xj=xkx_j=x_k for some j<kj<k, then the sequence is periodic from index jj on, with period p=k−jp=k-j. Once you know the period, xnx_n depends only on nn modulo pp, which reduces f2024f^{2024} to a computation with at most pp steps.

Why does periodicity follow? Because ff is a function, the next term is determined by the current term alone. If xj=xkx_j=x_k, applying the same function to equal inputs gives xj+t=xk+tx_{j+t}=x_{k+t} for every t≥0t\ge 0, by induction. That single fact is what makes orbits predictable: once a value recurs, the entire future repeats.

A fixed point is a value with f(a)=af(a)=a, and it is a period-11 point. A point of period 22 satisfies f(f(a))=af(f(a))=a but f(a)≠af(a)\neq a. So the equation f2(x)=xf^{2}(x)=x always contains the fixed points of ff, and the genuinely new solutions are the period-22 points. Factoring out the fixed-point solutions is the standard way to count solutions of fk(x)=xf^{k}(x)=x.

Not every orbit repeats. For f(x)=2xf(x)=2x we have fn(x)=2nxf^{n}(x)=2^{n}x, which grows without bound, and such questions are about growth and exponent laws instead. Whenever a period pp exists, fpf^{p} fixes every point of the orbit, so fn=f n mod pf^{n}=f^{\,n \bmod p} on that orbit. This is the algebraic content of the modular reduction, and it is the form in which the idea is used on the exam.

KEY FACTS
  • fnf^{n} denotes the nn-fold composition of ff, not the nnth power of f(x)f(x)
  • If xj=xkx_j=x_k with j<kj<k, the orbit is periodic with period k−jk-j
  • Fixed points satisfy f(a)=af(a)=a, and they also satisfy f2(a)=af^{2}(a)=a
  • On a pp-cycle, fn(x0)=f r(x0)f^{n}(x_0)=f^{\,r}(x_0) where r≡n(modp)r\equiv n \pmod p

Spot it: A problem asks for fnf^{n} with a large nn, or for solutions of fk(x)=xf^{k}(x)=x.

COMMON MISTAKES
  • Reading fn(x)f^{n}(x) as (f(x))n(f(x))^{n} and then computing a power instead of iterating
  • Stopping the orbit too early and assuming a cycle has length 22 when it is longer
TRY IT

Let f(x)=1−1xf(x)=1-\dfrac{1}{x}. Find f100(2)f^{100}(2), where fnf^{n} is the nn-fold composition.

Practise this lesson (4 problems) →

3.Functional equations: special values and symmetry

A functional equation determines a function from a relation it must satisfy for every input, such as f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y). Unlike a single equation in one unknown, it gives infinitely many constraints at once, and the strategy is to choose inputs that make the relation simple. The first step is almost always to substitute special values such as x=0x=0, x=1x=1, x=−1x=-1, or a reciprocal.

Special values often reveal structure immediately. Setting x=y=0x=y=0 in f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y) gives f(0)=2f(0)f(0)=2f(0), so f(0)=0f(0)=0. If the relation mentions both f(x)f(x) and f(1/x)f(1/x), then substituting 1/x1/x for xx produces a second equation in the same two unknowns. Two equations in two unknowns can be solved by elimination, exactly as in linear algebra.

The symmetry trick is the central idea. Suppose f(x)+2f ⁣(1x)=3xf(x)+2f\!\left(\frac1x\right)=3x for all x≠0x\neq 0. Replacing xx by 1x\frac1x gives f ⁣(1x)+2f(x)=3xf\!\left(\frac1x\right)+2f(x)=\frac3x. Multiply this second equation by 22 and subtract the first: 3f(x)=6x−3x3f(x)=\frac6x-3x, so f(x)=2x−xf(x)=\frac2x-x. Substituting back checks the answer, and the check is not optional, because some functional equations have no solution, and an inconsistent system shows up as a contradiction.

Why does elimination work? Each substitution yields a valid identity, because the relation holds at every input. Following the substitution map through its orbit (for x↦1xx\mapsto \frac1x the orbit has length 22, and for x↦11−xx\mapsto\frac{1}{1-x} it has length 33) produces one linear equation per point of the orbit. The values of ff on the orbit are the unknowns, and the determinant of the system decides whether the answer is unique.

Domains need the same care as in any algebra problem. The relation f(x)+2f(1/x)=3xf(x)+2f(1/x)=3x only makes sense for x≠0x\neq 0, so a substitution that sends xx to 00 is forbidden. Likewise, substituting 1−x1-x is valid only if the relation holds at 1−x1-x. Record the domain of every substitution, because an answer derived from an invalid substitution is not an answer.

KEY FACTS
  • Setting x=y=0x=y=0 in f(x+y)=f(x)+f(y)f(x+y)=f(x)+f(y) forces f(0)=0f(0)=0
  • If f(x)+2f(1/x)=g(x)f(x)+2f(1/x)=g(x) for all x≠0x\neq 0, substituting 1/x1/x gives a second equation
  • Eliminate the orbit values to solve the resulting linear system
  • Always check the candidate function in the original relation

Spot it: A relation links ff at several points such as xx, 1/x1/x, 1−x1-x or x+1x+1, or asks for a specific value of ff that the relation determines.

COMMON MISTAKES
  • Substituting a value outside the domain on which the relation holds
  • Solving the system but never checking the answer in the original equation
TRY IT

Let ff satisfy f(x)+2f ⁣(1x)=3xf(x)+2f\!\left(\dfrac1x\right)=3x for all x≠0x\neq 0. Find f(2)f(2).

Practise this lesson (4 problems) →

4.Exponent laws

The exponent laws are aman=am+na^{m}a^{n}=a^{m+n}, (am)n=amn(a^{m})^{n}=a^{mn}, (ab)n=anbn(ab)^{n}=a^{n}b^{n}, a−n=1ana^{-n}=\frac1{a^{n}}, and aman=am−n\frac{a^{m}}{a^{n}}=a^{m-n}. They look like rules to memorize, but they share one principle: exponentiation turns addition in the exponent into multiplication. Contest problems are almost always solved by rewriting every term as a power of one common base.

The product law is easy to justify for positive integers: amana^{m}a^{n} is mm copies of aa times nn further copies, which is m+nm+n copies. Extending to all integers requires defining a0=1a^{0}=1 and a−n=1ana^{-n}=\frac1{a^n} so that the laws remain consistent. For rational exponents, ap/q=apqa^{p/q}=\sqrt[q]{a^{p}}, and the laws continue to hold. Real exponents are defined by continuity, and the exam rarely needs more than rationals.

The most useful technique is to factor out the smallest power. For instance 2n+3−2n+1=2n(23−21)=6⋅2n2^{n+3}-2^{n+1}=2^{n}\left(2^{3}-2^{1}\right)=6\cdot 2^{n}. Similarly 9n+32n+19^{n}+3^{2n+1} becomes 32n+3⋅32n=4⋅32n3^{2n}+3\cdot 3^{2n}=4\cdot 3^{2n}, since 9n=32n9^{n}=3^{2n}. Whenever a sum of powers appears, look for a common base and then for a common factor that can be pulled out.

Mixed bases are the usual obstacle. The numbers 4=224=2^{2}, 8=238=2^{3}, 9=329=3^{2}, 16=2416=2^{4} and 27=3327=3^{3} should be recognized immediately. Then 8x4x=23x22x=2x\frac{8^{x}}{4^{x}}=\frac{2^{3x}}{2^{2x}}=2^{x}, a simplification that carries straight into exponential equations. Noticing that two bases share a prime is the most frequent first step in these problems.

The common errors come from distributing exponents over sums, which is false: (a+b)n≠an+bn(a+b)^{n}\neq a^{n}+b^{n}. Also 2n+2n=2n+12^{n}+2^{n}=2^{n+1}, not 4n4^{n}. The rule (am)n=amn(a^{m})^{n}=a^{mn} does not give amna^{m^{n}}, and (−1)k(-1)^{k} depends on the parity of kk, so keep track of signs when exponents are variable.

KEY FACTS
  • aman=am+na^{m}a^{n}=a^{m+n},  (am)n=amn\ (a^{m})^{n}=a^{mn},  a−n=1an\ a^{-n}=\dfrac{1}{a^{n}}
  • aman=am−n\dfrac{a^{m}}{a^{n}}=a^{m-n} for a≠0a\neq 0
  • am+am=2ama^{m}+a^{m}=2a^{m}, but am+am≠a2ma^{m}+a^{m}\neq a^{2m}
  • Rewrite every term as a power of a single base, then factor out the smallest power

Spot it: Terms have powers of different but related bases such as 4,8,9,274,8,9,27, or a sum of exponentials with shifted exponents.

COMMON MISTAKES
  • Distributing an exponent over a sum, writing (a+b)n=an+bn(a+b)^{n}=a^{n}+b^{n}
  • Adding like powers incorrectly, such as 2n+2n=4n2^{n}+2^{n}=4^{n}
TRY IT

For n=3n=3, evaluate 9n+32n+127n\dfrac{9^{n}+3^{2n+1}}{27^{n}}.

Practise this lesson (2 problems) →

5.Solving exponential equations

An exponential equation has the unknown in an exponent. There are two main tools. The first is to equate exponents when both sides are powers of the same base: if a>0a>0, a≠1a\neq 1, and au=ava^{u}=a^{v}, then u=vu=v. The second is to substitute t=axt=a^{x}, which turns the equation into an algebraic one, usually a polynomial in tt. Contest problems mix bases that share a core, so the second tool is the one used most.

Why can exponents be equated? For a>0a>0 with a≠1a\neq 1, the function x↦axx\mapsto a^{x} is strictly monotonic, so it is one-to-one and has an inverse log⁡a\log_a. Applying log⁡a\log_a to both sides of au=ava^{u}=a^{v} gives u=vu=v. Monotonicity also means each piece of an exponential equation has at most one solution in each interval where the expression is defined, which is why sign analysis and substitution are so effective.

For the substitution, write every term in terms of one quantity. With t=2xt=2^{x} we have 4x=(2x)2=t24^{x}=(2^{x})^{2}=t^{2} and 2x+1=2t2^{x+1}=2t. The equation 4x−6⋅2x+8=04^{x}-6\cdot 2^{x}+8=0 becomes t2−6t+8=0t^{2}-6t+8=0, which factors as (t−2)(t−4)=0(t-2)(t-4)=0. Each positive root gives one solution x=log⁡2tx=\log_{2}t, namely x=1x=1 and x=2x=2. Any root with t≤0t\le 0 must be discarded, since 2x2^{x} is always positive.

Sum questions can often be finished without solving. If t1,t2t_1,t_2 are the roots of the quadratic in tt, the corresponding exponents are log⁡2t1\log_2 t_1 and log⁡2t2\log_2 t_2, and their sum is log⁡2(t1t2)\log_2(t_1t_2). Here t1t2=8t_1t_2=8, so the sum of the xx-values is log⁡28=3\log_2 8=3, which agrees with 1+21+2. Using the product of the tt-roots is a reliable shortcut whenever the question asks for a sum of solutions.

Typical errors include forgetting that 2x>02^{x}>0 eliminates negative roots of the quadratic, and dividing both sides by an expression that might be zero. Also write 4x4^{x} as (2x)2(2^{x})^{2} rather than treating 22x2^{2x} as a new unrelated variable, since the substitution only works when the whole equation is expressed through one quantity. Verify each candidate in the original equation.

KEY FACTS
  • If a>0a>0, a≠1a\neq 1, then au=ava^{u}=a^{v} implies u=vu=v
  • Substitute t=axt=a^{x} and write each power as a power of tt
  • Discard roots with t≤0t\le 0, because ax>0a^{x}>0
  • For a sum of solutions, the sum of the logarithms of the tt-roots is log⁡a(t1t2)\log_a(t_1t_2)

Spot it: The unknown appears in exponents of several related bases, or the equation has the shape p (ax)2+q ax+r=0p\,(a^{x})^{2}+q\,a^{x}+r=0 after rewriting.

COMMON MISTAKES
  • Keeping a negative or zero value of tt, which corresponds to no real xx
  • Treating 4x4^{x} as an independent unknown instead of (2x)2(2^{x})^{2}
TRY IT

Find the sum of all real solutions of 4x−6⋅2x+8=04^{x}-6\cdot 2^{x}+8=0.

Practise this lesson (2 problems) →

6.Logarithm laws and change of base

The logarithm log⁡ab\log_a b is the exponent to which aa must be raised to produce bb, so alog⁡ab=ba^{\log_a b}=b. It is the inverse of the exponential, and every logarithm law is an exponent law read in reverse. For a>0a>0, a≠1a\neq 1 and x,y>0x,y>0 we have log⁡a(xy)=log⁡ax+log⁡ay\log_a(xy)=\log_a x+\log_a y, log⁡a ⁣(xy)=log⁡ax−log⁡ay\log_a\!\left(\frac xy\right)=\log_a x-\log_a y, and log⁡a(xr)=rlog⁡ax\log_a(x^{r})=r\log_a x.

To justify the product law, let u=log⁡axu=\log_a x and v=log⁡ayv=\log_a y, so x=aux=a^{u} and y=avy=a^{v}. Then xy=au+vxy=a^{u+v}, and taking log⁡a\log_a gives log⁡a(xy)=u+v\log_a(xy)=u+v. The power law follows the same way, since xr=arux^{r}=a^{ru}. Each law is simply the corresponding exponent law, which is why it is worth remembering the logic rather than only the formulas.

The change-of-base formula says that for any positive c≠1c\neq 1, log⁡ab=log⁡cblog⁡ca\log_a b=\frac{\log_c b}{\log_c a}. To prove it, let t=log⁡abt=\log_a b, so at=ba^{t}=b. Taking log⁡c\log_c of both sides gives tlog⁡ca=log⁡cbt\log_c a=\log_c b, and dividing gives the formula. This identity drives most logarithm simplifications: rewrite everything in one base, often the base that makes the answer clean, and the problem becomes a ratio.

Two consequences are used constantly. First, log⁡ab⋅log⁡ba=1\log_a b\cdot\log_b a=1. Second, the chain log⁡23⋅log⁡34⋯log⁡n(n+1)\log_2 3\cdot\log_3 4\cdots\log_{n}(n+1) telescopes to log⁡2(n+1)\log_2(n+1), because each denominator cancels the next numerator. Any product in which the argument of one logarithm is the base of the next should trigger this telescoping instinct.

Here is a model simplification. Evaluate log⁡427⋅log⁡916\log_4 27\cdot\log_9 16 by writing both logarithms in base 22. We have log⁡427=log⁡227log⁡24=32log⁡23\log_4 27=\frac{\log_2 27}{\log_2 4}=\frac32\log_2 3 and log⁡916=log⁡216log⁡29=42log⁡23=2log⁡23\log_9 16=\frac{\log_2 16}{\log_2 9}=\frac{4}{2\log_2 3}=\frac{2}{\log_2 3}. Their product is 33. The expression looked unrelated until the common base was chosen. A poor choice of base leaves irrational logarithms that hide the structure.

KEY FACTS
  • log⁡a(xy)=log⁡ax+log⁡ay\log_a(xy)=\log_a x+\log_a y and log⁡a(xr)=rlog⁡ax\log_a(x^{r})=r\log_a x for x,y>0x,y>0
  • log⁡ab=log⁡cblog⁡ca\log_a b=\dfrac{\log_c b}{\log_c a} for any c>0c>0, c≠1c\neq 1
  • log⁡ab⋅log⁡ba=1\log_a b\cdot\log_b a=1
  • Telescoping: log⁡23⋅log⁡34⋯log⁡n(n+1)=log⁡2(n+1)\log_2 3\cdot\log_3 4\cdots\log_{n}(n+1)=\log_2(n+1)

Spot it: A problem contains logarithms with different bases, or a product or quotient of logarithms whose arguments and bases interact.

COMMON MISTAKES
  • Writing log⁡(x+y)=log⁡x+log⁡y\log(x+y)=\log x+\log y, which is false
  • Swapping the base and the argument when applying the change-of-base formula
TRY IT

Compute log⁡427⋅log⁡916\log_{4}27\cdot\log_{9}16.

Practise this lesson (5 problems) →

7.Log equations and domain traps

A logarithm is defined only when its argument is positive and its base is positive and different from 11. When you solve log⁡af(x)=log⁡ag(x)\log_a f(x)=\log_a g(x), the algebra reduces it to f(x)=g(x)f(x)=g(x), and that step is valid only for points where both sides are defined. Every root of the algebraic equation must be checked against f(x)>0f(x)>0 and g(x)>0g(x)>0. Failing to check is the most common reason a logarithm answer is wrong.

Why does the reduction lose information? The function u↦log⁡auu\mapsto\log_a u is one-to-one on (0,∞)(0,\infty), so log⁡af=log⁡ag\log_a f=\log_a g implies f=gf=g provided both are positive. The polynomial equation f=gf=g, however, has solutions on the whole real line, including points where ff or gg is negative. Those points are extraneous: the domain is exactly what the derivation silently assumed.

Consider log⁡3(x2−1)=log⁡3(2x+2)\log_3(x^{2}-1)=\log_3(2x+2). Equating arguments gives x2−2x−3=0x^{2}-2x-3=0, so x=3x=3 or x=−1x=-1. For x=−1x=-1 we get x2−1=0x^{2}-1=0, which is not positive, so x=−1x=-1 is extraneous. For x=3x=3 we get x2−1=8>0x^{2}-1=8>0 and 2x+2=8>02x+2=8>0, so x=3x=3 is a genuine solution. There is exactly one solution.

A reliable method is to write the domain as inequalities first, solve the equation, and intersect the solutions with the domain. The domain step often removes half the roots of a quadratic. For a sum of logarithms, log⁡af+log⁡ag=log⁡a(fg)\log_a f+\log_a g=\log_a(fg) is valid when f>0f>0 and g>0g>0 individually. The condition fg>0fg>0 is not enough, because a product of two negatives is positive and would admit spurious solutions.

Equations with the unknown in the base need a different substitution. Consider log⁡2x+log⁡x2=52\log_2 x+\log_x 2=\frac52. Let t=log⁡2xt=\log_2 x, which requires x>0x>0 and x≠1x\neq 1. Then log⁡x2=1t\log_x 2=\frac1t, and the equation becomes t+1t=52t+\frac1t=\frac52, with roots t=2t=2 and t=12t=\frac12. These give x=4x=4 and x=2x=\sqrt2, both admissible, and the domain check here is the condition t≠0t\neq 0.

KEY FACTS
  • log⁡au\log_a u is defined only for u>0u>0, a>0a>0, a≠1a\neq 1
  • log⁡af+log⁡ag=log⁡a(fg)\log_a f+\log_a g=\log_a(fg) requires f>0f>0 and g>0g>0 separately
  • Intersect the solution set of an algebraic reduction with the domain
  • If the unknown is the base, substitute t=log⁡2xt=\log_2 x and solve for tt

Spot it: Any equation with logarithms, especially when a quadratic emerges after the logarithms are removed.

COMMON MISTAKES
  • Keeping a root that makes an argument zero or negative
  • Combining logarithms into log⁡a(fg)\log_a(fg) without checking f>0f>0 and g>0g>0
TRY IT

Find all real xx satisfying log⁡2(x2−2)=log⁡2x\log_{2}(x^{2}-2)=\log_{2}x.

Practise this lesson (2 problems) →

8.Floor, ceiling and fractional part

The floor ⌊x⌋\lfloor x\rfloor is the largest integer not exceeding xx, the ceiling ⌈x⌉\lceil x\rceil is the smallest integer not less than xx, and the fractional part is {x}=x−⌊x⌋∈[0,1)\{x\}=x-\lfloor x\rfloor\in[0,1). Everything begins from the defining inequality ⌊x⌋≤x<⌊x⌋+1\lfloor x\rfloor\le x<\lfloor x\rfloor+1. Equivalently, write x=n+{x}x=n+\{x\} with nn an integer and 0≤{x}<10\le\{x\}<1, and most floor equations become a problem about intervals.

Useful identities: ⌊x+n⌋=⌊x⌋+n\lfloor x+n\rfloor=\lfloor x\rfloor+n for every integer nn, so integer shifts can be pulled out of a floor, but scalar multiples cannot: ⌊2x⌋≠2⌊x⌋\lfloor 2x\rfloor\neq 2\lfloor x\rfloor in general. For non-integer xx, ⌊x⌋+⌊−x⌋=−1\lfloor x\rfloor+\lfloor -x\rfloor=-1, and always ⌈x⌉=−⌊−x⌋\lceil x\rceil=-\lfloor -x\rfloor. Negative numbers round down under the floor, so ⌊−2.5⌋=−3\lfloor -2.5\rfloor=-3.

Counting with floors reduces to counting blocks. The value ⌊n⌋=k\lfloor\sqrt n\rfloor=k holds exactly when k2≤n≤(k+1)2−1k^{2}\le n\le (k+1)^{2}-1, a block of 2k+12k+1 consecutive integers. Likewise ⌊n/m⌋=q\lfloor n/m\rfloor=q holds exactly for nn in [qm, qm+m−1][qm,\,qm+m-1], a block of mm integers. Summing over blocks replaces a long sum of NN terms by a sum of about N\sqrt N block values.

The block method proves that ∑n=1N⌊n⌋=∑kk⋅#{n:⌊n⌋=k}\sum_{n=1}^{N}\lfloor\sqrt n\rfloor=\sum_{k}k\cdot\#\{n:\lfloor\sqrt n\rfloor=k\}, and the count of each kk is the block length. Converting a sum over nn into a sum over the values kk is one of the most important tricks in the topic, and the same idea evaluates divisor-type sums such as ∑n⌊N/n⌋\sum_{n}\lfloor N/n\rfloor and counts such as the number of nn with ⌊log⁡2n⌋=j\lfloor\log_2 n\rfloor=j.

Typical mistakes: miscounting block lengths by using k2k^{2} to k2+kk^{2}+k instead of k2k^{2} to (k+1)2−1(k+1)^{2}-1, and forgetting that the floor of a negative number rounds down. Fractional part questions often reduce to an equation like x+{x}=cx+\{x\}=c, which you solve by splitting xx into its integer and fractional parts and testing the allowed integers.

KEY FACTS
  • ⌊x⌋≤x<⌊x⌋+1\lfloor x\rfloor\le x<\lfloor x\rfloor+1, and {x}=x−⌊x⌋\{x\}=x-\lfloor x\rfloor
  • ⌊x+n⌋=⌊x⌋+n\lfloor x+n\rfloor=\lfloor x\rfloor+n for integers nn, but ⌊2x⌋≠2⌊x⌋\lfloor 2x\rfloor\neq 2\lfloor x\rfloor in general
  • For non-integer xx, ⌊x⌋+⌊−x⌋=−1\lfloor x\rfloor+\lfloor -x\rfloor=-1
  • ⌊n⌋=k\lfloor\sqrt n\rfloor=k exactly when k2≤n≤(k+1)2−1k^{2}\le n\le (k+1)^{2}-1

Spot it: A problem has a floor, ceiling or fractional part, or a sum whose terms are constant on long blocks.

COMMON MISTAKES
  • Treating ⌊−2.5⌋\lfloor -2.5\rfloor as −2-2
  • Using the wrong block endpoint, such as ending the block for ⌊n⌋=k\lfloor\sqrt n\rfloor=k at k2+kk^{2}+k
TRY IT

Compute ∑n=120⌊n⌋\displaystyle\sum_{n=1}^{20}\left\lfloor\sqrt n\right\rfloor.

Practise this lesson (6 problems) →

9.Comparing huge numbers

Contest problems often ask which of several enormous numbers is largest, or how many digits a power has. Direct computation is impossible, so the method is to compare logarithms, or to rewrite both quantities with a common exponent or base. Taking log⁡\log is legitimate because log⁡\log is strictly increasing on positive numbers: for A,B>0A,B>0, A<BA<B if and only if log⁡A<log⁡B\log A<\log B. Then log⁡(ab)=blog⁡a\log(a^{b})=b\log a turns a power into a product that can be estimated by hand.

Good estimates need a small toolkit: log⁡102≈0.30103\log_{10}2\approx 0.30103, log⁡103≈0.47712\log_{10}3\approx 0.47712, and log⁡23≈1.58496\log_2 3\approx 1.58496. For example log⁡10(2300)=300⋅0.30103≈90.31\log_{10}(2^{300})=300\cdot 0.30103\approx 90.31, while log⁡10(3200)=200⋅0.47712≈95.42\log_{10}(3^{200})=200\cdot 0.47712\approx 95.42. The second is larger by about 10510^{5}. Keep only as many digits as the comparison requires, and rewrite exactly if two estimates agree to that precision.

Digit counts use the same tool. A positive integer NN has ⌊log⁡10N⌋+1\lfloor\log_{10}N\rfloor+1 digits, because 10d−1≤N<10d10^{d-1}\le N<10^{d} exactly when d−1≤log⁡10N<dd-1\le \log_{10}N<d. For N=31000N=3^{1000}, 1000log⁡103≈477.121000\log_{10}3\approx 477.12, so 310003^{1000} has 478478 digits. The floor and the +1+1 are where most errors occur, so check the boundary cases explicitly.

The common-exponent trick is equally important. Since amk=(am)k=(ak)ma^{mk}=(a^{m})^{k}=(a^{k})^{m}, two powers can be compared by writing both with the same exponent and comparing the bases. For instance 2100=(210)10=1024102^{100}=(2^{10})^{10}=1024^{10} and 1030=(103)10=10001010^{30}=(10^{3})^{10}=1000^{10}, so 21002^{100} is larger. The same idea shows that nkn^{k} versus knk^{n} is decided by the sign of ln⁡n/n−ln⁡k/k\ln n/n-\ln k/k, which depends on the monotonicity of ln⁡x/x\ln x/x.

The function ln⁡xx\frac{\ln x}{x} increases on (0,e](0,e] and decreases on [e,∞)[e,\infty). This is the key to inequalities such as n2025n^{2025} versus 2025n2025^{n}: for n≥3n\ge 3 and n<2025n<2025 the larger exponent sits on the wrong side of the peak, while for n≥2025n\ge 2025 the inequality reverses. Mistakes to avoid include comparing only leading digits, rounding logarithms too coarsely near a tie, and forgetting to convert between bases.

KEY FACTS
  • For A,B>0A,B>0: A<B  ⟺  log⁡A<log⁡BA<B \iff \log A<\log B
  • A positive integer NN has ⌊log⁡10N⌋+1\lfloor\log_{10}N\rfloor+1 digits
  • log⁡102≈0.30103\log_{10}2\approx 0.30103 and log⁡103≈0.47712\log_{10}3\approx 0.47712
  • amk=(am)k=(ak)ma^{mk}=(a^{m})^{k}=(a^{k})^{m}, so rewrite both sides with a common exponent

Spot it: The question compares or counts digits of very large powers, or compares nan^{a} with ana^{n}.

COMMON MISTAKES
  • Estimating log⁡\log values too roughly to decide a close comparison
  • Forgetting the +1+1 in the digit count formula
TRY IT

Which is larger, 23002^{300} or 32003^{200}?

Practise this lesson (3 problems) →

10.Graph transformations

Given the graph of y=f(x)y=f(x), the graph of a transformed function is obtained by a sequence of standard moves. Replacing f(x)f(x) by f(x−h)+kf(x-h)+k translates the graph right by hh and up by kk. Replacing f(x)f(x) by a f(x)a\,f(x) stretches vertically by ∣a∣|a| and reflects across the xx-axis when a<0a<0. Replacing f(x)f(x) by f(bx)f(bx) compresses horizontally by a factor of ∣b∣|b|, and f(−x)f(-x) reflects across the yy-axis.

Tracking a single point is the most reliable method. A point (p,q)(p,q) on y=f(x)y=f(x) produces a point on the transformed graph whose input is found by solving the inner argument for xx. For y=a f(x−h)+ky=a\,f(x-h)+k, the point (p,q)(p,q) maps to (p+h, aq+k)(p+h,\ aq+k). Check this by substitution: setting x=p+hx=p+h makes x−h=px-h=p, so the new output is aq+kaq+k.

Horizontal and vertical operations behave differently, and the signs are where errors happen. A horizontal change acts on the input before ff is applied, so f(x−h)f(x-h) moves points right by hh, the opposite of the sign inside the bracket. A vertical change acts on outputs and moves points in the direction of its sign: f(x)+kf(x)+k moves points up by kk. Mixing these two rules is the most common graph error.

Transformations compose like functions. The graph of y=−f(2−x)+3y=-f(2-x)+3 is obtained by three steps. Write 2−x=−(x−2)2-x=-(x-2), so the input map p↦2−pp\mapsto 2-p is a reflection across the line x=1x=1. The output map q↦−q+3q\mapsto -q+3 is a reflection across the xx-axis followed by a vertical shift. A point (p,q)(p,q) on y=f(x)y=f(x) therefore goes to (2−p, 3−q)(2-p,\ 3-q). Writing the new function explicitly and then tracking one point avoids confusion.

Mistakes to avoid: applying a horizontal shift to the output, reflecting across the yy-axis when you meant the xx-axis, and treating a horizontal stretch by bb as moving pp to bpbp instead of p/bp/b. When in doubt, plug the candidate point into the new formula and confirm that the output matches.

KEY FACTS
  • y=a f(x−h)+ky=a\,f(x-h)+k maps (p,q)(p,q) to (p+h, aq+k)(p+h,\ aq+k)
  • f(−x)f(-x) reflects across the yy-axis, and −f(x)-f(x) reflects across the xx-axis
  • f(bx)f(bx) maps (p,q)(p,q) to (pb, q)\left(\dfrac pb,\ q\right)
  • A point is on the new graph exactly when substituting it into the new formula gives a true statement

Spot it: A problem describes a curve by a transformed formula and asks about points, intercepts, symmetry or the number of intersections.

COMMON MISTAKES
  • Shifting the wrong way when the shift acts on the input
  • Applying a horizontal stretch by bb as p↦bpp\mapsto bp instead of p↦p/bp\mapsto p/b
TRY IT

The point (2,−5)(2,-5) lies on the graph of y=f(x)y=f(x). Find the image of this point on the graph of y=3f(x+1)−2y=3f(x+1)-2, and report it as an ordered pair.

Practise this lesson (3 problems) →

Treat domains and inverse operations as part of the solution.

An algebraic expression can look valid after a transformation even when the original function was not defined. Logarithms need positive arguments; denominators cannot vanish; inverse functions require an appropriate branch. Write these restrictions before simplifying.

When several logarithm bases are powers of the same number, a single new variable often makes the problem linear. For function composition, make a small input-output table before expanding: order matters, and f(g(x))f(g(x)) is usually different from g(f(x))g(f(x)).

Before you commit to a method

  • Write each logarithm argument as a strict inequality.
  • Convert bases consistently before combining coefficients.
  • After solving the transformed equation, recheck the original domain.

Two problems to work through

Try the question on paper before opening its solution. For each step, explain why it follows from the previous one.

Three bases, one variable

Solve log⁡2x+log⁡4x+log⁡8x=11\log_2x+\log_4x+\log_8x=11.

Show the full reasoning
  1. The domain is x>0x>0. Put t=log⁡2xt=\log_2x.
  2. Change of base gives log⁡4x=t/2\log_4x=t/2 and log⁡8x=t/3\log_8x=t/3.
  3. Then (1+1/2+1/3)t=11(1+1/2+1/3)t=11, so 11t/6=1111t/6=11 and t=6t=6.
  4. Therefore x=26=64x=2^6=64. The three logarithms are 6,3,26,3,2, which sum to 1111.

Answer: 64

Check or vary it: The coefficients come from the exponents in the bases. Replacing base 88 by base 1616 changes the last coefficient to 1/41/4.

An extraneous logarithmic solution

Solve log⁡2(x−1)+log⁡2(x−3)=3\log_2(x-1)+\log_2(x-3)=3.

Show the full reasoning
  1. Both arguments must be positive, so x>3x>3.
  2. Combine logarithms to obtain log⁡2((x−1)(x−3))=3\log_2((x-1)(x-3))=3.
  3. Thus (x−1)(x−3)=8(x-1)(x-3)=8, or x2−4x−5=0x^2-4x-5=0. The algebraic candidates are 55 and −1-1.
  4. Only 55 lies in the original domain. At 55 the logs are 22 and 11.

Answer: 5

Check or vary it: The product of two negative quantities can be positive even though neither original logarithm exists. That is why the domain must be retained.

Make the method stick

Close the solutions and rewrite both arguments from memory. In the topic practice below, begin with an untimed warm-up, then work through the medium problems. If you miss one, write down the first step you could not justify before checking the solution. Retry it on another day without your notes.

Substitute special values first

Before manipulating a functional or exponential relation, plug in 00, 11, −1-1, a reciprocal, or a value that makes an expression vanish. The output often reveals a special value of ff, or a symmetric pair of equations to eliminate with.

Put every power over one base

When bases are 4,8,9,16,274,8,9,16,27 or similar, rewrite them as powers of the common prime before doing anything else. Most exponential identities collapse once everything is a power of 22 or 33.

Write the domain before solving a log equation

List the inequalities that each argument and base must satisfy, solve the algebraic equation, and then intersect. On the AMC this single habit removes a large share of wrong answers in logarithm problems.

Count floors by blocks, not term by term

A floor sum or count is constant on blocks of integers, such as k2≤n<(k+1)2k^{2}\le n<(k+1)^{2} for square roots or qm≤n<(q+1)mqm\le n<(q+1)m for division. Count block lengths, multiply by the value, and sum over the few blocks.

Look for a period, then reduce the exponent

Compute the first few iterates until a value repeats, then reduce the large index modulo the period. Also check whether the map is an involution, since then f2=idf^{2}=\mathrm{id} and only parity of the index matters.

Compare logarithms, not the numbers

For enormous powers, take log⁡10\log_{10} (or rewrite with a common exponent) and compare the estimates. Keep enough digits to separate close candidates, and rewrite exactly when two estimates agree.

Substitute t = a^x for exponential equations

Rewrite every exponential term as a power of a single quantity t=axt=a^{x}, solve the resulting algebraic equation, and discard roots with t≤0t\le 0. For sums of solutions, the product of the tt-roots gives the answer through a logarithm.

Try each one first. “How do I start?” gives the way in; then reveal the solution one step at a time.

Example 1: Composition order matters

Warm-up · #1–5

Let f(x)=x+3f(x)=x+3 and g(x)=x2g(x)=x^{2}. What is g(f(2))−f(g(2))g(f(2))-f(g(2))?

  1. (A)4
  2. (B)7
  3. (C)11
  4. (D)18
  5. (E)25
How do I start?

Evaluate each composition from the inside out and keep the two orders separate; do not assume they agree.

Example 2: Change of base to a single parameter

Easy · #6–10

Let a=log⁡32a=\log_3 2. Which expression equals log⁡616\log_6 16?

  1. (A)41+a\frac{4}{1+a}
  2. (B)2a1+a\frac{2a}{1+a}
  3. (C)a4(1+a)\frac{a}{4(1+a)}
  4. (D)4a(1+a)4a(1+a)
  5. (E)4a1+a\frac{4a}{1+a}
How do I start?

Change the base to 33, because log⁡32\log_3 2 is the only irrational quantity given.

Example 3: Solve a power equation by one base

Easy · #6–10

Solve 8x2x+1=16\dfrac{8^{x}}{2^{x+1}}=16 for xx.

  1. (A)2
  2. (B)52\frac{5}{2}
  3. (C)3
  4. (D)72\frac{7}{2}
  5. (E)4
How do I start?

Every term is a power of 22, so the equation is an exponent comparison.

Example 4: Floor equation with a fractional part

Medium · #11–15

Let {x}=x−⌊x⌋\{x\}=x-\lfloor x\rfloor. Find the sum of all real xx satisfying x+{x}=5x+\{x\}=5.

  1. (A)172\frac{17}{2}
  2. (B)9
  3. (C)192\frac{19}{2}
  4. (D)10
  5. (E)212\frac{21}{2}
How do I start?

Write x=n+fx=n+f with n=⌊x⌋n=\lfloor x\rfloor and 0≤f<10\le f<1, then the equation becomes an integer-and-fraction problem.

Example 5: Divisor-counting sum via lattice pairs

Hard · #16–20

Find ∑n=1100⌊100n⌋\displaystyle\sum_{n=1}^{100}\left\lfloor\frac{100}{n}\right\rfloor.

  1. (A)400
  2. (B)460
  3. (C)482
  4. (D)500
  5. (E)520
How do I start?

Each term ⌊100/n⌋\lfloor 100/n\rfloor counts the multiples mm with nm≤100nm\le 100, so the sum counts lattice pairs under a hyperbola.

Example 6: Functional equation on a three-cycle

Final five · #21–25

Let ff be a real function such that f(x)+f ⁣(11−x)=xf(x)+f\!\left(\dfrac{1}{1-x}\right)=x for all real x≠0,1x\neq 0,1. What is f(2)f(2)?

  1. (A)1
  2. (B)54\frac{5}{4}
  3. (C)32\frac{3}{2}
  4. (D)74\frac{7}{4}
  5. (E)2
How do I start?

The substitution x↦11−xx\mapsto\frac{1}{1-x} has order three, so the three equations along one orbit can be combined.

Art of Problem Solving: Floor and Ceiling Functions
Art of Problem Solving
Richard Rusczyk's introduction to the floor and ceiling functions, with the defining inequality and basic evaluations; watch before the block-counting problems.
A fun functional equation!!
Michael Penn
A short functional-equation solution that shows how special values and reusing the relation pin down $f$; watch when you meet symmetric functional equations.
2020 AMC 10 B Problem 24, 12 B Problem 21
TheBeautyofMath
A worked AMC 12 solution that combines floor functions with algebra; watch after the floor lesson to see the block idea on a real contest problem.

30 problems, easy to hard

6 × Warm-up · #1–56 × Easy · #6–108 × Medium · #11–156 × Hard · #16–204 × Final five · #21–25
30 problems
All 30 problemsWarm-up (#1–10)Medium (#11–15)Hard (#16–25)

Next topic: Sequences & Series →