Skip to main content

Section 2.1 Variables and Evaluating Expressions

To move past arithmetic to algebra, we begin working with variables. Any combination of numbers and variables using mathematical operations is called a mathematical expression. Some expressions are simple, and some are complicated. Some expressions are abstract, whereas some have context and meaning. One example of a simple mathematical expression with context is “\(220 - a\text{,}\)” which has one variable, \(a\text{,}\) and is the expression for the maximum heart rate of a person who is \(a\) years old.

In this section, we'll focus on variables and expressions. In Section 2.2 we'll continue with a focus on geometry formulas. In the remainder of this chapter, we'll focus on mathematical equations and inequalities which are also very important in algebra.

Subsection 2.1.1 Introduction to Variables

When we want to represent an unknown or changing numerical quantity, we use a variable to do so. For example, if you'd like to discuss the gas mileage of various cars, you could let the symbol “\(g\)” represent a car's gas mileage. The mileage might be 25 mpg, 30 mpg, or some other quantity. If we agree to use mpg for the units of measure, \(g\) might be a place holder for \(25\text{,}\) \(30\text{,}\) or some other number. Since we are using a variable and not a specific number, we can discuss gas mileage for Honda Civics at the same time we discuss gas mileage for Ford Explorers.

When variables stand for actual physical quantities, it's good to use letters that clearly correspond to the quantity they represent. For example, it's wise to use \(g\) to represent gas mileage. This helps the people who might read your work in the future to understand it better.

It is also important to identify what unit of measurement goes along with each variable you use, and clearly tell your reader this. For example, suppose you are working with \(g=25\text{.}\) A car whose gas mileage is 25 mpg is very different from a car whose gas mileage is 25 kpg (kilometers per gallon). So it would be important to tell readers that \(g\) represents gas mileage in miles per gallon.

Checkpoint 2.1.1.

Unless an algebra problem specifies which letter(s) to use, we may choose which letter(s) to use for our variable(s). However, without any context to a problem, \(x\text{,}\) \(y\text{,}\) and \(z\) are the most common letters used as variables, and you may see these variables (especially \(x\)) a lot.

Also note that the units we use are often determined indirectly by other information given in an algebra problem. For example, if we're told that a car has used so many gallons of gas after traveling so many miles, then it suggests we should measure gas mileage in mpg.

Subsection 2.1.2 Mathematical Expressions

A mathematical expression is any combination of variables and numbers using arithmetic operations. The following are all examples of mathematical expressions:

\begin{equation*} x+1\qquad 2\ell+2w\qquad\frac{\sqrt{x}}{y+1}\qquad nRT \end{equation*}

Note that this definition of “mathematical expression” does not include anything with signs like these in them: \(=\text{,}\) \(\lt\text{,}\) \(\leq\text{,}\) etc.

Example 2.1.2.

The expression:

\begin{equation*} \frac{5}{9}(F - 32) \end{equation*}

can be used to convert from degrees Fahrenheit to degrees Celsius. To do this, we need a Fahrenheit temperature, \(F\text{.}\) Then we can evaluate the expression. This means replacing its variable(s) with specific numbers and calculating the result. In this case, we can replace \(F\) with a specific number.

Let's convert the temperature 89 °F to the Celsius scale by evaluating the expression.

\begin{align*} \frac{5}{9}(F - 32) \amp= \frac{5}{9}(\substitute{89} - 32)\\ \amp= \frac{5}{9}(57)\\ \amp= \frac{285}{9}\approx 31.67 \end{align*}

This shows us that 89 °F is equivalent to approximately 31.67 °C.

Warning 2.1.3. Evaluating Versus Solving.

The steps in Example 2.1.2 are not considered “solving” anything. “Solving” is a word you might be tempted to use, because in some sense the steps from Example 2.1.2 are “finding an answer.” There is a special meaning in algebra for words like “solve” and “solution” that will come soon. Instead, when we substitute a value and compute the result, the proper vocabulary is “evaluating an expression.”

Checkpoint 2.1.4.

Try evaluating the temperature expression for yourself.

Example 2.1.5. Target heart rate.

According to the American Heart Association, a person's maximum heart rate, in beats per minute (bpm), is given by \(220 - a\text{,}\) where \(a\) is their age in years.

  1. Determine the maximum heart rate for someone who is \(31\) years old.

  2. A person's target heart rate for moderate exercise is \(50\%\) to \(70\%\) of their maximum heart rate. If they want to reach \(65\%\) of their maximum heart rate during moderate exercise, we'd use the expression \(0.65(220-a)\text{,}\) where \(a\) is their age in years. Determine the target heart rate at this \(65\%\) level for someone who is \(31\) years old.

