2.2: Nonlinear Functions
- Page ID
- 83918
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)For most of this chapter we have restricted ourselves to functions that were either linear functions or polynomial functions where they are built from the interaction of linear functions. While this makes the economic models easier to understand, it is pretty clear that the situations we care about are often better described by more complicated functions. Suppliers of gasoline have a finite amount they can deliver regardless of the price. That leads to a very nonlinear supply function. It is worthwhile to review how we would enter other functions in a spreadsheet.
Algebraic Functions.
We start with the algebraic functions that should be familiar from previous courses. These functions will let us use all the models that were mentioned in Chapter 1. For this table, we will assume the input to the function has been stored in cell A1.
| Algebraic Entry | Spreadsheet Entry | Notes |
| \(f(x)=\sqrt{2x+7}\) | =SQRT(2*A1+7) |
* needed for multipliciation |
| \(f(x)=\sqrt[3]{2x+7}\) | =(2*A1+7)^(1/3) |
other roots done as fractional exponents |
| \(f(x)=x^4\) | =A1^4 |
|
| \(f(x)=-x^4\) | =-(A1^4) |
Excel does negation before exponentiation |
| \(f(x)=\ln(x)\) | =LN(A1) |
Log base \(e\) or natural log |
| \(f(x)=\log_{10}(x)\) | =LOG10(A1) |
Log base 10 or common log |
| \(f(x)=\log_{2}(x)\) | =LOG(A1,2) |
Log to another base |
| \(f(x)=1.06^x\) | =1.06^(A1) |
|
| \(f(x)=e^x\) | =EXP(A1) |
|
| \(f(x)=e^{(-x^2)}\) | =EXP(-(A1^2)) |
Parentheses needed for correct evaluation |
| \(f(x)=|x|\) | =ABS(A1) |
Absolute value |
Consider a demand function and why it is probably not linear. We expect demand to go up whenever we drop the price. However with a linear function, we get the same increase in demand by cutting the price in half, or if from half price we give the product away for free. A more reasonable model may be a power function where decreasing the price by a fixed percentage increases consumption by a fixed percentage. Similarly when we think about the supply function, we often expect the limits on available materials to make increasing the supply progressively more expensive.
Figure \(2.3.2.\) Video presentation of this example
We are interested in selling gizmos. The most a consumer will pay is $1,000. If we drop the cost by 10% we increase demand by 100. The cheapest that a supplier will sell for is $200. We find the market will produce another 100 gizmos whenever we increase the price by 20%. Find the market equilibrium.
Solution
We start by converting our information about supply and demand into equations, plugging the equations into Excel, and sketching a graph. We then use Goal Seek to find where the two equations are equal.
\begin{align*} \text{Demand Price}(\text{quantity})\amp =1000*(0.9)^{(\text{quantity}/100)}\\ \text{Supply Price}(\text{quantity})\amp =200*(1.2)^{(\text{quantity}/100)}\text{.} \end{align*}


We see that the equilibrium price is at $554.64. At that price the supply and demand will both be 559.45.
Figure \(2.3.4.\) Video presentation of this example
We have the following table of data for demand price and costs for our product.
| Quantity | 100 | 300 | 500 | 1000 | 1500 |
| Demand Price | $35.35 | $21.63 | $17.25 | $12.70 | $10.26 |
| Costs | $2347.67 | $5040.00 | $7481.67 | $12469.67 | $16196.00 |
We have reason to believe that my demand price is a power function of some kind. Our cost function is close to linear, but we can get volume discounts and reduce the per-unit cost with larger quantities. Thus we expect my cost function is actually quadratic, with the quadratic term much smaller than the linear term. Find best fitting curves for cost and price. Derive functions for revenue and profit. Find break-even points between 10 and 1500.
Solution
I start by finding best-fit curves of for cost and price.


