Achievable logoAchievable logo
AP Calculus AB
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Limits
1.1 Tables and graphs
1.2 Analytical limits
1.2.1 Direct substitution
1.2.2 Composite functions
1.3 Algebraic limits
1.4 Limits and infinity
1.5 Special limits
1.6 Continuity
2. Derivative basics
3. Advanced differentiation
4. Contextual uses
5. Analytical uses
6. Integration
7. Differential equations
8. Applications of integrals
Wrapping up
Achievable logoAchievable logo
1.2.2 Composite functions
Achievable AP Calculus AB
1. Limits
1.2. Analytical limits
Our AP Calculus AB course is now in "early access" - get 50% off for a limited time.

Composite functions

6 min read
Font
Discuss
Share
Feedback

What you’ll learn

  • Finding limits of composite functions
  • Determining composite limits from graphs

A composite function is a function inside another function, usually written as f(g(x)) or occasionally as (f∘g)(x).

Limit of a composite function:

If

x→alim​g(x)=L

and f(x) is continuous at x=L, then

x→alim​f(g(x))=f(x→alim​g(x))=f(L)

So to find the limit of a composite function,

  1. Find the limit of the inner function g(x).
  2. Plug that result into the outer function f.

Example

If f(x)=3x+1 and g(x)=2x2, evaluate

a) x→0lim​f(g(x))

b) x→0lim​g(f(x))

Solutions

a) x→0lim​f(g(x))

(spoiler)

First, evaluate the limit of the inner function:

x→0lim​g(x)=x→0lim​2x2=0

Now evaluate f at that value:

f(0)=3(0)+1=1

b) x→0lim​g(f(x))

(spoiler)

Evaluate the inner limit:

x→0lim​f(x)=x→0lim​(3x+1)=1

Now evaluate g at that value:

g(1)=2(1)2=2

Challenge problems

The composite-function limit law works when the outer function f(x) is continuous at the value approached by the inner function g(x), allowing direct substitution into the outer function.

But in cases where x→alim​g(x) doesn’t exist or f(x) is not continuous, more analysis is required.

Problems similar to the multi-part question below have appeared on past AP exams, including some of the trickier but less common cases.

In the graphs shown below, g(x) is defined for inputs in [−6,∞) and f(x) is defined for inputs in (−5,8].

Composite function limit
Composite function limit

Evaluate:

a) x→4lim​f(g(x))

b) x→1lim​g(f(x))

c) x→−2lim​f(f(x))

d) x→−1lim​g(g(x))

Answers

(spoiler)

a) Does not exist
b) ∞
c) 2
d) Does not exist

Solutions

a) x→4lim​f(g(x))

(spoiler)

As x approaches 4, the graph of the inner function g(x) approaches the vertical asymptote, increasing without bound to ∞ on both sides.

However, the outer function f(x) is defined only for inputs in the interval (−5,8]. For values of x close to 4, g(x) lies outside of the domain of f.

For example, if g(3.99)=1000 then f(g(3.99))=f(1000), which is not defined.

Since the composite function f(g(x)) is not defined for x-values close to 4, the limit does not exist.

b) x→1lim​g(f(x))

(spoiler)

First, evaluate the inner limit:

x→1lim​f(x)=4

At x=4, g has a vertical asymptote, so it would be reasonable to conclude the composite limit is ∞. More specifically, the behavior of g can be described using one-sided limits.

As x→1−, the graph shows f(x) approaching 4 from below. For example, we might have values such as

  • f(0.99)=3.99
  • f(0.999)=3.999

When these values are inputted into g, such as g(3.99), g(3.999), etc. the output grows without bound, and

x→4−lim​g(x)=∞

Similarly, as x→1+, f also approaches 4 from below, and x→4+lim​g(x)=∞.

So the composite limit is

x→1lim​g(f(x))=∞

c) x→−2lim​f(f(x))

(spoiler)

First, evaluate the inner limit:

x→−2lim​f(x)=3

