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

8 min read
Font
Discuss
Share
Feedback

What you’ll learn

  • Composite functions: Find limits of composite functions algebraically.
  • Graphical composition: Determine composite limits using given 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)

If f is not continuous at L, one-sided limits must be used to analyze the behavior.

So to find the limit of a composite function,

  1. Find the limit L of the inner function g(x).
  2. Plug that result into the outer function f, provided f is continuous at L.

Example 1: Continuous functions

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 g(x) to find L:

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

Now evaluate the outer function f at L=0:

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

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

(spoiler)

First, evaluate the limit of the inner function f(x) to find L:

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

Now evaluate the outer function g at L=1:

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

Example 2: Discontinuities

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 if x→alim​g(x) doesn’t exist or if f(x) is not continuous at x=L, use one-sided limits to analyze the behaviors of each function further.

If f(x)=x1​ and g(x)=x2−9, evaluate:

x→3lim​f(g(x))

Solution

(spoiler)

First, evaluate the limit of the inner function to find L:

x→3lim​g(x)=x→3lim​(x2−9)=0

Because the outer function f(x)=x1​ is not continuous at the result of L=0, we must analyze how the inner function g(x) approaches 0 using one-sided limits to determine how the outer f behaves.

You can follow along with the explanation by graphing the two functions in Desmos. Enter the following lines:

g(x)f(x)​=x2−9=x1​​

Now, observe how g(x) behaves as x→3 from either side.

1. From the left:

  • As x→3−, the graph of g approaches 0 from below. For example,

    • g(2.9)=−0.59
    • g(2.99)=−0.0599
  • Inputting these negative values into f(x)=x1​ gives values that decrease without bound toward −∞. So:

x→3−lim​f(g(x))=−∞

2. From the right:

  • As x→3+, the graph of g(x) approaches 0 from above (e.g. g(3.1)=0.61).

  • Inputting these positive values into f(x) gives values that increase without bound toward ∞. So:

x→3+lim​f(g(x))=∞

Because the two one-sided limits are not equal,

x→3lim​f(g(x)) does not exist.

You can visualize this by typing f(g(x)) directly into Desmos and observing the behavior of the composite function to verify the limits found algebraically.

Evaluating composite limits graphically

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) has a vertical asymptote at x=4. The function f(x) is defined only for select values within the interval (−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 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 to find L:

x→1lim​f(x)=4

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

1. From the left:

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, etc.

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)=∞

2. From the right:

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

Therefore, 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

These values are all slightly greater than 3, meaning the outer function is evaluated at inputs to the right of 3, and the composite function approaches the right-hand limit of f:

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

Therefore, the composite limit is

x→−2lim​f(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.

1. From the left:

As x→−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

These values are all slightly less than −4, meaning the outer g is evaluated at inputs to the left of −4. From the graph, the left-hand limit is

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

2. From the right:

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

These values are all slightly greater −4, meaning the outer g is evaluated at inputs to the right −4. 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 5 quiz questions on this topic

All rights reserved ©2016 - 2026 Achievable, Inc.

Composite functions

What you’ll learn

  • Composite functions: Find limits of composite functions algebraically.
  • Graphical composition: Determine composite limits using given 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)

If f is not continuous at L, one-sided limits must be used to analyze the behavior.

So to find the limit of a composite function,

  1. Find the limit L of the inner function g(x).
  2. Plug that result into the outer function f, provided f is continuous at L.

Example 1: Continuous functions

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 g(x) to find L:

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

Now evaluate the outer function f at L=0:

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

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

(spoiler)

First, evaluate the limit of the inner function f(x) to find L:

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

Now evaluate the outer function g at L=1:

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

Example 2: Discontinuities

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 if x→alim​g(x) doesn’t exist or if f(x) is not continuous at x=L, use one-sided limits to analyze the behaviors of each function further.

If f(x)=x1​ and g(x)=x2−9, evaluate:

x→3lim​f(g(x))

Solution

(spoiler)

First, evaluate the limit of the inner function to find L:

x→3lim​g(x)=x→3lim​(x2−9)=0

Because the outer function f(x)=x1​ is not continuous at the result of L=0, we must analyze how the inner function g(x) approaches 0 using one-sided limits to determine how the outer f behaves.

You can follow along with the explanation by graphing the two functions in Desmos. Enter the following lines:

g(x)f(x)​=x2−9=x1​​

Now, observe how g(x) behaves as x→3 from either side.

1. From the left:

  • As x→3−, the graph of g approaches 0 from below. For example,

    • g(2.9)=−0.59
    • g(2.99)=−0.0599
  • Inputting these negative values into f(x)=x1​ gives values that decrease without bound toward −∞. So:

x→3−lim​f(g(x))=−∞

2. From the right:

  • As x→3+, the graph of g(x) approaches 0 from above (e.g. g(3.1)=0.61).

  • Inputting these positive values into f(x) gives values that increase without bound toward ∞. So:

x→3+lim​f(g(x))=∞

Because the two one-sided limits are not equal,

x→3lim​f(g(x)) does not exist.

You can visualize this by typing f(g(x)) directly into Desmos and observing the behavior of the composite function to verify the limits found algebraically.

Evaluating composite limits graphically

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) has a vertical asymptote at x=4. The function f(x) is defined only for select values within the interval (−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 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 to find L:

x→1lim​f(x)=4

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

1. From the left:

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, etc.

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)=∞

2. From the right:

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

Therefore, 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

These values are all slightly greater than 3, meaning the outer function is evaluated at inputs to the right of 3, and the composite function approaches the right-hand limit of f:

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

Therefore, the composite limit is

x→−2lim​f(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.

1. From the left:

As x→−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

These values are all slightly less than −4, meaning the outer g is evaluated at inputs to the left of −4. From the graph, the left-hand limit is

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

2. From the right:

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

These values are all slightly greater −4, meaning the outer g is evaluated at inputs to the right −4. 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