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

Jun 19, 2016

$f ' \left(g \left(x\right)\right) = 6 - 3 {e}^{3 x}$

#### Explanation:

$f \left(g \left(x\right)\right) = 2 \cdot \left(3 x\right) - {e}^{3 x}$
can be written again
$f \left(g \left(x\right)\right) = 6 x - {e}^{3 x}$
use chain rule
differentiate "outside" function first, and then differentiate "inside" function
$\frac{d}{\mathrm{dx}} f \left(g \left(x\right)\right)$
=$f ' \left(g \left(x\right)\right) = 6 - \ast 3 \ast {e}^{3 x}$
because 3x is "inside" function ，and it also need to differentiate