Thus we have:
\begin{align*} \text{cost}(q) \amp =-0.0028q^2+14.353q+968.13\\ \text{price}(q) \amp =286.02 q^{-0.453}\text{.} \end{align*}
Next, we follow our models to get equations for revenue and profit.
\begin{align*} \text{revenue}(q) \amp =q*\text{price}(q)=q 286.02 q^{-0.453}=286.02 q^{0.547}\\ \text{profit}(q) \amp = \text{revenue}(q)-\text{cost}(q)=286.02 q^{0.547}+0.0028q^2-14.353q-968.13\text{.} \end{align*}
Finally, we load these equations back into Excel and use Goal Seek to find the break-even points. Looking at projected profit on the chart we see a sign change near 1000, so we suspect a break-even point there. We also note that profit seems to be going up until \(q\) is about 300, so I test for a break-even point for small values of \(q\text{.}\)


We see we have break-even points when q is 12.74 and 996.28.
Discontinuous Functions.
All of the functions above have graphs without breaks. In mathematical terms, they are continuous functions. When we are modeling real world phenomena, we also want to use functions that have breaks in the graph. Paint is typically bought in gallon containers, so the price to paint a room is based on the number of gallons rounded up to the next whole number. Many businesses will give a volume discount to their best customers, so there is one price for small quantities and a different price for large quantities. The cost of labor changes if overtime pay is involved. In all of these cases the graph has a break in it.
Excel has several discontinuous functions that are of use to us.
| Function | Example | Value | Notes |
| ROUND | ROUND(2.347,1) | 2.3 | 2.35 would round to 2.4 |
| ROUNDDOWN | ROUNDDOWN(2.99,0) | 2.0 | 0 for digits rounds to integers |
| ROUNDUP | ROUNDUP(-2.132,2) | -2.14 | Up is away from 0. |
| CEILING | CEILING(3.14159,1.5) | 4.5 | Rounds up to a multiple of 1.5 |
| FLOOR | FLOOR(3.14159,2) | 2 | Rounds down to a multiple of 2. |
| IF | IF(\(2 \lt 1\text{,}\)5,10) | 10 | The condition is false. |
| MIN | MIN(1, 3, 5) | 1 | The minimum of a list of values. |
| MAX | MAX(1, 3, 5) | 5 | The maximum of a list of values. |
The functions ROUND, ROUNDUP, and ROUNDDOWN are all used for rounding. They have a second argument that specifies the number of digits to which we are rounding. It should be noted that Excel understands up and down as away from zero for negative numbers. Thus it will round \(-1.5\) up to \(-2\text{.}\) The CEILING and FLOOR functions also do rounding, but with some different features. Instead of specifying the number of digits in the answer, these functions round to a multiple of the second argument. As expected, CEILING rounds to the next higher multiple, and FLOOR rounds to the next lower multiple.

Figure \(2.3.5.\) Video discussion of discontinuous functions in Excel
Figure \(2.3.7.\) Video presentation of this example
The raw material needed to build widgets is sold in blocks that will make 100 widgets. A block costs $1000. The labor cost for building a widget is $7. The fixed costs for widget production is $10,000. Find a formula for the costs of producing widgets. Find the cost of producing 998 and 1009 widgets. You should also find the cost per unit at those quantities.
Solution
To make the worksheet easier to follow, we break costs into three pieces, fixed costs labor costs, and materials costs. The fixed coasts are constant, and the labor costs are linear. For the materials costs we need to use the CEILING function to round the number of widgets up to the next even 100, then divide by 100 to obtain the number of blocks of raw material we want to buy.

When we look at the numbers we see that the total cost of producing 998 widgets is $26,986 and the cost of producing 1009 widgets is $28,063. When we look at the unit costs, we expect the cost per unit to generally go down as we produce more, since the fixed costs are distributed over more units. However the per unit cost is $27.04 when we produce 998 widgets, but that goes up to $28.81 when we make 1009 widgets, since we had to buy another block of raw material.

