Tutorials › Calculus III › Evaluating Two-Variable Formulas at Points

Domains and Function Representations · Tutorial 203 of 999

Evaluating Two-Variable Formulas at Points

Practice substituting the two coordinates of an ordered pair into an explicit formula in \(x\) and \(y\), then simplifying and checking the result.

Beginner 8 min read

What You'll Learn

  • Identify which coordinate of an ordered pair substitutes for each variable.
  • Evaluate two-variable formulas containing powers, products, and sums.
  • Use parentheses to preserve the meaning of substituted expressions.
  • Simplify numerical expressions in a clear order.
  • Check a computed function value by evaluating the original formula again.
  • Recognize and correct common variable-order and exponent mistakes.

Evaluating a Formula at an Ordered Pair

A formula in two variables describes how an output depends on two inputs. To find the output for a particular pair of inputs, replace each variable with its corresponding coordinate and then calculate.

The order of the coordinates matters. For an ordered pair \((a,b)\), the first coordinate supplies the value of \(x\), and the second supplies the value of \(y\). This follows the variable order in the notation \(f(x,y)\): the first input goes with \(x\), and the second goes with \(y\).

Definition: If a function is given by a formula \(f(x,y)\), then evaluating it at the ordered pair \((a,b)\) means substituting \(a\) for every occurrence of \(x\) and \(b\) for every occurrence of \(y\), and simplifying the resulting numerical expression. The output is written \(f(a,b)\).

For example, if \(f(x,y)=x^2+3y\), then \(f(2,4)\) means substitute \(2\) for \(x\) and \(4\) for \(y\). The result is a number, not another formula in \(x\) and \(y\).

$$ f(2,4)=2^2+3(4)=4+12=16. $$

When substituting, use parentheses around the coordinates, especially when a coordinate is negative or appears in a power. Parentheses make clear that the entire coordinate replaces the variable.

A Reliable Substitution Process

A careful evaluation separates substitution from arithmetic. First write down the formula with the coordinates in place. Then simplify powers, products, and sums according to the usual order of operations. This makes it easier to notice whether a value was assigned to the wrong variable or whether a sign was lost.

1
Read the input order.
In \(f(a,b)\), the first coordinate \(a\) is the input for \(x\), and the second coordinate \(b\) is the input for \(y\).
2
Substitute throughout the formula.
Replace every \(x\) with \(a\) and every \(y\) with \(b\). Use parentheses to show exactly what is being substituted.
3
Simplify and check.
Evaluate powers first, then products, and then sums and differences. Review the substitutions and arithmetic before recording the function value.

For polynomial formulas, substitution works because each variable represents its assigned number everywhere it appears. Addition, multiplication, and powers are then performed on those numbers just as they are in any numerical expression. For instance, if \(x\) is assigned \(a\), the term \(x^2\) becomes \(a^2\), while the term \(3x\) becomes \(3a\). The same assignment must be used for every occurrence of \(x\).

Worked Examples

Worked Example: A Sum of a Square and a Product

Let \(f(x,y)=x^2+2xy+y^2\). Find \(f(3,1)\).

The first coordinate is \(3\), so replace \(x\) with \(3\). The second coordinate is \(1\), so replace \(y\) with \(1\):

$$ \begin{aligned} f(3,1) &=3^2+2(3)(1)+1^2\\ &=9+6+1\\ &=16. \end{aligned} $$

Thus \(f(3,1)=16\). To check, group the terms by their numerical contributions: the square term is \(9\), the product term is \(6\), and the final square term is \(1\). Their sum is \(9+6+1=16\), as found.

Worked Example: Negative Coordinates and a Product

Let \(g(x,y)=x^2y-3xy+2y\). Find \(g(-2,3)\).

The ordered pair \((-2,3)\) assigns \(x=-2\) and \(y=3\). Substitute both values everywhere they occur:

$$ \begin{aligned} g(-2,3) &=(-2)^2(3)-3(-2)(3)+2(3)\\ &=4(3)-3(-2)(3)+6\\ &=12+18+6\\ &=36. \end{aligned} $$

The middle term is positive because \((-2)(3)=-6\), so \(-3(-6)=18\). The first term is \(4(3)=12\), and the last is \(2(3)=6\). Adding gives \(12+18+6=36\). As a check on the signs, the original expression has a negative coefficient on \(xy\), while the substituted product \(xy=(-2)(3)\) is negative; their product is positive.

Worked Example: A Sum of Separate Terms

Let \(h(x,y)=4x+5y^2-xy\). Find \(h(2,-1)\).