Since f is not continuous at x=3, simply substituting f(3)=−3 does not determine the limit. Instead, we need to analyze how f(x) approaches 3.

From the graph, as x→−2 from either side, f(x) approaches 3 from above. For example, we might have values such as

  • f(−1.99)=3.01
  • f(−2.01)=3.001, etc.

These values are all slightly greater than 3, meaning the outer function is evaluated at inputs such as f(3.01) and f(3.001). Since the input to the outer f approaches 3 from the right, the composite limit is given by the right-hand limit of f:

x→3+lim​f(x)=2

d) x→−1lim​g(g(x))

(spoiler)

First, evaluate the inner limit:

x→−1lim​g(x)=−4

Since g is not continuous at x=−4, we must analyze how g approaches −4 as x approaches −1, using one-sided limits.

From the left:

From the graph, as x approaches −1 from values less than −1, the inner function g(x) approaches −4 from below. For example, we may have values such as

  • g(−1.01)=−4.01
  • g(−1.001)=−4.001, etc.

These values are all slightly less than −4, so inputs to the outer function g approach −4 from the left. From the graph, the left-hand limit is

x→−4−lim​g(x)=−1

From the right:

As x approaches −1 from the right, g(x) approaches −4 from above. For example, we might have g(−0.99)=−3.99.

These values are slightly greater than −4, so inputs to the outer function g approach −4 from the right, From the graph, the right-hand limit is

x→−4+lim​g(x)=−2

Because the one-sided limits of g as x approaches −4 differ, the one-sided limits of g(g(x)) as x approaches −1 also differ, so x→−1lim​g(g(x)) does not exist.

Composite functions

  • Form: f(g(x)) or (f∘g)(x) — a function inside another function
  • Limit rule: limx→a​f(g(x))=f(limx→a​g(x))=f(L)
    • Requires f(x) to be continuous at x=L

Steps to evaluate composite limits

  • Step 1: Find the limit of the inner function
  • Step 2: Plug that result into the outer function

When the standard rule fails

  • If limx→a​g(x) puts values outside the domain of f → limit DNE
  • If f is discontinuous at L, substituting f(L) is not valid — must analyze one-sided behavior instead

One-sided analysis for tricky cases

  • Determine whether the inner function approaches L from above or below
  • Use the corresponding one-sided limit of the outer function
  • If left- and right-hand composite limits differ → overall limit DNE

Sign up for free to take 3 quiz questions on this topic

All rights reserved ©2016 - 2026 Achievable, Inc.

Composite functions

What you’ll learn

  • Finding limits of composite functions
  • Determining composite limits from graphs

A composite function is a function inside another function, usually written as f(g(x)) or occasionally as (f∘g)(x).

Limit of a composite function:

If

x→alim​g(x)=L

and f(x) is continuous at x=L, then

x→alim​f(g(x))=f(x→alim​g(x))=f(L)

So to find the limit of a composite function,

  1. Find the limit of the inner function g(x).
  2. Plug that result into the outer function f.

Example

If f(x)=3x+1 and g(x)=2x2, evaluate

a) x→0lim​f(g(x))

b) x→0lim​g(f(x))

Solutions

a) x→0lim​f(g(x))

(spoiler)

First, evaluate the limit of the inner function:

x→0lim​g(x)=x→0lim​2x2=0

Now evaluate f at that value:

f(0)=3(0)+1=1

b) x→0lim​g(f(x))

(spoiler)

Evaluate the inner limit:

x→0lim​f(x)=x→0lim​(3x+1)=1

Now evaluate g at that value:

g(1)=2(1)2=2

Challenge problems

The composite-function limit law works when the outer function f(x) is continuous at the value approached by the inner function g(x), allowing direct substitution into the outer function.

But in cases where x→alim​g(x) doesn’t exist or f(x) is not continuous, more analysis is required.

Problems similar to the multi-part question below have appeared on past AP exams, including some of the trickier but less common cases.

In the graphs shown below, g(x) is defined for inputs in [−6,∞) and f(x) is defined for inputs in (−5,8].

Evaluate:

