# Evaluating Functions

A function is a mapping between an input and an output. For example, the function \(f(x) = x^2\) takes an input, \(x,\) and returns its square, \(x^2.\) In this case, \(f(2) = 2^2 = 4,\) \(f(\sqrt{3}) = \left(\sqrt{3}\right)^2 = 3,\) and so on. The key difference between a function and a more general relation is that for every input to a function, there is exactly one output.

What is the value of the function \( f(x) = 3x - 5 \) at \( x = 5 \)?

We see that we want to evaluate \( f(5) \), where \( f(x) = 3x-5 \). Thus, \[ f(5) = 3(5)-5 = 15-5 = 10. \ _\square \]

Sometimes when mapping between an input and output the input can be another function, that maps to another input. This is called a composite function . When evaluating a composite function, first we compose the function and evaluate the result as we do any other function

## Given that \(f(x)=\frac{3x}{x-1}\) and \(g(x)=\frac{x}{1-2x}\) what is the value of the function \((f \circ g)(x)\) at \(x=1\)?

First compose the function:

\[\begin{align} (f \circ g)(x)= f(g(x))=f\left( \frac { x }{ 1-2x } \right) &=\frac { 3\left( \frac { x }{ 1-2x } \right) }{ \frac { x }{ 1-2x } -1 }\\ &=\frac { 3x }{ 3x-1 }. \end{align}\]

Now, evaluate the function \(f(g(x))=\frac { 3x }{ 3x-1}\) at \(x=1:\)

\[f(g(1))=\frac{3(1)}{3(1)-1}=\frac{3}{2}.\]

## Given that \(f(x)=x^{2}-1, g(x) = x+1\) and \(h(x)=2x\), what is the value of the function \((f\circ g\circ h)(x)\) at \(x=3\)?

First compose the function:

\[\begin{align} (f\circ g\circ h)(x)=f(g(h(x))) &=f(h(x)+1)\\ &={ (h(x)+1) }^{ 2 }-1\\ &={ (2x+1) }^{ 2 }-1\\ &=4{ x }^{ 2 }+4x. \end{align}\]

Now, evaluate \(f(g(h(x)))=4x^{2}+4x\) at \(x=3:\)

\[4(3)^{2}+4(3)=48.\]

## Given that \(f(x)=ax+3\) and \(g(x)=3x\), for what value of \(a\) is \((f\circ g)(4)=9\)?

Compost the function and evaluate at \(4:\)

\[(f\circ g)(4)=f(g(4))=12a+3.\]

Equate this to \(9\) to obtain

\[12a+3=9 \Rightarrow a=\frac { 1 }{ 2 } .\]

## What is the value of the function \((x-3)(x+13)(x-4)(x-6)+23\) at \(x=4\)?

We could Just plug in \(4\) in every place of \(x,\) but notice that \(x-4=0\) when \(x=4,\) which will collapse all the product terms with it. Thus,

\[(x-3)(x+13)(0)(x-6)+23=0+23=23.\]

Sometimes a function is given as a piecewise defined function which is a function defined by multiple sub-functions. Each sub-function is defined by a certain interval or conditions.

## Given the following function:

\[ f(x)= \begin{cases} 3x+1 & x>3 \\ 2x & -1\le x\le 3\\ 3 & x<-1, \end{cases} \] what is the value of \(f(7)+f(3)+f(0)+f(-100)\)?

Based on the piecewised function above, if \(x>3,\) we evaluate over the function \(f(x)=3x+1.\) If \(x\) is between \(-1\) and \(3\) inclusive, then we evaluate over the function \(f(x)=2x.\) If \(x<-1,\) we evaluate over the function \(f(x)=3.\)

\[\begin{align} f( 7) +f(3) +f( 0 ) +f( -100 ) &=(3(7)+1)+(2(3))+(2(0))+3\\ &=22+6+3\\ &=31. \end{align}\]

**Cite as:**Evaluating Functions.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/evaluating-functions/