Advanced Chain Rule: Nested Functions, Horizontal Tangents and Abstract Functions — 8 Solved Exercises
After reviewing limits, I moved on to the hardest exercises in chapter 3: functions nested inside one another, horizontal tangents that repeat forever, and functions whose formula we don't even know. Here are 8 exercises solved step by step, with the 3 traps that made me start over several times.
Concepts: chain rule, nested functions, trigonometric and exponential derivatives, horizontal tangent lines, second derivative, asymptotes
Table of Contents
- The Method: From the Outside In
- Nested Functions (exercises 1 to 4)
- Horizontal Tangents (exercise 5)
- Abstract Functions (exercises 6 and 7)
- Asymptotes (exercise 8)
- The 3 Traps in My Review
- Twin Exercises
1. The Method: From the Outside In
For a composite function, differentiate the outer function while keeping the inside unchanged, then multiply by the derivative of the inside. When there are several layers, repeat: each layer adds one factor.
\(\displaystyle \frac{d}{dx}f\big(g(h(x))\big)=f'\big(g(h(x))\big)\cdot g'\big(h(x)\big)\cdot h'(x)\)
| Function | Derivative (with the chain rule) |
|---|---|
| \(\sqrt{u}\) | \(\dfrac{u'}{2\sqrt{u}}\) |
| \(e^{u}\) | \(e^{u}\cdot u'\) |
| \(\tan u\) | \(\sec^2 u\cdot u'\) |
| \(\sec u\) | \(\sec u\tan u\cdot u'\) |
| \(\csc u\) | \(-\csc u\cot u\cdot u'\) |
| \(\cot u\) | \(-\csc^2 u\cdot u'\) |
2. Nested Functions
Exercise 1 — Three Nested Square Roots
Differentiate \(y=\sqrt{x+\sqrt{x+\sqrt{x}}}\).
Work layer by layer.
- Outer layer: \(\sqrt{u}\) with \(u=x+\sqrt{x+\sqrt{x}}\), so \(y'=\dfrac{u'}{2\sqrt{u}}\).
- Middle layer: \(u'=1+\left(\sqrt{x+\sqrt{x}}\right)'=1+\dfrac{1}{2\sqrt{x+\sqrt{x}}}\cdot\left(1+\dfrac{1}{2\sqrt{x}}\right)\).
Answer:
\(\displaystyle y'=\frac{1}{2\sqrt{x+\sqrt{x+\sqrt{x}}}}\left[1+\frac{1}{2\sqrt{x+\sqrt{x}}}\left(1+\frac{1}{2\sqrt{x}}\right)\right]\)
Watch the brackets: the factor \(\left(1+\frac{1}{2\sqrt{x}}\right)\) multiplies only \(\frac{1}{2\sqrt{x+\sqrt{x}}}\), not the whole bracket. See trap 2.
Exercise 2 — A Composite Exponential
Differentiate \(y=e^{k\tan\sqrt{x}}\), where \(k\) is a constant.
Three layers: \(e^{u}\), then \(u=k\tan v\), then \(v=\sqrt{x}\).
\(y'=e^{k\tan\sqrt{x}}\cdot k\sec^2\!\sqrt{x}\cdot\dfrac{1}{2\sqrt{x}}\)
Answer: \(y'=\dfrac{k\sec^2\!\left(\sqrt{x}\right)}{2\sqrt{x}}\,e^{k\tan\sqrt{x}}\)
The function \(e^{u}\) “copies itself”: you never lower the exponent. See trap 1.
Exercise 3 — Three Trigonometric Functions
Differentiate \(f(t)=\tan\big(\sec(\cos t)\big)\).
- Outer: \(\left(\tan u\right)'=\sec^2u\cdot u'\) with \(u=\sec(\cos t)\)
- Middle: \(\left(\sec v\right)'=\sec v\tan v\cdot v'\) with \(v=\cos t\)
- Inner: \(\left(\cos t\right)'=-\sin t\)
Answer: \(f'(t)=-\sin t\cdot\sec(\cos t)\tan(\cos t)\cdot\sec^2\!\big(\sec(\cos t)\big)\)
Exercise 4 — A Quotient of Exponentials
Differentiate \(y=\dfrac{e^{u}-e^{-u}}{e^{u}+e^{-u}}\) with respect to \(u\).
Quotient rule with \(f=e^{u}-e^{-u}\), \(f'=e^{u}+e^{-u}\), \(g=e^{u}+e^{-u}\), \(g'=e^{u}-e^{-u}\) (careful: \(\left(e^{-u}\right)'=-e^{-u}\)).
\(\displaystyle y'=\frac{(e^{u}+e^{-u})^2-(e^{u}-e^{-u})^2}{(e^{u}+e^{-u})^2}\)
In the numerator, the \(e^{2u}\) and \(e^{-2u}\) terms cancel, leaving \(2e^{u}e^{-u}+2e^{u}e^{-u}=4e^{0}=4\).
Answer: \(y'=\dfrac{4}{\left(e^{u}+e^{-u}\right)^2}\)
3. Horizontal Tangents
Exercise 5
Find all the points where the curve of \(f(x)=2\sin x+\sin^2x\) has a horizontal tangent line.
Horizontal tangent \(\Leftrightarrow f'(x)=0\).
\(f'(x)=2\cos x+2\sin x\cos x=2\cos x\,(1+\sin x)=0\)
- \(\cos x=0\): \(x=\frac{\pi}{2}\) or \(x=\frac{3\pi}{2}\)
- \(\sin x=-1\): \(x=\frac{3\pi}{2}\) (already found)
The domain is \(\mathbb{R}\): the curve repeats every \(2\pi\), so there are infinitely many points.
- \(x=\frac{\pi}{2}+2k\pi\): \(y=2(1)+1^2=3\)
- \(x=\frac{3\pi}{2}+2k\pi\): \(y=2(-1)+(-1)^2=-1\)
Answer: \(\left(\frac{\pi}{2}+2k\pi,\ 3\right)\) and \(\left(\frac{3\pi}{2}+2k\pi,\ -1\right)\), where \(k\in\mathbb{Z}\)
4. Abstract Functions
Sometimes you don't know the formula of the function, only a few values. You still apply the differentiation rules, then substitute.
Exercise 6
We know that \(h(2)=4\) and \(h'(2)=-3\). Find \(\dfrac{d}{dx}\left(\dfrac{h(x)}{x}\right)\) at \(x=2\).
\(\displaystyle \left(\frac{h(x)}{x}\right)'=\frac{h'(x)\cdot x-h(x)\cdot 1}{x^2}=\frac{(-3)(2)-4}{2^2}=\frac{-10}{4}\)
Answer: \(-\dfrac{5}{2}\)
Exercise 7
We know that \(f(2)=10\) and that \(f'(x)=x^2f(x)\) for all \(x\). Find \(f''(2)\).
First, \(f'(2)=2^2\cdot 10=40\). Then differentiate \(f'(x)=x^2f(x)\) with the product rule:
\(f''(x)=2x\,f(x)+x^2f'(x)\)
\(f''(2)=2(2)(10)+(2^2)(40)=40+160\)
Answer: \(f''(2)=200\)
5. Asymptotes
Exercise 8
Find the asymptotes of \(f(x)=\dfrac{1+x^4}{x^2-x^4}\).
Vertical asymptotes: the denominator is zero and the numerator is not.
\(x^2-x^4=x^2(1-x)(1+x)=0\ \Rightarrow\ x=0,\ x=1,\ x=-1\)
The numerator \(1+x^4\) is never zero, so there are 3 vertical asymptotes: \(x=0\), \(x=1\) and \(x=-1\).
Horizontal asymptote: compare the highest powers.
\(\displaystyle \lim_{x\to\pm\infty}\frac{x^4\left(1+\frac{1}{x^4}\right)}{x^4\left(\frac{1}{x^2}-1\right)}=\frac{1+0}{0-1}=-1\)
Answer: VA \(x=0\), \(x=1\), \(x=-1\); HA \(y=-1\) (on both sides)
6. The 3 Traps in My Review
Trap 1 — Differentiating \(e^{u}\) like a power (exercise 2)
My first attempt was \(\left(e^{k\tan\sqrt{x}}\right)'=k\tan\sqrt{x}\cdot e^{k\tan\sqrt{x}-1}\). I had applied the rule \(nu^{n-1}\), which works for \(x^n\), not for \(e^{u}\).
The correct rule: \(\left(e^{u}\right)'=e^{u}\cdot u'\). The exponential stays the same, and you multiply by the derivative of the exponent.
Trap 2 — Brackets in nested functions (exercise 1)
I had found the right pieces, but when copying the final answer, I wrote three separate factors:
\(\displaystyle \frac{1}{2\sqrt{x+\sqrt{x+\sqrt{x}}}}\left(1+\frac{1}{2\sqrt{x+\sqrt{x}}}\right)\left(1+\frac{1}{2\sqrt{x}}\right)\quad\text{(wrong)}\)
But the factor \(\left(1+\frac{1}{2\sqrt{x}}\right)\) comes from the derivative of \(\sqrt{x+\sqrt{x}}\): it must stay inside the bracket, attached to \(\frac{1}{2\sqrt{x+\sqrt{x}}}\). The two expressions do not give the same value (try \(x=2\)).
Reflex: first write \(u\) and \(u'\) separately, then substitute while keeping large brackets.
Trap 3 — Forgetting that the answer repeats (exercise 5)
On \(\mathbb{R}\), a trigonometric function is periodic. Giving only \(\frac{\pi}{2}\) and \(\frac{3\pi}{2}\) is incomplete: you must add \(+2k\pi\), with \(k\in\mathbb{Z}\). There are infinitely many horizontal tangents.
One more tip: when two equations give the same solution (here \(\frac{3\pi}{2}\)), count it only once.
My Handwritten Notes
Here are a few pages from my review. The corrections in red show the mistakes I went back to fix.
Exercises 6 to 8: abstract functions and asymptotes.
7. Twin Exercises
Same method, new functions. Try them before opening the answers.
- Differentiate \(y=\sqrt{x+\sqrt{x}}\).
- Differentiate \(y=e^{\sin(x^2)}\).
- Find the \(x\in[0,2\pi]\) where \(g(x)=\sin x+\cos^2x\) has a horizontal tangent line.
- We know that \(g(3)=5\) and \(g'(3)=2\). Find \(\left(x\,g(x)\right)'\) and \(\left(\dfrac{g(x)}{x}\right)'\) at \(x=3\).
Show answers
- \(y'=\dfrac{1}{2\sqrt{x+\sqrt{x}}}\left(1+\dfrac{1}{2\sqrt{x}}\right)\)
- \(y'=2x\cos(x^2)\,e^{\sin(x^2)}\)
- \(g'(x)=\cos x-2\sin x\cos x=\cos x\,(1-2\sin x)=0\): \(x=\frac{\pi}{6},\ \frac{\pi}{2},\ \frac{5\pi}{6},\ \frac{3\pi}{2}\)
- \(\left(xg\right)'=g+xg'=5+6=\) 11; \(\left(\frac{g}{x}\right)'=\frac{xg'-g}{x^2}=\frac{6-5}{9}=\) \(\frac{1}{9}\)
Continue Your Review
- Calculus Exam Review: 2 Traps That Cost Points (√x² and √(x+h))
- Calculus Review: Limits, Derivatives and the Chain Rule — 16 Solved Exercises
- 6 CEGEP Calculus Mini-Tests: Limits, Derivatives and Tangents
StudyGroup AN — Mathematics, physics and chemistry exercises and solutions for CEGEP students.
Review: Yootak Hong, PhD


