Applying Chain Rule to more than two functions
Matthew Martinez
I understand how to apply the chain rule to two functions, but trip up when it comes to three or more.
Given $f~(x~)= x~\sqrt{1-x^{2}}$, I can see there are three values:
$a: 1-x^{2}$
$b: \sqrt{a}$
$c: x~\cdot b$
Now, $$f(b(a))= \frac{1}{2~\sqrt{1-x^{2}}}~\cdot~2x= x \sqrt{1-x^{2}},$$ but how do I factor in the last x value?
Am I on the right track here?
$\endgroup$3 Answers
$\begingroup$The way you're trying to break up your function isn't quite right. The step where $x$ is multiplied with $\sqrt{1-x^2}$ should be seen as a product, not a composition. So you could look at this as $f(x)=g(x)\cdot h(x)$, where $h(x)=b(a(x))$ with $a$ and $b$ are as you defined them and $g(x)=x$. You can apply the product rule first, and only apply the chain rule for the part where you differentiate $h(x)$:
$$f'(x)=g'(x)h(x)+g(x)h'(x)=h(x)+xb'(a(x))a'(x)=\sqrt{1-x^2}+x\frac{1}{2\sqrt{1-x^2}}(-2x),$$ etc. (You had a sign error in the derivative of $a$.)
The other problem is the notation where you wrote
$$f(b(a))= \frac{1}{2~\sqrt{1-x^{2}}}~\cdot~2x= x \sqrt{1-x^{2}}.$$
This doesn't really make sense. $f(b(a))$ is something different entirely from what you want to consider. The middle term is an attempted derivative of $b(a(x))$. And the right-hand term is $f(x)$. Thus, none of these are equal, and "$=$" is best reserved for equality, both to avoid errors and to allow meaningful communication to others (such as to whomever grades your assignment if this is for a class).
$\endgroup$ $\begingroup$If you know how to apply the chain rule for two functions, then the simplest thing to do to avoid getting tripped up is to the work one step at a time. For instance, \begin{eqnarray*} \frac{d}{dx}c\Biggl(b\Bigl(a(x)\Bigr)\Biggr) &= c'\Biggl(b\Bigl(a(x)\Bigr)\Biggr)\Biggl(b\Bigl(a(x)\Bigr)\Biggr)'\\ &= c'\Biggl(b\Bigl(a(x)\Bigr)\Biggr)\Biggl( b'\Bigl(a(x)\Bigr)\Bigl(a(x)\Bigr)'\Biggr)\\ &= c'\Biggl(b\Bigl(a(x)\Bigr)\Biggr)b'\Bigl(a(x)\Bigr)a'(x). \end{eqnarray*}
That said, in your example, you should not think of $f(x)$ as the composition of three functions, but rather first and foremost as a product, so the first thing you should do is apply the product rule, $(gh)' = g'h + gh'$, with $g(x) = x$ and $h(x) = \sqrt{1-x^2}$.
(If you want to think about $c$ as a function of the form $c(u) = xu$, then what would the derivative of $c$ with respect to $x$ be? First you would use the product rule: $\frac{d}{dx}c(u) = \frac{d}{dx}(xu) = u + x\frac{du}{dx}$, and then you would find the derivative of $u$.)
$\endgroup$ 4 $\begingroup$You want to work you're way from the outside in to take derivatives.
First, apply the product rule to $x$ and $\sqrt{1-x^2}$. That is, $f'(x)g(x)+f(x)g'(x)$
In this case, you can let $f(x)=x$ and $g(x)=\sqrt{1-x^2}$.
$$1*\sqrt{1-x^2} + x(\sqrt{1-x^2})'$$
Now you have only 2 functions to work with. The outer square root function and the inner square function.
Now you get:
$$\sqrt{1-x^2} + x(\frac{1}{2}(1-x^2)^{-1/2}(-x^2)')$$
And finally:
$$\sqrt{1-x^2} + x(\frac{1}{2}(1-x^2)^{-1/2}(-2x))$$
Which you can simplify to:
$$\sqrt{1-x^2} + \frac{-x^2}{\sqrt{1-x^2}}$$
And further to:
$$\frac{-2x^2+1}{\sqrt{1-x^2}}$$