## Composing Functions

A function tells you what to do with an argument.
If
$f(x)=3x+2$
,
$x$
is the argument and
$f$
is the function which says ' multiply the argument by three then add two'.
Looking at functions this way is especially useful when composing functions.
Suppose
$f(x)=3x+2, \: g(x)=x^2+x$

$f(g(x))$
means 'take the argument
$g(x)$
, multiply it by three then add two'.
$f(g(x))=3g(x)+2=3(x^2+x)+2=3x^2+3x+2$

and
$f(g(1))=3g(1)+2=3(1^2+1)+2=8$