Skip to main content

Section 1.1 Variables and Evaluating Expressions

Algebra helps people solve mathematical problems that are just a bit too complicated to solve in your head. This book is meant to cover basic principles and skills that people need to become successful with algebra. The first things to learn about are variables, algebraic expressions, equations, and inequalities. In this section, we'll focus on variables and expressions. In the remainder of this chapter, we'll focus on equations and inequalities.

Figure 1.1.1. Alternative Video Lesson

Subsection 1.1.1 Introduction to Variables

When we want to represent an unknown or changing numerical quantity, we use a variable. For example, if you'd like to discuss the gas mileage of various cars, you could use the symbol “\(g\)” as a variable to represent a car's gas mileage. The mileage might be 25 mpg, 30 mpg, or something else. (“mpg” stands for “miles per gallon”.) 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, Ford Explorers, and all other makes and models at the same time, even though these makes and models have different gas mileages.

When variables stand for actual physical quantities, it's good to use letters that clearly represent those quantities. For example, it's wise to use \(g\) to represent gas mileage. This helps the people who might read your work 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 1.1.2.

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 this suggests we should measure gas mileage in mpg.

Subsection 1.1.2 Algebraic Expressions

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

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

Note that this definition of “algebraic expression” does not include anything with an equals sign in it.

Example 1.1.3.

The expression:

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

can be used to convert a temperature in 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) (in this case, \(F\)) with specific numbers and finding the result as a single, simplified 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\amp\text{Review order of operations in }\href{section-order-of-operations.html}{\text{A.5}}\text{.}\\ \amp= \frac{5}{9}(57)\amp\amp\text{Review fraction multiplication in }\href{section-fractions-and-fraction-arithmetic.html}{\text{A.2}}\text{.}\\ \amp= \frac{285}{9}\approx 31.67 \end{align*}

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

Warning 1.1.4. Correct Vocabulary.

The steps in Example 1.1.3 are not considered “solving” anything. “Solving” is a word you might be tempted to use, because in everyday English you are “finding an answer.” In algebra, there is a special meaning for “solving” something, and that will come soon in Section 1.5. When we substitute values in for variables and then compute the result, the technical thing to say is we are “evaluating an expression.”

Checkpoint 1.1.5.

Try evaluating the temperature expression for yourself.

Example 1.1.6. Allowing Variables to Vary.

With the help of technology, it is possible to quickly evaluate expressions as variables vary. In the GeoGebra applet in Figure 1.1.7, you may slide the value of \(F\) and see how a computer can quickly calculate the correspoding Celsius temperature.

Figure 1.1.7. Allowing Variables to Vary
Example 1.1.8. 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 parts ask us to evaluate an expression.

  1. Since \(a\) is defined as age in years, we 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 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 1.1.9.
Checkpoint 1.1.10. Rising Rents.

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

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

Example 1.1.11. 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 to four significant digits.

Explanation

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

\begin{align*} \sqrt{9.8d} \amp= \sqrt{9.8(\substitute{30})}\amp\amp\text{Review order of operations in }\href{section-order-of-operations.html}{\text{A.5}}\text{.}\\ \amp=\sqrt{294}\amp\amp\text{Review square root in }\href{section-absolute-value-and-square-root.html}{\text{A.3}}\text{.}\\ \amp\approx \overbrace{17.14}^{\text{four}}6428\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.

Checkpoint 1.1.12. Tent Height.
Checkpoint 1.1.13. Mortgage Payments.
Warning 1.1.14. Rounding Too Much.

You might have noticed in the explanation to Exercise 1.1.13 that during the computations, many decimal places were recorded at each step. Recording lots of decimal places might be very important in some computations. If you round in the middle of your work, you have changed the numbers a little bit from what they really should be. As computations proceed, this little error can become larger and larger, leaving you with a final result that is too far off to be considered correct. So the best practice is to always keep lots of decimal places in all your computations, and then at the very end you may round more if that is appropriate.

Subsection 1.1.4 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.