Explanation

Both of these parts ask us to evaluate an expression.

  1. Since \(a\) is defined to be age in years, we will evaluate this expression by substituting \(a\) with \(31\text{:}\)

    \begin{align*} 220-a \amp= 220-\substitute{31}\\ \amp= 189 \end{align*}

    This tells us that the maximum heart rate for someone who is \(31\) years old is \(189\) bpm.

  2. We'll again substitute \(a\) with \(31\text{,}\) but this time using the target heart rate expression:

    \begin{align*} 0.65(220-a) \amp= 0.65(220-\substitute{31})\\ \amp= 0.65(189)\\ \amp=122.85 \end{align*}

    This tells us that the target heart rate for someone who is \(31\) years old undertaking moderate exercise is \(122.85\) bpm.

Checkpoint 2.1.6.
Checkpoint 2.1.7. Rising Rents.

Subsection 2.1.3 Evaluating Expressions with Exponents, Absolute Value, and Radicals

Mathematical expressions will often have exponents, absolute value bars, and radicals. This does not change the basic approach to evaluating them.

Example 2.1.8. Tsunami Speed.

The speed of a tsunami (in meters per second) can be modeled by \(\sqrt{9.8d}\text{,}\) where \(d\) is the depth of the tsunami (in meters). Determine the speed of a tsunami that has a depth of 30 m rounded to two decimal places.

Explanation

Using \(d=30\text{,}\) we find:

\begin{align*} \sqrt{9.8d} \amp= \sqrt{9.8(\substitute{30})}\\ \amp=\sqrt{294}\\ \amp\approx 17.146428\ldots \end{align*}

The speed of tsunami with a depth of 30 m is about 17.15 m⁄s.

Up to now, we have been evaluating expressions, but we can evaluate formulas in the same way. A formula usually has a single variable that represents the output of an expression. For example, the expression for a person's maximum heart rate in beats per minute, \(220-a\text{,}\) can be written as the formula, \(H=220-a\text{.}\) When we substitute a value for \(a\) we are evaluating the formula. Even though we have an equation, we are not solving yet. That will come soon.

Checkpoint 2.1.9. Tent Height.
Warning 2.1.10. Evaluating Expressions with Negative Numbers.

When we substitute negative numbers into an expression, it's important to use parentheses around them or else it's easy to forget that a negative number is being raised to a power. Let's look at some examples.

Example 2.1.11.

Evaluate \(x^2\) if \(x=-2\text{.}\)

We substitute:

\begin{align*} x^2\amp=(\substitute{-2})^2\\ \amp=4 \end{align*}

If we don't use parentheses, we would have:

\begin{align*} x^2\amp=-2^2\amp\text{incorrect!}\\ \amp=-4 \end{align*}

The original expression takes \(x\) and squares it. With \(-2^2=-4\text{,}\) the number \(-2\) is not being squared. Since the exponent has higher priority than the negation, it's just the number \(2\) that is being squared. With \((-2)^2=4\) the number \(-2\) is being squared, which is what we would want given the expression \(x^2\text{.}\)

So it is wise to always use some parentheses when substituting in any negative number.

Checkpoint 2.1.12.

Exercises 2.1.4 Exercises

Evaluating Expressions
1.

Evaluate \({x+9}\) for \(x = 10\text{.}\)

2.

Evaluate \({x+1}\) for \(x = -8\text{.}\)

3.

Evaluate \({-6-x}\) for \(x = -6\text{.}\)

4.

Evaluate \({8-x}\) for \(x = -4\text{.}\)

5.

Evaluate \({8x+9}\) for \(x = -1\text{.}\)

6.

Evaluate \({-7x-4}\) for \(x = 1\text{.}\)

7.

Evaluate \({-8C}\) for \(C = 7\text{.}\)

8.

Evaluate \({-3m}\) for \(m = -1\text{.}\)

9.

Evaluate the expression \({t^{2}}\text{:}\)

  1. For \(t=2\text{.}\)

  2. For \(t=-6\text{.}\)

10.

Evaluate the expression \({t^{2}}\text{:}\)

  1. For \(t=8\text{.}\)

  2. For \(t=-9\text{.}\)

11.

