Tutorials › Calculus III › Translating Two-Input Models into Functions

Domains and Function Representations · Tutorial 222 of 999

Translating Two-Input Models into Functions

Translate verbal models with two inputs into formulas, then evaluate and interpret their outputs.

Beginner 9 min read

What You'll Learn

  • Identify the two input quantities and the output quantity in a verbal model
  • Represent a two-input rule using function notation and an ordered input pair
  • Translate area, distance, and total-cost descriptions into formulas
  • Keep coefficients, input order, and units attached to their intended quantities
  • Evaluate a two-input function by substituting both specified inputs
  • Check whether a computed value agrees with the original description

From a Description to a Function

A model with two inputs describes how an output depends on two quantities that may vary. For example, the area of a rectangular garden depends on both its length and its width. A utility bill may depend on the amounts of two different resources used. In each case, the verbal description tells us what the inputs are, how they contribute, and what quantity the model produces.

Translating that description into a function makes the relationship precise. It also gives a consistent way to calculate the output for any specified pair of inputs in the model's domain. The order of the inputs matters: the first input must represent the quantity assigned to the first variable, and the second input must represent the quantity assigned to the second.

Definition: A two-variable function is a rule that assigns exactly one output to each ordered pair in a specified domain \(D\subseteq\mathbb{R}^2\). We write \(f:D\to\mathbb{R}\), and use \(f(x,y)\) to denote the output assigned to the input pair \((x,y)\). The variables \(x\) and \(y\) represent the two inputs; \(f(x,y)\) represents the output.

The word ordered is important. The pair \((x,y)\) records which value belongs to the first input and which belongs to the second. In general, \(f(x,y)\) and \(f(y,x)\) need not be equal. A function also has one output for each allowed input pair: if a model assigns two different outputs to the same pair, it has not defined a function.

A Reliable Translation Process

Read a verbal model by identifying its quantities before choosing a formula. A useful process is:

1
Name the inputs.
Decide which two quantities vary, and assign each one a variable. Record which quantity goes with which variable.
2
Name the output.
Identify what the model is meant to calculate, such as area, distance, or total cost.
3
Translate the relationship.
Use the operations specified by the description: a fixed amount is added, a per-unit rate is multiplied by its quantity, or two dimensions are multiplied to find area.
4
Write and evaluate the function.
State the formula with its input order. For a requested pair, substitute each value for its corresponding variable and interpret the result as the named output.

Variables are placeholders for quantities, not for their units. Units help explain what a value represents and what kind of quantity the output should be. For example, multiplying a length in meters by a width in meters produces an area in square meters. Keeping these meanings visible is a practical way to catch a mismatched formula or substitution.

Worked Example: Area from Length and Width

Worked Example: Area from Length and Width

A rectangular garden has length \(x\) meters and width \(y\) meters. Define a function for its area, then find the area when the length is \(8\) meters and the width is \(5\) meters.

The inputs are the length \(x\) and width \(y\); the output is the area. A rectangle's area is length multiplied by width, so define \(A(x,y)=xy\), where \(A\) is measured in square meters. For this example, use nonnegative lengths and widths.

$$ A(x,y)=xy $$

Substitute \(x=8\) and \(y=5\), keeping the length in the first position and the width in the second:

$$ A(8,5)=(8)(5)=40. $$

The garden's area is \(40\text{ m}^2\). Check the result against the description: \(8\) rows of area units along the length, each spanning \(5\) meters of width, give \(8\cdot5=40\) square meters. The formula and the units agree with the stated area model.

Worked Example: A Charge with Two Usage Rates

Worked Example: A Charge with Two Usage Rates

A monthly bill includes a fixed charge of \(\$12\), plus \(\$0.08\) for each unit of electricity and \(\$0.05\) for each unit of gas. Let \(x\) be the number of electricity units used and \(y\) the number of gas units used. Write the bill as a function and evaluate it when \(x=250\) and \(y=40\).

The output is the total bill, denoted by \(C(x,y)\). The fixed charge contributes \(12\) dollars. The electricity charge is its rate multiplied by its usage, \(0.08x\) dollars, and the gas charge is \(0.05y\) dollars. Thus the model is:

$$ C(x,y)=12+0.08x+0.05y. $$

Substitute \(x=250\) and \(y=40\) into their matching terms:

$$ \begin{aligned} C(250,40) &=12+0.08(250)+0.05(40)\\ &=12+20+2\\ &=34. \end{aligned} $$

The bill is \(\$34\). Check each contribution in the original description: electricity costs \(250(\$0.08)=\$20\), gas costs \(40(\$0.05)=\$2\), and the fixed charge is \(\$12\). Their sum is \(\$12+\$20+\$2=\$34\), as given by the function. The input values are amounts of usage, not dollar amounts; the output is in dollars.

