Chapter 2 — Exercises

36 exercises across six lettered parts and four difficulty tiers. Work every ⭐ and ⭐⭐ problem; attempt the ⭐⭐⭐ and ⭐⭐⭐⭐ problems once the basics feel automatic. Tiers: ⭐ routine recall, ⭐⭐ understand-and-explain, ⭐⭐⭐ computational (Python / sympy) or applied, ⭐⭐⭐⭐ synthesis. Selected answers appear in appendices/answers-to-selected.md.


Part A — Function Basics (⭐ Foundational)

2.1 Define function, domain, and range in your own words. Then explain, in one sentence each, why a function is not the same thing as a formula and not the same thing as a graph. (See §2.1.)

2.2 Which of these graphs represent functions of $x$? Apply the vertical line test (§2.1). (a) A circle of radius $1$ centered at the origin (b) The graph of $y = x^3$ (c) The graph of $x = y^2$ (d) The graph of $y = |x|$

2.3 For $f(x) = x^2 - 4x + 3$, compute $f(0)$, $f(1)$, $f(2)$, $f(-1)$, and $f(a + 1)$ (simplify the last).

2.4 Find the natural domain of each (§2.1): (a) $f(x) = \dfrac{1}{x^2 - 1}$ (b) $g(x) = \sqrt{9 - x^2}$ (c) $h(x) = \ln(x - 3)$ (d) $k(x) = \dfrac{\sqrt{x + 4}}{x^2 - 9}$

2.5 Find the range of $f(x) = x^2 + 3$ and the range of $g(x) = 2\sin x + 1$.

2.6 From the Standard Library table (§2.2), state the domain and range of each: $e^x$, $\ln x$, $\cos x$, $\tan x$, $1/x$.


Part B — The Standard Library (⭐⭐ Intermediate)

2.7 Sketch $y = x^2$, $y = x^3$, $y = \sqrt{x}$, and $y = 1/x$ on the same axes for $x \in (0, 2]$. At which point(s) do all of $x^2$, $x^3$, and $\sqrt{x}$ agree, and why?

2.8 Compute without a calculator: $e^0$, $e^{\ln 5}$, $\ln(e^7)$, $\ln 1$, and $\ln(e^2 \cdot e^3)$. State which logarithm law each uses (§2.2).

2.9 Compute without a calculator using the special-values table (§2.2): $\sin 0$, $\sin(\pi/4)$, $\sin(\pi/2)$, $\sin\pi$, $\cos(\pi/3)$, $\cos\pi$.

2.10 Simplify $\log_2 32 + \log_2 4$ and $\ln(e^3) - \ln e$.

2.11 For $f(x) = 2^x$ and $g(x) = \log_2 x$, verify $f(g(8)) = 8$ and $g(f(5)) = 5$. What general property of inverse functions does this illustrate (§2.5)?

2.12 — Growth-rate hierarchy. Using only the facts in §2.2 (no calculator), order these from slowest- to fastest-growing as $x \to \infty$: $\ln x$, $x^{0.5}$, $x^3$, $e^x$, $x^{100}$. Justify the placement of $\ln x$ and of $e^x$ in one sentence each.


Part C — Transformations (⭐⭐ Intermediate)

2.13 Sketch each by transforming $y = x^2$ (§2.3). State the vertex and whether it opens up or down. (a) $y = (x - 3)^2$ (b) $y = -x^2 + 5$ (c) $y = 2(x + 1)^2 - 4$ (d) $y = -\tfrac{1}{2}(x - 2)^2$

2.14 Sketch each by transforming $y = \sin x$ (§2.3). State the amplitude and period. (a) $y = \sin(x - \pi/2)$ (b) $y = 2\sin x$ (c) $y = \sin(2x)$ (d) $y = 1 + \sin x$

2.15 Given an unknown graph of $f$, describe the graph of $g(x) = -3\,f(2x - 4) + 1$ as an ordered sequence of transformations. (Hint: factor the input as $2(x-2)$ first; §2.3 "Composing Transformations.")

2.16 Find a formula for the function obtained from $y = \sqrt{x}$ by shifting right $2$ units, reflecting across the $x$-axis, then shifting up $3$ units. State its domain.