Evaluate the expression \({x^{3}}\text{:}\)

  1. For \(x=3\text{.}\)

  2. For \(x=-3\text{.}\)

12.

Evaluate the expression \({x^{3}}\text{:}\)

  1. For \(x=2\text{.}\)

  2. For \(x=-5\text{.}\)

13.
  1. Evaluate \({5x^{2}}\) when \(x=2\text{.}\)

  2. Evaluate \({\left(5x\right)^{2}}\) when \(x=2\text{.}\)

14.
  1. Evaluate \({3x^{2}}\) when \(x=2\text{.}\)

  2. Evaluate \({\left(3x\right)^{2}}\) when \(x=2\text{.}\)

15.

Evaluate \({-10\!\left(r+2\right)}\) for \(r = -10\text{.}\)

16.

Evaluate \({-6\!\left(r+9\right)}\) for \(r = 4\text{.}\)

17.

Evaluate \(\displaystyle{{\frac{10t-5}{10t}}}\) for \(t=-3\text{.}\)

18.

Evaluate \(\displaystyle{{\frac{4t-7}{10t}}}\) for \(t=10\text{.}\)

19.

Evaluate \({-9C+10A}\) for \(C = 5\) and \(A = -10\text{.}\)

20.

Evaluate \({9a-b}\) for \(a = -7\) and \(b = 6\text{.}\)

21.

Evaluate \(\displaystyle{{\frac{-7}{r}-\frac{6}{C}}}\) for \(r = 4\) and \(C = -5\text{.}\)

22.

Evaluate \(\displaystyle{{\frac{-8}{a}-\frac{7}{A}}}\) for \(a = 9\) and \(A = -3\text{.}\)

23.

Evaluate \(\displaystyle{{\frac{-8b-3c+1}{-7b-6c}}}\) for \(b=9\) and \(c=7\text{.}\)

24.

Evaluate \(\displaystyle{{\frac{7A+3C-1}{9A+6C}}}\) for \(A=7\) and \(C=3\text{.}\)

25.

Evaluate the expression \(\displaystyle \frac{1}{5} \big( x + 3 \big)^2 - 6\) when \(x = -8\text{.}\)

26.

Evaluate the expression \(\displaystyle \frac{1}{2} \big( x + 4 \big)^2 - 3\) when \(x = -6\text{.}\)

27.

Evaluate the expression \(\displaystyle \frac{1}{2} h \big( B + b \big)\) when \(h = 12, \ B = 8, \ b = 3.\)

28.

Evaluate the expression \(\displaystyle \frac{1}{2} h \big( B + b \big)\) when \(h = 12, \ B = 6, \ b = 5.\)

29.

Evaluate the expression \(-16t^{2}+64t+128\) when \(t=-2\text{.}\)

30.

Evaluate the expression \(-16t^{2}+64t+128\) when \(t=-5\text{.}\)

31.
  1. Evaluate \({y^{2}r^{3}}\) when \(y=-3\) and \(r=-1\text{.}\)

  2. Evaluate \({y^{3}r^{2}}\) when \(y=-3\) and \(r=-1\text{.}\)

32.
  1. Evaluate \({y^{2}x^{3}}\) when \(y=-1\) and \(x=-2\text{.}\)

  2. Evaluate \({y^{3}x^{2}}\) when \(y=-1\) and \(x=-2\text{.}\)

33.
  1. Evaluate \({\left(-r\right)^{2}}\) when \(r=-4\text{.}\)

  2. Evaluate \({\left(-r\right)^{3}}\) when \(r=-4\text{.}\)

34.
  1. Evaluate \({\left(-r\right)^{2}}\) when \(r=-4\text{.}\)

  2. Evaluate \({\left(-r\right)^{3}}\) when \(r=-4\text{.}\)

35.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{y^3 + \sqrt{x-5}}{|2 x - y|}\text{,}\) for \(x = 9\) and \(y = -4\text{:}\)

36.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{y^3 + \sqrt{x-5}}{|4 x - y|}\text{,}\) for \(x = 54\) and \(y = 7\text{:}\)

37.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{y}{4 x} - \frac{\sqrt{x}}{2 y}\text{,}\) for \(x = 4\) and \(y = 2\text{:}\)

38.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{y}{4 x} - \frac{\sqrt{x}}{2 y}\text{,}\) for \(x = 25\) and \(y = 7\text{:}\)

39.

Evaluate

\begin{equation*} \displaystyle\frac{y_2 - y_1}{x_2 - x_1} \end{equation*}