The IF command is used when we use different formulas for different cases. Some easy examples are overtime pay, benefits costs, and volume discount. In many work situations employees are paid one rate up to a certain amount of work and a second rate for additional work. It is also common for full time employees to receive certain benefits, like retirement, that are not offered to part time employees. It is also common for certain industries to offer different rates for their biggest and best customers. The basic syntax of the IF command is:
IF(test condition, value if condition is true, value if condition is false)
The values for true and false can be numbers, string, or formulas to evaluate.
Figure \(2.3.9.\) Video presentation of this example
I am a bookkeeper at a small firm. Company policy pays the employees time and a half for working more than 40 hours per week. I need to compute the weekly pay of 5 employees. The employees worked 35, 42, 43, 38, and 42.5 hours. Their base pay rates were respectively $8, $9, $10, $11, and $12 an hour. Compute the pay for each employee.
Solution
In setting up the worksheet, I will separate regular pay from overtime pay. The regular pay is the base rate times the hours worked, unless the employee worked more than 40 hours, in which case it is the base rate times 40. Overtime pay is the base pay times 1.5 times the number of overtime hours. Since overtime cannot be negative we use the maximum of 0 and hours worked minus 40.

Looking at the computed values, the employees are owed $280, $387, $445, $418, and $525, respectively.

If our functions are discontinuous, we need to exercise a bit of care with our economic models and the points of interest we have been finding. The market equilibrium and break-even points are both places where two functions are equal. When the mathematics does not give us a clear answer we should think about the problem and consider what answer makes the most sense. Consider a simplified example to illustrate the point.
Figure \(2.3.11.\) Video presentation of this example
In the widget market the supply is constrained. Obtaining more than 2 widgets means using a more expensive process. My supply and demand curves are:
\begin{align*} \text{demand price}(q)=4-q/2\\ \text{supply price}(q)=\begin{cases} 1q/2+1&q\le 2\\ 1q/2+3&q>2\\ \end{cases}\text{.} \end{align*}
Find the market equilibrium price.
Solution
We would like to find the place where the two curves cross. However when we look at a graph of the two functions we see that they never meet.

It is clear from the graph that the market should reach equilibrium at a quantity of 2, but it is not clear what the equilibrium price should be. We need to do some reasoning about the behavior described by the equations. From our formula, the supply price for 2 widgets is $2. However if we look at the supply prices of \(2+h\) for small values of \(h\text{,}\) we see that the limit of the supply price from above is $4. In practical terms the suppliers will produce 2 widgets for any price from $2 to $4. If we offer $2, they are also willing to produce 2 widgets. If we offer a price of $3.95, they are still only willing to produce 2 widgets. The suppliers will be thus willing to produce 2 widgets at a price of $3. The equilibrium price is 3.
If we want to look at the graph in Excel, it is useful to plot points very close to the discontinuity on both sides. For this problem, we might look at both 2 and 2.0001.

A lesson to remember is that we need to pay attention to places where our functions are discontinuous and that we need to understand what our economic model should do when the curves do not cross. For example, we will understand the break-even point to be the first point where revenue is greater than or equal to costs. In the continuous case, this reduces to our old definition.
class="ExercisesExercises 2.3 Nonlinear functions
- For Exercise \(2.3.1–2.3.5\), given the equations of the supply and demand curves:
- Evaluate the curves at \(q_0\text{.}\)
- Find the market equilibrium.
Given \(\text{supply price}=20*(1.1)^{(q/10)}\) and \(\text{demand\ price}=50*(0.95)^{(q/10)}\text{,}\) with \(q_0=10\text{.}\)
- Answer
-


Formulas


Table
- At \(q_0=10\text{,}\) supply = $22, and demand = $47.50
- Using Goal Seek we see that the equilibrium occurs at \(q = 62.5\) and the price is $36.29
Given supply \(\text{price}=10*(1.05)^{(q/10)}\) and \(\text{demand price}=60*(0.96)^{(q/10)}\text{,}\) with \(q_0=10\text{.}\)
Given \(p_s=5 \ln(q+10)\) and \(p_d=1000/(q+10)-2\text{,}\) with \(q_0=40\text{.}\)
- Answer
-


Formulas


Table