Why the Rate Formula Works

The bill example uses a general translation rule. If one unit of a quantity costs \(r\) dollars, then \(x\) units cost \(rx\) dollars: there are \(x\) units, each contributing \(r\) dollars. If two separate usages have rates \(r_1\) and \(r_2\), their charges are \(r_1x\) and \(r_2y\). Adding those charges and a fixed fee \(b\) gives the total.

Derivation: The total is the sum of three contributions: the fixed fee \(b\), the first usage charge \(r_1x\), and the second usage charge \(r_2y\). Therefore the two-input cost model is \(C(x,y)=b+r_1x+r_2y\). Each term represents one part of the verbal description, so adding the terms gives the stated total rather than an unrelated combination of the inputs.

This reasoning is also a useful check when creating a model: every term should have a clear source in the description. A fixed amount is represented by a constant. A rate applied to a quantity is represented by multiplying the rate and quantity. If the description says the output is the sum of several contributions, those contributions are added.

Worked Example: Distance from Two Coordinates

Worked Example: Distance from Two Coordinates

A point has coordinates \((x,y)\) in the plane. Define a function giving its distance from the origin, then evaluate the distance for the point \((3,4)\).

The two inputs are the point's horizontal coordinate \(x\) and vertical coordinate \(y\). The output is its distance from the origin. A right triangle from the origin to the point has perpendicular side lengths whose magnitudes are \(|x|\) and \(|y|\). By the Pythagorean theorem, the square of the distance is \(x^2+y^2\). Distance is nonnegative, so define:

$$ d(x,y)=\sqrt{x^2+y^2}. $$

For \((3,4)\), substitute \(3\) for \(x\) and \(4\) for \(y\):

$$ \begin{aligned} d(3,4) &=\sqrt{3^2+4^2}\\ &=\sqrt{9+16}\\ &=\sqrt{25}\\ &=5. \end{aligned} $$

The point is \(5\) units from the origin. Check the result with the right-triangle relationship: \(3^2+4^2=9+16=25=5^2\). Thus the computed distance satisfies the geometric rule used to define the function.

Common Mistake: Matching a Value to the Wrong Input

In the bill model, \(x\) represents electricity usage and \(y\) represents gas usage. A common error is to substitute the values into the opposite rate terms. With \(x=250\) and \(y=40\), that incorrect calculation would be:

$$ 12+0.08(40)+0.05(250) =12+3.2+12.5 =27.7. $$

The arithmetic is correct, but the substitutions do not match the model: \(0.08\) is the electricity rate and must be multiplied by \(x=250\); \(0.05\) is the gas rate and must be multiplied by \(y=40\). The correct calculation is:

$$ 12+0.08(250)+0.05(40) =12+20+2 =34. $$

Another possible error is to replace the multiplication in the area model by addition. For the garden, \(8+5=13\) is not its area. The description calls for length multiplied by width, so \(A(8,5)=8\cdot5=40\text{ m}^2\). Before calculating, check that each operation in the formula matches the relationship described in words.

Why These Models Matter

A verbal model and a function formula express the same relationship in different ways. The description explains what the quantities mean; the formula makes the relationship concise enough to evaluate repeatedly. Once the variables and their order are clear, a function can answer questions for many input pairs without rebuilding the model each time.

At the same time, a formula is only as useful as its interpretation. Writing \(f(x,y)\) without saying what \(x\), \(y\), and the output represent leaves the model incomplete for someone who does not already know the context. State the quantities and their roles alongside the formula, then substitute values in the same order. This connects the calculation to the situation it is meant to describe.

Key takeaway: A two-input model starts with two identified quantities and one specified output. Translate the described relationship into a rule \(f(x,y)\), preserve the meaning and order of the inputs, and evaluate by substituting each value for its matching variable.

Check Your Understanding

For each question, identify what the inputs and output represent before carrying out any requested evaluation.

  1. A rectangular sign has height \(h\) meters and width \(w\) meters. Write a function for its area and evaluate it when \(h=2\) and \(w=6\).
  2. A service charges a fixed \(\$9\), plus \(\$3\) per item of type A and \(\$5\) per item of type B. If \(x\) and \(y\) are the respective item counts, write the cost function.
  3. For the function in question 2, evaluate the cost when \(x=4\) and \(y=2\). Show the separate contributions.
  4. Explain why \(f(x,y)\) and \(f(y,x)\) need not have the same value for a two-input function.
  5. A point has coordinates \((6,8)\). Use \(d(x,y)=\sqrt{x^2+y^2}\) to find its distance from the origin and check the result.