The first coordinate \(2\) replaces \(x\), and the second coordinate \(-1\) replaces \(y\). Keep the negative coordinate in parentheses:

$$ \begin{aligned} h(2,-1) &=4(2)+5(-1)^2-(2)(-1)\\ &=8+5(1)-(-2)\\ &=8+5+2\\ &=15. \end{aligned} $$

Here \((-1)^2=1\), and \((2)(-1)=-2\), so subtracting that product adds \(2\). The terms contribute \(8\), \(5\), and \(2\), which total \(15\). Checking the substitution against the formula confirms that the term \(-xy\) becomes \(-(2)(-1)\), not \(-2(-1)\) with any extra sign change.

Worked Example: The Same Formula at Two Ordered Pairs

Let \(p(x,y)=x^2+xy+2y\). Evaluate \(p(1,4)\) and \(p(4,1)\).

For the first pair, \(x=1\) and \(y=4\):

$$ \begin{aligned} p(1,4) &=1^2+(1)(4)+2(4)\\ &=1+4+8\\ &=13. \end{aligned} $$

For the second pair, \(x=4\) and \(y=1\):

$$ \begin{aligned} p(4,1) &=4^2+(4)(1)+2(1)\\ &=16+4+2\\ &=22. \end{aligned} $$

The results differ: \(p(1,4)=13\), whereas \(p(4,1)=22\). The coordinates were exchanged, so the values assigned to \(x\) and \(y\) changed. The term \(x^2\), in particular, contributes \(1\) in the first evaluation and \(16\) in the second. This direct check shows why an ordered pair cannot be treated as an unordered collection of two numbers.

Why the Order and Parentheses Matter

The notation \(f(a,b)\) records an ordered input. It does not merely say that \(a\) and \(b\) are both involved; it specifies which value is assigned to each variable. A formula need not give the same result when its inputs are exchanged. In the preceding example, exchanging \(1\) and \(4\) changed the value from \(13\) to \(22\).

Parentheses are equally important. If a coordinate is negative, it must be substituted as a whole. For example, substituting \(-2\) into \(x^2\) gives \((-2)^2=4\), because the square applies to the value \(-2\). Writing \(-2^2\) is commonly interpreted as \(-(2^2)=-4\), which is a different expression.

Key takeaway: In \(f(a,b)\), substitute \(a\) for \(x\) and \(b\) for \(y\), keeping negative or multi-part values in parentheses. Then simplify the resulting numerical expression.

Common Mistake: Reversing the Coordinates

Suppose \(q(x,y)=2x+y^2\), and we want \(q(1,3)\). A common error is to use \(x=3\) and \(y=1\), as if the pair could be read in either order. That produces the wrong calculation:

$$ \text{Wrong:}\qquad q(1,3)=2(3)+1^2=7. $$

The first coordinate of \((1,3)\) is \(1\), so it must replace \(x\); the second coordinate is \(3\), so it must replace \(y\). The correct calculation is:

$$ \begin{aligned} q(1,3) &=2(1)+3^2\\ &=2+9\\ &=11. \end{aligned} $$

To check, evaluate the two terms in the original formula separately: \(2x\) contributes \(2(1)=2\), and \(y^2\) contributes \(3^2=9\). Their sum is \(11\). The incorrect answer \(7\) came from reversing the assignments, not from a difficult arithmetic step.

Why Careful Evaluation Is Useful

Evaluating a formula at a point turns a general rule into a specific output. The same habit applies whether the formula contains one term or several: read the input order, substitute consistently, and simplify carefully. These steps are also useful when comparing outputs at different ordered pairs, as the example with \(p(x,y)\) illustrated.

The most reliable work shows the substitution line before the arithmetic. If an answer seems unexpected, that line helps locate the source of the error: a coordinate may have been assigned to the wrong variable, a negative sign may have been lost, or a power may have been applied without parentheses. Keeping these stages visible makes the result easier to verify.

Check Your Understanding

For each question, write the substitution before simplifying. Keep the coordinates in their stated order.

  1. If \(r(x,y)=x^2+3y\), what is \(r(2,-1)\)?
  2. If \(s(x,y)=2xy+y^2\), what is \(s(-1,3)\)?
  3. If \(t(x,y)=5x-y^2\), evaluate \(t(1,2)\) and \(t(2,1)\). Are the results equal?
  4. For \(u(x,y)=x^2-xy+4y\), identify the coordinate assigned to each variable in \(u(3,-2)\), then evaluate the function.
  5. A student evaluates \(v(1,4)\), where \(v(x,y)=x+2y^2\), by calculating \(4+2(1)^2\). Explain the error and find the correct value.