2.17 — Explain. A classmate claims $f(x+3)$ shifts the graph of $f$ to the right by $3$. Explain precisely why this is wrong, using the value-tracking argument from §2.3 (consider where the value $f(0)$ now appears).


Part D — Piecewise, Composition, Inverses (⭐⭐ Intermediate)

2.18 Evaluate the piecewise function (§2.4)

$$f(x) = \begin{cases} x + 1 & x < 0 \\ x^2 & 0 \leq x \leq 2 \\ 4 - x & x > 2 \end{cases}$$

at $x = -3,\ 0,\ 1,\ 2,\ 5$. Is $f$ continuous at the seam $x = 0$? At $x = 2$? (Compare the one-sided values; we formalize this in Chapter 4.)

2.19 For $f(x) = x^2 + 1$ and $g(x) = 2x - 3$, compute $(f \circ g)(x)$ and $(g \circ f)(x)$. Are they equal? What does this confirm about composition (§2.5)?

2.20 Find the inverse of $f(x) = 3x + 7$ and verify $f^{-1}(f(x)) = x$.

2.21 Find the inverse of $f(x) = \dfrac{2x - 1}{x + 3}$ by the swap-and-solve recipe of §2.5. State the domain of $f^{-1}$.

2.22 Explain why $f(x) = x^2$ on its natural domain has no inverse, and give a domain restriction that makes it invertible (§2.5). Write the resulting inverse.

2.23 Each function below is secretly a composition $f(g(x))$. Identify an inner $g$ and an outer $f$ (this is exactly the seeing-the-composition skill that drives the chain rule in Chapter 7). (a) $\sqrt{x^2 + 1}$ (b) $e^{3x}$ (c) $\sin^2 x$ (d) $\ln(\cos x)$


Part E — Modeling (⭐⭐⭐ Challenging — applied across fields)

2.24 — Bacterial growth (Biology). A bacterial population starts at $1000$ and doubles every hour (§2.7). (a) Write $P(t)$ in both base-$2$ and base-$e$ form; give the per-hour rate constant $k = \ln 2$. (b) When does the population reach $1{,}000{,}000$? (Solve algebraically.) (c) What is the population after $10$ hours?

2.25 — Drug half-life (Medicine). A drug has a $4$-hour half-life; the initial dose is $200$ mg (§2.7). (a) Write $D(t)$ as an exponential decay in base-$2$ and base-$e$ form. (b) How much remains after $12$ hours? (c) When does the amount drop to $25$ mg?

2.26 — Cost curves (Economics). A firm's cost of producing $q$ widgets is $C(q) = 100 + 5q + 0.01q^2$ dollars. (a) Find the cost of producing $50$ widgets. (b) Find the average cost $A(q) = C(q)/q$ at $q = 50$. (c) Argue from the form of $A(q)$ why average cost is large for very small $q$ and for very large $q$, so a minimum lies in between. (We find that minimum with derivatives in Chapter 10.)

2.27 — Projectile height (Physics). A ball is launched upward from height $h_0 = 2$ m at speed $v_0 = 15$ m/s; take $g = 9.8\ \text{m/s}^2$, so $h(t) = 2 + 15t - 4.9t^2$ (§2.7). (a) State the natural domain of physical interest (until the ball lands). (b) Using the vertex of this downward parabola, find the maximum height and the time it occurs (transformations / completing the square, §2.3). (c) When does the ball hit the ground? (Quadratic formula; keep the physically meaningful root.)

2.28 — Newton's law of cooling (Physics / Data Science). A coffee cup cools toward room temperature $T_{\text{room}} = 20^\circ$C as $T(t) = 20 + 75\,e^{-0.08t}$ ($t$ in minutes). (a) What is the initial temperature $T(0)$? (b) What is $\lim_{t\to\infty} T(t)$, and what transformation of $e^{-0.08t}$ produced the shift to $20$ (§2.3, §2.7)? (c) When does the coffee reach $50^\circ$C?


Part F — Computational: Python, matplotlib, sympy (⭐⭐⭐ Challenging)

Use the linspace → vectorize → plot pattern from §2.6.