Goal Seek near \(q=40\)
- At \(q_0=40\text{,}\) supply = $19.56, and demand = $18
- Using Goal Seek we see that the equilibrium occurs at \(q = 37\) and the price is $19.25
Given \(supply\ price=10 \ln(q+2)\) and \(demand\ price=60*(0.90)^{(q/100)}\text{,}\) with \(q_0=6000\text{.}\)
Given
\[ \text{supply price}(q)=\begin{cases} 20*(1.1)^{(q/10)}&q \le 50\\ 20*(1.1)^{(q/10)}&q \gt 50\\ \end{cases} \nonumber \]
and
\[ \text{demand price}(q)=50*(0.095)^{(q/10)}\text{,} \nonumber \]
with \(q_0=40\text{.}\)
- Answer
-
For this problem our supply price function changes at \(q = 50\text{.}\) This is indicated in the table by a thin blue column.


- At \(q_0=40\text{,}\) supply = $29.28, and demand = $40.73
- The equilibrium occurs somewhere between \(q = 60\) and \(q = 70\text{.}\) Using Goal Seek we find that the equilibrium occurs for \(q = 62.43\)
- For Exercise \(2.3.6–2.3.8\), given the supply and demand data:
- Find best fitting equations of the supply and demand curves, using the assumptions given in the problem.
- Find the market equilibrium.
- Find the projected supply and demand prices for the extra quantities given.
Given the data
| Quantity | 100 | 120 | 140 | 160 | 180 | 155 |
| Supply price | 32 | 35.5 | 39 | 42.6 | 47 | |
| Demand price | 47.2 | 42.5 | 38.3 | 34.5 | 31 |
and the assumption that supply price and demand price are both exponential.
Given the data
| Quantity | 5017 | 5937 | 7003 | 8070 | 9017 | 9943 | 7500 |
| Supply price | 17.5 | 19 | 20.4 | 23.7 | 25.1 | ||
| Demand price | 29.6 | 26.7 | 21.3 | 19.2 | 17.6 |
and the assumption that supply price is linear and demand price is exponential.
- Answer
-


- Using the trendline feature from Excel we get that
\begin{align*} \text{Supply} \amp= 0.0015x + 9.7518 \\ \text{Demand} \amp = 50.214e^{(-0.0001x)}\text{.} \end{align*}
- See the tables below.
- See the tables below.


Formulas entered


Finding all valuers with these formulas. The yellow ones are the ones we are looking for.


Using Goal Seek to find the equilibrium values in column E
- Using the trendline feature from Excel we get that
Given the data
| Quantity | 1009 | 1469 | 2041 | 2462 | 3002 | 3517 | 3979 | 3200 |
| Supply price | 98 | 106 | 112 | 120 | 1231 | 126 | ||
| Demand price | 160 | 144 | 116 | 102 | 82 |
and the assumption that supply price is linear and demand price is exponential.
- For Exercise \(2.3.9–2.3.15\), for the given functions:
- Give the excel command that will produce the following function with the assumption that x is in cell A2.
- Give a chart of the values of the function evaluated as x goes from 0 to 100 in steps of 5.
- A graph of the function.
- A list of x-values where the function is discontinuous. (Where the graph jumps.)
Let
\[ f(x)=\begin{cases} \ln(2x)&x \le 50\\ 200\exp(-x/10)&x \gt 50\\ \end{cases}\text{.} \nonumber \]
- Answer
-
- The Excel command is
=IF(A2 < =50, LN(2*A2),200*EXP(-A2/10)) - The chart is produced by the following code.


- The graph will look as follows. Note that the function is not defined at 0.


- The function is not continuous at \(x = 50\text{.}\) Note that the function drops from near 4.5 to about 1 rather suddenly.
- The Excel command is
Let
\[ f(x)=\begin{cases} \sqrt{2x+21}&x \le 50\\ 10\sin(x/5)&x \gt 50\\ \end{cases}\text{.} \nonumber \]
The cost of shipping an item is $2 per pound, or fraction thereof, with a minimal cost of $5.
- Answer
-
- The function is
=MAX(2*A2,5) -


- The function is