for \(x_1 = -12\text{,}\) \(x_2 = 8\text{,}\) \(y_1 = -17\text{,}\) and \(y_2 = 6\text{:}\)

40.

Evaluate

\begin{equation*} \displaystyle\frac{y_2 - y_1}{x_2 - x_1} \end{equation*}

for \(x_1 = -8\text{,}\) \(x_2 = -6\text{,}\) \(y_1 = -11\text{,}\) and \(y_2 = 5\text{:}\)

41.

Evaluate

\begin{equation*} \displaystyle \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \end{equation*}

for \(x_1 = 8\text{,}\) \(x_2 = 16\text{,}\) \(y_1 = 2\text{,}\) and \(y_2 = 8\text{:}\)

42.

Evaluate

\begin{equation*} \displaystyle \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \end{equation*}

for \(x_1 = 3\text{,}\) \(x_2 = 8\text{,}\) \(y_1 = 2\text{,}\) and \(y_2 = -10\text{:}\)

43.

Evaluate the algebraic expression \(6 a + b\) for \(a = {\frac{6}{7}}\) and \(b = {\frac{4}{3}}\text{.}\)

44.

Evaluate the algebraic expression \(-8 a + b\) for \(a = {\frac{7}{9}}\) and \(b = {\frac{2}{3}}\text{.}\)

45.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{5 + 4|y-x|}{x + 2 y}\text{,}\) for \(x = 3\) and \(y = -12\text{:}\)

46.

Evaluate each algebraic expression for the given value(s):

\(\displaystyle\frac{5+3|x-y|}{x+5 y}\text{,}\) for \(x = 6\) and \(y = 7\text{:}\)

47.

To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula:

\begin{equation*} C={\frac{5}{9}\!\left(F-32\right)} \end{equation*}

where \(C\) represents the temperature in degrees Celsius and \(F\) represents the temperature in degrees Fahrenheit.

If a temperature is \(14 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

48.

To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula:

\begin{equation*} C={\frac{5}{9}\!\left(F-32\right)} \end{equation*}

where \(C\) represents the temperature in degrees Celsius and \(F\) represents the temperature in degrees Fahrenheit.

If a temperature is \(23 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

49.

To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula:

\begin{equation*} C={\frac{5}{9}\!\left(F-32\right)} \end{equation*}

where \(C\) represents the temperature in degrees Celsius and \(F\) represents the temperature in degrees Fahrenheit.

If a temperature is \(41 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

50.

To convert a temperature measured in degrees Fahrenheit to degrees Celsius, there is a formula:

\begin{equation*} C={\frac{5}{9}\!\left(F-32\right)} \end{equation*}

where \(C\) represents the temperature in degrees Celsius and \(F\) represents the temperature in degrees Fahrenheit.

If a temperature is \(50 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

51.

The formula

\begin{equation*} y=\frac{1}{2}\,a\,t^2 +v_0\,t + y_0 \end{equation*}

gives the vertical position of an object, at time \(t\text{,}\) thrown with an initial velocity \(v_0\text{,}\) from an initial position \(y_0\) in a place where the acceleration of gravity is \(a\text{.}\) The acceleration of gravity on earth is \({-9.8\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s^{2}}}}\text{.}\) It is negative, because we consider the upward direction as positive in this situation, and gravity pulls down.

What is the height of a baseball thrown with an initial velocity of \(v_0={76\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s}}}\text{,}\) from an initial position of \(y_0= {76\ {\rm m}}\text{,}\) and at time \(t={2\ {\rm s}}\text{?}\)

Two seconds after the baseball was thrown, it was high in the air.

52.

The formula

\begin{equation*} y=\frac{1}{2}\,a\,t^2 +v_0\,t + y_0 \end{equation*}

gives the vertical position of an object, at time \(t\text{,}\) thrown with an initial velocity \(v_0\text{,}\) from an initial position \(y_0\) in a place where the acceleration of gravity is \(a\text{.}\) The acceleration of gravity on earth is \({-9.8\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s^{2}}}}\text{.}\) It is negative, because we consider the upward direction as positive in this situation, and gravity pulls down.

What is the height of a baseball thrown with an initial velocity of \(v_0={82\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s}}}\text{,}\) from an initial position of \(y_0= {58\ {\rm m}}\text{,}\) and at time \(t={9\ {\rm s}}\text{?}\)

Nine seconds after the baseball was thrown, it was high in the air.

53.

A formula for converting hours into seconds is