a) x→4lim​f(g(x))

b) x→1lim​g(f(x))

c) x→−2lim​f(f(x))

d) x→−1lim​g(g(x))

Answers

(spoiler)

a) Does not exist
b) ∞
c) 2
d) Does not exist

Solutions

a) x→4lim​f(g(x))

(spoiler)

As x approaches 4, the graph of the inner function g(x) approaches the vertical asymptote, increasing without bound to ∞ on both sides.

However, the outer function f(x) is defined only for inputs in the interval (−5,8]. For values of x close to 4, g(x) lies outside of the domain of f.

For example, if g(3.99)=1000 then f(g(3.99))=f(1000), which is not defined.

Since the composite function f(g(x)) is not defined for x-values close to 4, the limit does not exist.

b) x→1lim​g(f(x))

(spoiler)

First, evaluate the inner limit:

x→1lim​f(x)=4

At x=4, g has a vertical asymptote, so it would be reasonable to conclude the composite limit is ∞. More specifically, the behavior of g can be described using one-sided limits.

As x→1−, the graph shows f(x) approaching 4 from below. For example, we might have values such as

  • f(0.99)=3.99
  • f(0.999)=3.999

When these values are inputted into g, such as g(3.99), g(3.999), etc. the output grows without bound, and

x→4−lim​g(x)=∞

Similarly, as x→1+, f also approaches 4 from below, and x→4+lim​g(x)=∞.

So the composite limit is

x→1lim​g(f(x))=∞

c) x→−2lim​f(f(x))

(spoiler)

First, evaluate the inner limit:

x→−2lim​f(x)=3

Since f is not continuous at x=3, simply substituting f(3)=−3 does not determine the limit. Instead, we need to analyze how f(x) approaches 3.

From the graph, as x→−2 from either side, f(x) approaches 3 from above. For example, we might have values such as

  • f(−1.99)=3.01
  • f(−2.01)=3.001, etc.

These values are all slightly greater than 3, meaning the outer function is evaluated at inputs such as f(3.01) and f(3.001). Since the input to the outer f approaches 3 from the right, the composite limit is given by the right-hand limit of f:

x→3+lim​f(x)=2

d) x→−1lim​g(g(x))

(spoiler)

First, evaluate the inner limit:

x→−1lim​g(x)=−4

Since g is not continuous at x=−4, we must analyze how g approaches −4 as x approaches −1, using one-sided limits.

From the left:

From the graph, as x approaches −1 from values less than −1, the inner function g(x) approaches −4 from below. For example, we may have values such as

  • g(−1.01)=−4.01
  • g(−1.001)=−4.001, etc.

These values are all slightly less than −4, so inputs to the outer function g approach −4 from the left. From the graph, the left-hand limit is

x→−4−lim​g(x)=−1

From the right:

As x approaches −1 from the right, g(x) approaches −4 from above. For example, we might have g(−0.99)=−3.99.

These values are slightly greater than −4, so inputs to the outer function g approach −4 from the right, From the graph, the right-hand limit is

x→−4+lim​g(x)=−2

Because the one-sided limits of g as x approaches −4 differ, the one-sided limits of g(g(x)) as x approaches −1 also differ, so x→−1lim​g(g(x)) does not exist.

Key points

Composite functions

  • Form: f(g(x)) or (f∘g)(x) — a function inside another function
  • Limit rule: limx→a​f(g(x))=f(limx→a​g(x))=f(L)
    • Requires f(x) to be continuous at x=L

Steps to evaluate composite limits

  • Step 1: Find the limit of the inner function
  • Step 2: Plug that result into the outer function

When the standard rule fails

  • If limx→a​g(x) puts values outside the domain of f → limit DNE
  • If f is discontinuous at L, substituting f(L) is not valid — must analyze one-sided behavior instead

One-sided analysis for tricky cases

  • Determine whether the inner function approaches L from above or below
  • Use the corresponding one-sided limit of the outer function
  • If left- and right-hand composite limits differ → overall limit DNE

More from Analytical limits

  • Direct substitution