Functions of two variables
In the textbook: Ch. 8 Analysis von Funktionen mit zwei Variablen
Until now a function had one variable, a number we change: for cost, the quantity. However many pieces are made, that decides the cost. In real life a result often depends on two things at once. Then the function has two variables, and a single derivative is no longer enough. This article shows how to read such functions and how to tell which of the two variables moves the result more.
Imagine a small bakery. How much bread it bakes in a day depends on two things: how many bakers it has and how many ovens. One does not work without the other: a baker without an oven has nowhere to bake, and an oven without a baker stays cold.
Right now the bakery has 4 bakers and 9 ovens and bakes 60 loaves a day. The owner wants to bake more. Her money covers one of two things:
- hire one more baker;
- or buy one more oven.
Which should she choose? To answer, she tries both options one after the other, and each time she changes only one thing:
| Bakers | Ovens | Loaves a day |
|---|---|---|
| 4 | 9 | 60 |
| 5 | 9 | 67 |
| 4 | 10 | 63 |
The fifth baker, with the same ovens, gives 7 extra loaves. The tenth oven, with the same bakers, gives only 3. Now the owner has something to compare: if a baker costs no more than two ovens, hiring the baker pays off.
This very step is the core of the chapter. When a result depends on two quantities, you leave one as it is and look at what a change in the other brings. The increase you get this way is called the partial derivative: “partial” because only one of the variables changes. Below you learn to compute it with a formula instead of a table, and what else it solves in the exam: how much of one input replaces another and how best to spend a given budget.
In the exam only the setting changes:
| In this article | In the exam |
|---|---|
| a bakery | a plant, a farm or a shop |
| bakers and ovens | labour and capital or two goods |
The questions are the same ones the owner asked herself. Derivatives of functions of one variable (power rule, , , chain rule) are explained in the article “What the derivative is: slope and the rules”. After this article you can:
- find the value at a point;
- find a partial derivative;
- find the second derivatives;
- read a level curve;
- find the slope of a level curve;
- find the maximum under a constraint, for example with a given budget.
The function of two variables
The bakery from the start gave the output for only three combinations of bakers and ovens. To get it for any combination the relationship is written as a formula. That is done for any kind of production, not only for the bakery. The output of a factory depends on the number of workers and on the number of machines. Such a dependence is written as a function of two variables: takes two numbers and gives back one. An example: . At the point the value is . The first number in the brackets is always , the second .
The values are easy to show in a table:
| 1 | 2 | 4 | |
| 2 | 4 | 8 | |
| 4 | 8 | 16 |
If you put a column of height over every point of the floor, the tops of the columns form a surface, like a landscape. You do not have to draw it in the exam. You need two moves: slice the surface along one axis (that is the partial derivative) and look at it from above like a height map (those are the level curves).
Partial derivative: hold one variable fixed
The bakery owner already made the first of the two moves when she kept the ovens as they were and added a baker. On the surface this is a slice along one axis. Hold fixed. Then is a function of the one variable , a slice through the surface. Its slope is the partial derivative with respect to (“partielle Ableitung”), written or . The rule: differentiate with respect to as usual and treat as a number. For the other way round.
For this you need two rules for one variable, both from the article on the derivative:
- The derivative of a sum is the sum of the derivatives. Example: .
- A constant factor stays, a number without a variable gives 0. Example: , .
In the partial derivative, “number” also means the other variable. An example with respect to : , but , because there is no in .
The function at the point :
For the number is : the factor stays, , and the term , which has no , gives 0. For the number is : the factor stays, , and .
Back to the bakery from the start of the article. Its output is described by this formula:
Here stands for bakers, for ovens and for loaves a day: . The partial derivatives at the point :
That gives 7.5 and 3.3 loaves. In the introduction the owner counted 7 and 3 when she added a whole baker and a whole oven. The partial derivative shows how fast output grows at the point itself, which is why the numbers differ a little.
What the number means: if grows by 1 and stays the same, grows by about . For output this quantity is called the marginal product (“Grenzproduktivität”).
Your turn1 of 1
Given . What is at the point ?
Second-order partial derivatives
A partial derivative can be differentiated once more. For this gives:
- differentiated again with respect to gives , with respect to gives ;
- gives 0 with respect to and again with respect to .
This gives (twice with respect to ), (twice with respect to ) and the mixed one (first with respect to , then ). Both mixed ones came out as : for the functions in the exam the order does not matter, . All together:
The four numbers go into a table, the Hessian matrix (“Hesse-Matrix”) : and on the diagonal, the mixed twice, off it. At the point we get , and :
The next section reads the Hessian to tell a peak, a pit and a saddle apart.
Peak, pit, saddle
Where both partial derivatives are zero the surface is flat, but a peak, the bottom of a pit and a mountain pass are all flat. The second derivatives from the previous section help to tell them apart. Compare three surfaces over the point :
- ;
- ;
- .
For all three, both partial derivatives are 0 there. For example, and give 0 and 0 at . A point where and both hold is called a stationary point (“stationärer Punkt”). But the surfaces over it look different.
Which case it is shows in the number , the determinant of the Hessian. You multiply by and subtract the square of the mixed .
- If , the surface goes up in one direction and down in the other: a saddle.
- If , both directions go the same way: a peak or a pit.
| along the -axis () | : down on both sides | : up | : up |
| along the -axis () | : down | : up | : down |
| second derivatives (twice in , twice in , mixed) | , , 0 | 2, 2, 0 | 2, , 0 |
| determinant | 4 | 4 | |
| what lies at | peak, maximum | pit, minimum | saddle |
A saddle (“Sattelpunkt”) is like a mountain pass: in one direction the point is the lowest, in the other the highest, so it is neither a maximum nor a minimum. The determinant of the Hessian tells the three cases apart: with it is a saddle; with a peak if and a pit if . How this is used in tasks is shown in the method “Extrema in two variables and maximum profit”.
Level curves
Look at the surface from above. All points with the same height, , form a level curve (“Niveaulinie”, “Höhenlinie”), like the contour lines on a map. Take again: its level curve 4 passes through , and . In the table of values of in the section “The function of two variables” these are all the cells with the number 4. The figure shows three level curves, , and ; the further from the origin, the higher.
In economics level curves have their own names:
- Isoquant (“Isoquante”): all combinations of inputs with the same output, for example all combinations of workers and machines that give 100 pieces a day.
- Indifference curve (“Indifferenzkurve”): all combinations of two goods with the same utility, for example bread and milk that please a buyer equally.
- Budget line (“Budgetgerade”) , with the prices and of the goods: all combinations that cost exactly the budget , for example with € and prices 2 € and 1 € the combinations and .
The total differential
For at the point we still have and . We write the changes as and : grows by 0.1, falls by 0.2. The contribution of each move is worked out separately:
- the move in changes by about ;
- the move in changes it by about ;
- together .
Exactly: , and , close.
It always works like this: if both variables change, their contributions add up. Moving by gives about , moving by gives about . The sum is called the total differential (“totales Differential”):
The slope of the level curve
Along a level curve does not change, so . The total differential gives the slope of the curve without writing in terms of :
On the curve at the point the partial derivatives are and , the slope is . Check: on this curve , the derivative is , at that is .
The ratio , the slope of the level curve without the minus, says how many units of one unit of replaces. On the isoquant it is called the marginal rate of technical substitution (“Grenzrate der technischen Substitution”, GRS), on the indifference curve the marginal rate of substitution (“Grenzrate der Substitution”).
Maximum under a condition
The bakery owner's money was enough for only one thing, a baker or an oven. That is almost always so: the choice is limited by money. The best choice within that limit is found from the level curves and their slope. A buyer has 8 € for two goods, one unit of costs 2 €, one unit of costs 1 €, and the utility measures how good a bundle is. Which bundle should he choose?
Money limits the choice: only bundles on the budget line qualify. Such an equation is called a condition or constraint (“Nebenbedingung”). Without it there is no answer: the more of both goods, the higher .
The figure shows the line and three indifference curves:
- The curve crosses the line twice: these bundles are affordable, but a higher curve is within reach.
- The curve does not reach the line: such bundles are too expensive.
- The best curve within reach touches the line at one point. There the slopes of the curve and the line are equal.
- Slope of the indifference curve by the formula from the section “The slope of the level curve”: .
- Slope of the line: .
- Equal slopes: , that is .
- Into the budget: , , , utility .
This holds in general: at the optimum under a condition the level curve of the goal touches the line of the condition, and the slopes agree. For a budget with prices and this is
On the left is the marginal rate of substitution, on the right the price ratio. The method “The Lagrange method and implicit functions” writes this condition down step by step. It also covers other conditions, such as a set output or two plants.
The topic in a minute
- Value at a point : put in both numbers. Trap: swapping the order; means , .
- Partial derivative : the derivative with respect to , with treated as a number. Example: . Trap: differentiating as well.
- A sum term by term: , a term without gives 0. Common mistake: writing 4 or 0, while .
- Second derivatives , , the mixed one . Trap: the mixed one is forgotten.
- Level curve : a curve in the - plane on which the value stays the same (isoquant, indifference curve). Trap: it is not the graph of .
- Total differential . Trap: putting in the new values instead of the changes , .
- Slope of the level curve . Trap: turning the fraction upside down or losing the minus.
- Maximum under a constraint: at the optimum the level curve of the goal touches the constraint line, . Trap: looking for the maximum without the constraint; has none.
- Formula sheet (“Formelsammlung”, printed in the exam booklet after the tasks): the formula for the slope of the level curve is on it in other letters; the translation into our notation is in the section “Implicit derivative: slope of the isoquant”.
What comes next
- Partial derivatives at a point, second derivatives and the Hessian matrix, the chain rule along a curve, the directional derivative: the method “Partial derivatives and the chain rule”.
- Maximum and minimum without a constraint, the profit over two prices: the method “Extrema in two variables and maximum profit”.
- Slope of the isoquant and GRS, maximum utility on a budget, minimum cost: the method “The Lagrange method and implicit functions”.
- How to recognise the method from the task: “Which way?”.
Was this article helpful?