Example 1.1.15.

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\qquad\text{incorrect!}\\ \amp=-4 \end{align*}

The original expression, \(x^2\text{,}\) takes \(x\) and squares it, so we want to do the same thing to the number \(-2\text{.}\) But with \(-2^2\text{,}\) the number \(-2\) is not being squared. Since the exponent has higher priority than the negation in the order of operations, it's just the number \(2\) that is being squared and then the result is negated. With \((-2)^2\) the number \(-2\) is being squared, which is what we want.

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

Checkpoint 1.1.16.

Reading Questions 1.1.5 Reading Questions

1.

Describe a situation where it might be better to use a letter other than \(x\text{,}\) \(y\text{,}\) or \(z\) as a variable.

2.

What is the difference between an “algebraic expression” and a “formula,” as described in this section? (Other math resources may define these terms differently.)

3.

What should you watch out for when substituting a negative number in for a variable?

4.

In Figure 1.1.7, when you change the value of \(F\text{,}\) why do some values of \(F\) cause there to be more steps in the calculation than other values of \(F\text{?}\)

Exercises 1.1.6 Exercises

1.

Identify a variable you might use to represent each quantity. Then identify what units would be most appropriate.

  1. Let be the depth of a swimming pool, measured in .

  2. Let be the weight of a dog, measured in .

2.

Identify a variable you might use to represent each quantity. Then identify what units would be most appropriate.

  1. Let be the amount of time a person sleeps each night, measured in .

  2. Let be the surface area of a patio, measured in .

Evaluating Expressions
3.

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

4.

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

5.

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

6.

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

7.

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

8.

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

9.

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

10.

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

11.

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

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

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

12.

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

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

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

13.

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

  1. For \(y=5\text{.}\)

  2. For \(y=-4\text{.}\)

14.

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

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

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

15.

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

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

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

16.

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

  1. For \(r=5\text{.}\)

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

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

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

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

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

19.

Evaluate \({-10\!\left(t+7\right)}\) for \(t = 5\text{.}\)

20.

Evaluate \({-6\!\left(x+5\right)}\) for \(x = -3\text{.}\)

21.

Evaluate \(\displaystyle{{\frac{9x-9}{6x}}}\) for \(x=-10\text{.}\)

22.

Evaluate \(\displaystyle{{\frac{4y-2}{6y}}}\) for \(y=4\text{.}\)

23.

Evaluate \({-5c-2b}\) for \(c = 4\) and \(b = 2\text{.}\)

24.

Evaluate \({6A-3C}\) for \(A = -8\) and \(C = -4\text{.}\)

25.

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

26.

Evaluate \(\displaystyle{{\frac{-5}{m}-\frac{7}{b}}}\) for \(m = 2\) and \(b = -6\text{.}\)

27.

Evaluate \(\displaystyle{{\frac{-4p+4C-10}{4p-3C}}}\) for \(p=-3\) and \(C=-1\text{.}\)

28.

Evaluate \(\displaystyle{{\frac{-q+6A+2}{-8q+7A}}}\) for \(q=6\) and \(A=-6\text{.}\)

29.

Evaluate \({\left(y+6\right)^{2}+8}\) for \(y=-5\text{.}\)

30.

Evaluate \({{\frac{1}{6}}\!\left(r-2\right)^{2}+3}\) for \(r=8\text{.}\)

31.

Evaluate \({-\left(9a^{2}+2a+2\right)}\) for \(a=1\text{.}\)

32.

Evaluate \({-\left(c^{2}+8c+2\right)}\) for \(c=-6\text{.}\)

33.

Evaluate \({\left(7A\right)^{3}}\) for \(A=-2\text{.}\)

34.

Evaluate \({\left(-5C\right)^{3}}\) for \(C=-5\text{.}\)

35.

Evaluate \({\left(5m\right)^{2}}\) for \(m=2\text{.}\)

36.

Evaluate \({\left(-8p\right)^{3}}\) for \(p=8\text{.}\)

37.