\begin{equation*} S = 3600H \end{equation*}

where \(H\) is a number of hours, and \(S\) is the corresponding number of seconds.

Use the formula to find the number of seconds that corresponds to seventeen hours.

seconds corresponds to seventeen hours.

54.

A formula for converting miles into kilometers is

\begin{equation*} K = 1.61M \end{equation*}

where \(M\) is a number of miles, and \(K\) is the corresponding number of kilometers.

Use the formula to find the number of kilometers that corresponds to eleven miles.

kilometers corresponds to eleven miles.

55.

The percentage of births in the U.S. delivered via C-section can be given by the following formula for the years since 1996:

\begin{equation*} p = 0.8(y-1996)+21 \end{equation*}

In this formula \(y\) is a year after 1996 and \(p\) is the percentage of births delivered via C-section for that year.

What percentage of births in the U.S. were delivered via C-section in the year 2013?

of births in the U.S. were delivered via C-section in the year 2013.

56.

The percentage of births in the U.S. delivered via C-section can be given by the following formula for the years since 1996:

\begin{equation*} p = 0.8(y-1996)+21 \end{equation*}

In this formula \(y\) is a year after 1996 and \(p\) is the percentage of births delivered via C-section for that year.

What percentage of births in the U.S. were delivered via C-section in the year 1999?

of births in the U.S. were delivered via C-section in the year 1999.

57.

Target heart rate for moderate exercise is \(50\%\) to \(70\%\) of maximum heart rate. If we want to represent a certain percent of an individual’s maximum heart rate, we’d use the formula

\begin{equation*} \text{rate}=p(220-a) \end{equation*}

where \(p\) is the percent, and \(a\) is age in years.

Determine the target heart rate at \(54\%\) level for someone who is \(36\) years old. Round your answer to an integer.

The target heart rate at \(54\%\) level for someone who is \(36\) years old is beats per minute.

58.

Target heart rate for moderate exercise is \(50\%\) to \(70\%\) of maximum heart rate. If we want to represent a certain percent of an individual’s maximum heart rate, we’d use the formula

\begin{equation*} \text{rate}=p(220-a) \end{equation*}

where \(p\) is the percent, and \(a\) is age in years.

Determine the target heart rate at \(56\%\) level for someone who is \(15\) years old. Round your answer to an integer.

The target heart rate at \(56\%\) level for someone who is \(15\) years old is beats per minute.

59.

The diagonal length (\(D\)) of a rectangle with side lengths \(L\) and \(W\) is given by:

\begin{equation*} D=\sqrt{L^2+W^2} \end{equation*}

Determine the diagonal length of rectangles with \(L={5\ {\rm ft}}\) and \(W={12\ {\rm ft}}\text{.}\)

The diagonal length of rectangles with \(L={5\ {\rm ft}}\) and \(W={12\ {\rm ft}}\) is .

60.

The diagonal length (\(D\)) of a rectangle with side lengths \(L\) and \(W\) is given by:

\begin{equation*} D=\sqrt{L^2+W^2} \end{equation*}

Determine the diagonal length of rectangles with \(L={24\ {\rm ft}}\) and \(W={10\ {\rm ft}}\text{.}\)

The diagonal length of rectangles with \(L={24\ {\rm ft}}\) and \(W={10\ {\rm ft}}\) is .

61.

The height inside a camping tent when you are \(d\) feet from the edge of the tent is given by

\begin{equation*} h={-1.1\!\left|d-6\right|+4.5} \end{equation*}

where \(h\) stands for height in feet.

Determine the height when you are:

  1. \({6.7\ {\rm ft}}\) from the edge.

    The height inside a camping tent when you are \({6.7\ {\rm ft}}\) from the edge of the tent is .

  2. \({4.4\ {\rm ft}}\) from the edge.

    The height inside a camping tent when you are \({4.4\ {\rm ft}}\) from the edge of the tent is .

62.

The height inside a camping tent when you are \(d\) feet from the edge of the tent is given by

\begin{equation*} h={-0.7\!\left|d-6.2\right|+4.5} \end{equation*}

where \(h\) stands for height in feet.

Determine the height when you are:

  1. \({10\ {\rm ft}}\) from the edge.

    The height inside a camping tent when you are \({10\ {\rm ft}}\) from the edge of the tent is .

  2. \({2.6\ {\rm ft}}\) from the edge.

    The height inside a camping tent when you are \({2.6\ {\rm ft}}\) from the edge of the tent is .