# If f(x)= - x^2 + x  and g(x) = sqrtx + x , how do you differentiate f(g(x))  using the chain rule?

May 17, 2018

$- 1 - 2 \sqrt{x} - \frac{x}{\sqrt{x}} - 2 x$

#### Explanation:

Assuming you already know the chain rule. If not:
Given $h \left(x\right)$ is a composite function consisting of 2 functions such that $h \left(x\right) = f \left(g \left(x\right)\right)$, $h ' \left(x\right) = f ' \left(g \left(x\right)\right) g ' \left(x\right)$.

So, in this scenario, $f ' \left(x\right) = - 2 x$ and $g ' \left(x\right) = \frac{1}{2 \left(\sqrt{x}\right)} + 1$
Substitute $g \left(x\right)$ into $f ' \left(x\right)$:
$- 2 \left(\sqrt{x} + x\right)$
And multiply by $g ' \left(x\right)$:
$- 2 \left(\sqrt{x} + x\right) \cdot \left(\frac{1}{2 \sqrt{x}} + 1\right)$
$- 2 \left(\frac{1}{2} + \sqrt{x} + \frac{x}{2 \sqrt{x}} + x\right)$
$- 1 - 2 \sqrt{x} - \frac{x}{\sqrt{x}} - 2 x$