Evaluate \({\sqrt{q+4}-3}\) for \(q=21\text{.}\)

38.

Evaluate \({\sqrt{y+8}-1}\) for \(y=-4\text{.}\)

39.

Evaluate \({-\left(4\sqrt{r-3}+7\right)}\) for \(r=52\text{.}\)

40.

Evaluate \({7-4\sqrt{a+5}}\) for \(a=11\text{.}\)

41.

Evaluate \({\left|b-6\right|+2}\) for \(b=-8\text{.}\)

42.

Evaluate \({\left|A+2\right|-3}\) for \(A=4\text{.}\)

43.

Evaluate \({-\left(5\!\left|C-9\right|+9\right)}\) for \(C=-2\text{.}\)

44.

Evaluate \({5-5\!\left|m-1\right|}\) for \(m=-9\text{.}\)

45.

Evaluate \(\frac{y_2-y_1}{x_2-x_1}\) for \(x_1=8\text{,}\) \(x_2=3\text{,}\) \(y_1=8\text{,}\) and \(y_2=-1\text{.}\)

46.

Evaluate \(\frac{y_2-y_1}{x_2-x_1}\) for \(x_1=10\text{,}\) \(x_2=-4\text{,}\) \(y_1=-5\text{,}\) and \(y_2=-6\text{.}\)

47.

Evaluate \(\sqrt{\left(x_2-x_1\right)^2 + \left(y_2-y_1\right)^2}\) for \(x_1=4\text{,}\) \(x_2=12\text{,}\) \(y_1=-7\text{,}\) and \(y_2=-13\text{.}\)

48.

Evaluate \(\sqrt{\left(x_2-x_1\right)^2 + \left(y_2-y_1\right)^2}\) for \(x_1=-8\text{,}\) \(x_2=0\text{,}\) \(y_1=-7\text{,}\) and \(y_2=-1\text{.}\)

49.

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

50.

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

51.

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

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

52.

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

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

53.

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 \(95 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

54.

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 \(113 {^\circ}\text{F}\text{,}\) what is that temperature measured in Celsius?

55.

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 six miles.

kilometers corresponds to six miles.

56.

A formula for converting pounds into kilograms is

\begin{equation*} K = 0.45P \end{equation*}

where \(P\) is a number of pounds, and \(K\) is the corresponding number of kilograms.

Use the formula to find the number of kilograms that corresponds to eighteen pounds.

kilograms corresponds to eighteen pounds.

57.

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={60\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s}}}\text{,}\) from an initial position of \(y_0= {76\ {\rm m}}\text{,}\) and at time \(t={12\ {\rm s}}\text{?}\)

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

58.

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={65\ {\textstyle\frac{\rm\mathstrut m}{\rm\mathstrut s}}}\text{,}\) from an initial position of \(y_0= {58\ {\rm m}}\text{,}\) and at time \(t={4\ {\rm s}}\text{?}\)

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

59.

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 2004?

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

60.

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 2006?

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

61.

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 \(63\%\) level for someone who is \(17\) years old. Round your answer to an integer.

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

62.

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 \(65\%\) level for someone who is \(57\) years old. Round your answer to an integer.

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

63.

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={7\ {\rm ft}}\text{.}\)

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

64.

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={21\ {\rm ft}}\) and \(W={20\ {\rm ft}}\text{.}\)

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

65.

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

\begin{equation*} h={-2\!\left|d-4.2\right|+7} \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. \({3.2\ {\rm ft}}\) from the edge.

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

66.

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

\begin{equation*} h={-1.5\!\left|d-4.6\right|+7} \end{equation*}

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

Determine the height when you are:

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

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

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

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

67.

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

\begin{equation*} -1.5\abs{d-4}+6 \end{equation*}

Determine the height when you are:

  1. 2 ft from the edge

  2. 6.5 ft from the edge

68.

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

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

Determine the diagonal length of rectangles with:

  1. length 5 cm and width 12 cm

  2. length 4 ft and width 10 ft