2.29 — Logistic / sigmoid (Data Science). The sigmoid is $\sigma(z) = 1/(1 + e^{-z})$ (§2.7). (a) Compute $\sigma(0)$, $\sigma(2)$, $\sigma(-2)$ (decimals to 3 places). (b) Verify $\sigma(-z) = 1 - \sigma(z)$ algebraically. (c) Plot $\sigma(z)$ on $z \in [-6, 6]$ with matplotlib, marking $\sigma(0) = 1/2$.

2.30 — Growth rates on a log axis. Plot $y = e^x$, $y = x^2$, and $y = x^3$ on $[0, 6]$. Then re-plot on a semilog $y$-axis with plt.semilogy and identify, by eye, the $x$ beyond which $e^x$ overtakes $x^3$ for good. Confirm your reading against the §2.2 claim that $e^x$ outgrows every power.

2.31 — Trig transformations. Plot $y = \sin x$, $y = \sin(2x)$, and $y = 2\sin x$ on $[0, 2\pi]$ on shared axes. Confirm by inspection that $\sin(2x)$ has half the period and $2\sin x$ has twice the amplitude (§2.3).

2.32 — Piecewise plotting with np.where. Plot the piecewise $f$ from Exercise 2.18 on $[-3, 5]$ using nested np.where (§2.6). Mark the two seams $x = 0$ and $x = 2$. Which seam is a corner?

2.33 — Verify an inverse with sympy. Use sympy to confirm that $g(x) = (3x+1)/(2-x)$ is the inverse of $f(x) = (2x-1)/(x+3)$ by checking that $f(g(x))$ and $g(f(x))$ both simplify to $x$ (§2.5–§2.6). Then repeat for your answer to Exercise 2.21 (they should match).

import sympy as sp
x = sp.symbols('x')
f = (2*x - 1)/(x + 3)
g = (3*x + 1)/(2 - x)
print(sp.simplify(f.subs(x, g)))   # expect x
print(sp.simplify(g.subs(x, f)))   # expect x

2.34 — Reusable model function (Biology). Write model_population(P0, r, t) returning $P(t) = P_0 e^{rt}$ (vectorized over a numpy array t). Plot population vs. time for $P_0 = 1000$, $r = 0.05$, $t \in [0, 50]$ years. Read off the doubling time from the plot and compare with the exact value $t = \ln 2 / r \approx 13.86$ years.


Part G — Synthesis (⭐⭐⭐⭐)

2.35 — Build and critique a model. A subscription service signs up new users; weekly signups appear to grow but eventually level off near a market ceiling of about $50{,}000$ users. (a) Explain why a pure exponential $U(t) = U_0 e^{rt}$ cannot be a good long-run model here, referencing the four criteria of a good model in §2.7. (b) The sigmoid-shaped logistic curve $U(t) = \dfrac{50000}{1 + e^{-k(t - t_0)}}$ is a candidate. State its range, its value at $t = t_0$, and its two horizontal asymptotes, connecting each to a property of $\sigma$ from §2.7. (c) Which criterion (faithfulness, simplicity, predictiveness, tractability) does the logistic model improve over the exponential, and which does it cost you? (The full logistic model is developed in Chapter 19.)

2.36 — From representations to the same function. Consider the squaring rule restricted to $[0,\infty)$. Give it as (i) a formula, (ii) a one-line Python definition, (iii) a description of its graph, and (iv) the inverse function with its domain. Then explain why this restricted squaring function is a different function from $x^2$ on all of $\mathbb{R}$, even though they share a formula (§2.1, §2.5). This is the threshold concept of the chapter — a function is its rule and its domain.


Difficulty Distribution

Tier Problems Count Time per problem
⭐ Foundational 2.1–2.6 6 3–5 min
⭐⭐ Intermediate 2.7–2.23 17 5–15 min
⭐⭐⭐ Challenging (applied + computational) 2.24–2.34 11 20–40 min
⭐⭐⭐⭐ Synthesis 2.35–2.36 2 40–60 min

Total: 36 exercises. Applied problems span Biology, Medicine, Economics, Physics, and Data Science. Selected answers (odd-numbered and all ⭐⭐⭐⭐) are in appendices/answers-to-selected.md.