# 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\big(\sqrt{3}\big) = \big(\sqrt{3}\big)^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 composite function \((f \circ g)(x)\) at \(x=1\)?

First compose the function:

\[\begin{align} (f \circ g)(x)= f\big(g(x)\big)=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\big(g(x)\big)=\frac { 3x }{ 3x-1}\) at \(x=1:\)

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

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\Big(g\big(h(x)\big)\Big) &=f\big(h(x)+1\big)\\ &={ \big(h(x)+1\big) }^{ 2 }-1\\ &={ (2x+1) }^{ 2 }-1\\ &=4{ x }^{ 2 }+4x. \end{align}\]

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

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

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

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

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

Equate this to \(9\) to obtain \[12a+3=9 \implies a=\frac { 1 }{ 2 } .\ _\square\]

What is the value of the function \(f(x)=(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.\ _\square\]

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.

If function \(f\) is defined by \(f(x) = \begin{cases} 3x - 2 & , x > 3 \\ x^2 - 2 & , -2 \leq x \leq 2 \\ 2x + 1 & , x < -3 \\ \end{cases}\) then find the values, if exists, of

\(\begin{align} (i) f(4) & & (ii) f(2.5) \\ (iii) f(-2) & & (iv) f(-4) \\ (v) f(0) & & (vi) f(-7) \\ \end{align}\)

Note that the domain of \(f\) is \((- \infty , -3) \cup [-2,2] \cup (3, \infty)\)

\((i)\) Since \(f(x) = 3x - 2\) for \(x > 3\), we have \(f(4) = 3 \cdot 4 - 2 = 12 - 2 = 10\)

\((ii)\) 2.5 does not belong to domain \(f\), \(f(2.5)\) is not defined.

\((iii)\) Since \(f(x) = x^2 - 2, -2 \leq x \leq 2\), we have \(f(-2) = (-2)^2 - 2 = 4 - 2 = 2\)

\((iv)\) Since \(f(x) = 2x + 1, x \leq -3\), we have \(f(-4) = 2(-4) + 1 = -7\)

\((v)\) Since \(f(x) = x^2 - 2, -2 \leq x \leq 2\), we have \(f(0) = (0)^2 - 2 = -2\)

\((vi)\) Since \(f(x) = 2x + 1, x \leq -3\), we have \(f(-7) = 2(-7) + 1 = -14 + 1 = -13\)

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 ) &=\big(3(7)+1\big)+\big(2(3)\big)+(2(0))+3\\ &=22+6+3\\ &=31.\ _\square \end{align}\]

**Cite as:**Evaluating Functions.

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