In Algebra, and other fields of mathematics, a **variable** is a placeholder, which represents an unknown quantity. Variables are usually represented with a letter. At a simple level, you can think of them like containers that hold numbers we're trying to figure out.

Variables are powerful, essential tools in the math, science, and computing fields. But before we get into some potential uses of variables, let's examine some more basic concepts.

Consider the following equation: \(6+4=10\)

Now consider this equation, where the value of 4 is replaced with the variable \(x\).

\(6+x=10\)

What does the variable \(x\) equal in the above equation?

\(x\) must equal 4, because 4 is the only potential value that satisfies \(6+x=10\)

Notice that the variable \(x\) is displayed in a lower case stylized script or cursive font. This is commonly how variables are shown in academic materials. You do not need to write them this way, if you don't know cursive or if your handwriting isn't the best. A lower case letter written however you normally would write it will suffice, unless your teacher specifically asks you to write them stylized.

Now, look at this equation: \(10-y=5\)

What must the variable \(y\) equal in the above equation?

It may be helpful to ask yourself the question, 10 minus *what* equals five? Ten minus five equals five.

So the solution to the equation is: \(y=5\)

## Substitution Examples

**Substitution** means replacing one thing with another. The following examples show how to substitute values in for variables.

**1.** Given \(x=1\) solve the following expression.

Expression: \(5+x\)

Substitute \(1\) in for \(x\)

\(5+1\)

Then solve.

\(5+1=6\)

\(5+x=6\)

**2.** Given \(y=5\) solve the following expression.

Expression: \(y+8\)

Substitute 5 in for \(y\)

\(5+8\)

Solve it.

\(5+8=13\)

\(y+8=13\)

**3.** Given \(x=5\) and \(y=2\), solve the following expression:

Expression: \(x\times y\)

Substitute 5 in for \(x\) and 2 in for \(y\), rewrite the expression.

\(5 \times 2\)

Solve it.

\(5 \times 2 = 10\)

\(x \times y = 10\)

### Review Questions

Given \(a=5, b=2, c=7\) evaluate the following expressions.

**r1.** Evaluate

\(5\times a\)

**r2.** Evaluate

\(3\times c-a\)

**r3.** Evaluate

\(b+a+c-5\)

## Solving For a Variable

Now that you have a general idea of what variables are, let's look at some slightly more complex examples. In these scenarios, you will examine equations and attempt to determine what value the variable must be equal to.

**4.** Solve for the variable \(x\) in the following equation:

\(10+x=15\)

Ask yourself, ten plus what number equals fifteen?

The correct answer is five. Five plus ten equals fifteen.

\(10+5=15\)

Therefore, \(x\) must be equal to five.

\(x=5\)

**5.** Solve for the variable \(a\) in the following equation:

\(100 \div a=10\)

Ask yourself, 100 divided by what number equals 10?

\(100 \div 10 = 10\)

The answer is ten, because \(100 \div 10 = 10\)

Therefore, the variable \(a\) must equal ten.

\(a=10\)

**6.** Solve for the variable \(b\) in the following equation:

\(5 \times b = 50\)

Ask yourself, five multiplied by what number equals 50?

\(5 \times 10 = 50\)

The solution is 10, since five times ten equals fifty.

The variable \(b\) must equal 10.

\(b=10\)

### Review Questions

Solve for \(x\) in the following equations.

**r4.** Solve for x

\(x+5=15\)

**r5.** Solve for x

\(x\times 3=12\)

**r6.** Solve for x

\(x+1+2=7\)

## Variable Constants

A **constant** is a fixed value. It is "constant." You will often see constants positioned in front of variables. When you see a constant with a variable, it means you must multiply the variable by that constant.

The expression \(3x\) is equivalent to \(3 \times x\) or \(x+x+x\). It literally means three x's.

A single variable by itself, with no specified coefficient, has a coefficient of 1.

\(x = 1x\)

\(3x = 1x + 1x + 1x\)

Here are some more examples, for your reference.

**7.** Given \(x=5\), evaluate the expression:

Expression: \(3x\)

Rewrite

\(3 \times x\)

Substitute

\(3 \times 5\)

Solve

\(3 \times 5 = 15\)

\(3x=15\)

**8.** Solve for y in the following equation.

\(4y=16\)

Rewrite

\(4 \times y = 16\)

Ask yourself, 4 times what equals 16?

The answer is 4. \(4 \times 4 = 16\)

Therefore, \(y = 4\)

**9.** Solve for \(a\) in the following equation given \(b=2\)

\(3a+5b=22\)

Rewrite and substitute the values you know:

\(3 \times a + 5 \times 2 = 22\)

Solve the expressions you can (\(5 \times 2 = 10\))

\(3 \times a + 10 = 22\)

Ask yourself, three times what plus ten equals 22?

The answer is 4, since \(3 \times 4 = 12\) and \(12 + 10 = 22\)

Therefore, \(a = 4\)

If you had difficulty with this one, you'll learn a better way to solve it below.

### Review Questions

**r7.** Solve for \(b\)

\(5b=3+2\)

**r8.** Given \(x=6\) evaluate the expression

6x+6

**r9.** Given \(a=1, b=2\) evaluate

\(3a+2b\)

## Solving With Algebraic Arithmetic

In the examples shown so far, we solved for variables by asking *what number* times or plus some other number equals our final answer. This works for simple equations, like \(1+x=2\), but for more involved equations, it might be more difficult for you to intuitively determine the correct solution this way.

Consider the following equation: \(3x + 8 - 2x + 1 = 12\)

Now, it's a bit harder to just look at the equation and find the answer by thinking about it. We're still asking the same question, what number multiplied by three plus eight minus three times itself plus one equals twelve? But it's probably more difficult for you to find the answer just by looking at it.

You're now going to learn how to manipulate equations to solve for variables in a step-by-step manner that involves no guesswork.

### Properties of Equality

The **additive property of equality** says that if we add or subtract the same number from both sides of an equation, the equations remain equal.

Look at this equation: \(5=5\)

Now, let's see what happens when we add 1 to each side: \(5+1=5+1\)

\(6=6\)

If I add the same number to both sides of the equation, the equations remain equal. It does not matter what the number is, so long as it's equally added on both sides.

\(5+10=5+10\)

\(5+20=5+20\)

This demonstrates the additive property of equality.

#### Additive Property (Example 10)

We can use this property to help us solve for variables. Look at this equation:

\(x-12=20\)

The additive property of equality allows us to add or subtract numbers to both sides of the equation, so long as it's the same number on both sides.

If I want to isolate the variable \(x\) on the left side of the equation, and get rid of the \(-12\), we need to make the -12 become zero. To do this, we can add positive \(+12\) to both sides.

\(x-12+12=20+12\)

Since \(-12+12=0\), the equation becomes:

\(x+0=20+12\)

Solve

\(x=20+12\)

\(x=32\)

You can go back and check that the value you found is correct by plugging it into the original equation and solving it:

\(32-12=20\)

Since \(32-12\) does equal \(20\), we know that the solution \(x=32\) must be correct.

#### Additive Property (Example 11)

Solve for y in the following equation.

\(y-54=243\)

To isolate \(y\) by itself, we can add 54 to both sides of the equation.

\(y-54+54=243+54\)

The \(-54\) and \(+54\) cancel out to zero.

\(y-0=243+54\)

Solve

\(y=243+54\)

\(y=297\)

The **multiplicative** property of equality works the same way as the additive property, but applies to multiplication and division instead of addition and subtraction. If we multiply or divide the left side of an equation by a number, and do the same to the right side, both sides remain equal.

#### Multiplicative Property (Example 12)

Solve for \(x\)

\(3x=30\)

You can divide both sides of the equation by 3, to cancel out the coefficient of 3 attached to the \(x\) variable.

\(3x\div 3 = 30 \div 3\)

\(\frac{3}{3}x=\frac{30}{3}\)

Remember, a number divided by itself is equal to 1. The numbers cancel out.

\(\frac{1}{1}x=10\)

\(x=10\)

Again, you can check the solution by plugging it back into the original equation.

\(3 \times 10 = 30\)

Does \(3 \times 10 = 30\)? Yes it does. We know \(x=10\) must be the correct solution.

#### Multiplicative Property (Example 13)

Solve for \(z\)

\(z \div 8 = 2.5\)

We want to isolate \(z\) by itself on the left side of the equation. To get rid of the \(\div 8\), we need to multiply both sides by the number 8.

\(z \div 8 \times 8 = 2.5 \times 8\)

\(z \div 8 \times 8\) is the same as \(\frac{8}{8}z\)

The eights cancel out on the left, leaving us with:

\(z=2.5 \times 8\)

Solve by hand or by using a calculator

\(z=20\)

When applying multiplicative and additive properties, it does not matter which one you do first, so long as you do the same thing consistently to both sides. Sometimes it may make sense to add first, then multiply. Other times, it may make more sense to multiply first, then add. It depends on the situation. It may be helpful to try solving equations multiple ways.

Consider the following equation: \(3y+5=35\)

If you start by dividing everything by 3, you're left with this:

\(\frac{3y+5}{3}=\frac{35}{3}\)

Simplify

\(y+\frac{5}{3}=\frac{35}{3}\)

Subtract \(\frac{5}{3}\) from both sides.

\(y=\frac{35}{3}-\frac{5}{3}\)

Evaluate/simplify

\(y=\frac{30}{3}\)

\(y=10\)

Now, let's solve the equation by subtracting 5 from both sides in the first step, instead of dividing by 3.

\(3y+5=35\)

\(3y+5-5=35-5\)

\(3y=30\)

\(3y \div 3 = 30 \div 3\)

\(y = 10\)

In this case, I found it easier to start by subtracting 5 than by dividing by 3. This eliminated the need to deal with complex fractions and made the problem easier to solve.

### Review Questions

**r10.** Solve for \(x\)

\(2x-5=15\)

**r11.** Solve for \(a\)

\(a \times 4 = 20\)

**r12.** Solve for \(b\)

\(54=7b+5\)

## Combining Like Terms

Now, we'll going to deal with some slightly more advanced examples.

When multiple numbers in an equation have like terms, they may be combined. Like terms mean the variable and the exponent on the variable are the same, but the coefficient/constant may differ.

For example, in this equation \(3x+5+2x=7\), the terms \(3x\) and \(2x\) can be combined, because the variable is the same. With like x-terms combined, it becomes \(5x+5=7\)

Review the following examples.

**14.** Solve for x.

\(5x-2x+3=12\)

Isolate the x variables on the left side, by subtracting 3 from both sides

\(5x-2x+3-3=12-3\)

\(5x-2x=9\)

Combine like terms

3x=9

Divide both sides by 3

\(3x\div 3 = 9 \div 3\)

Evaluate

\(x=3\)

**15.** Solve for y.

\(5y-8y+4=34\)

Isolate y variables on left side, subtract 4 from both sides

\(5y-8y+4-4=34-4\)

\(5y-8y=30\)

Combine y terms

\(-3y=30\)

Divide both sides by -3

\(-3y \div -3 = 30 \div -3\)

\(y=-10\)

**16.** Solve for z.

\(32z+24=16z+64\)

Subtract 24 from both sides.

\(32z+24-24=16z+64-24\)

\(32z=16z+64-24\)

\(32z=16z+40\)

Subtract 16z from both sides. This isolates all the z variables to the left.

\(32z-16z=16z+16z+40\)

Combine like terms, evaluate.

\(16z=40\)

\(16z \div 16 = 40 \div 16\)

\(z = \frac{40}{16}\)

Simplify the fraction

\(z=2.5\)

### Review Questions

**r13.** Solve for x

\(3x+10=-2x-20\)

**r14.** Solve for y

\(\frac{2y+12}{4}=y+4\)

**r15.** Solve for x

\(3x+2x+x-5=4(x+2)\)

## Two-Variable Equations

Variables become especially useful when we look at equations with multiple variables. One variable acts as the input, the other as the output. For each input, there's some type of output.

**17. Word Problem:** A student is selling cookies for a fundraiser. For each box of cookies sold, $3 is raised for the fundraiser (the profit of each sale).

If the variable \(x\) represents the number of boxes of cookies sold, and the variable \(y\) represents the total funds raised, the above situation could be represented by the following equation:

\(y=3x\)

So \(y\), the total profit, equals \(x\), the number of boxes sold, times \(3\), the constant profit made off each box.

Now, we can find the profit raised by selling many boxes of cookies.

If the student sells 18 boxes of cookies, how much profit do they make?

\(x=18\)

\(y=3\times18\)

\(y=54\)

The student would raise $54 if 18 boxes of cookies are sold.

We can use the same equation, \(y=3x\) to determine how many boxes of cookies we need to sell to meet a certain goal.

If the student wants to raise $200, how many boxes do they need to sell?

In this case, we know the target profit \(y=200\).

Now, we need to solve for \(x\) given \(y=200\).

\(200=3x\)

\(200\div3=3x\div3\)

\(200\div3=x\)

Since both sides are equal to one another, you can just swap the entire left and right sides of the equation whenever you want.

\(x=200\div3\)

\(x=66\frac{2}{3}\)

Since the answer is \(66\frac{2}{3}\), we will assume the student cannot sell a fractional box of cookies. They must sell 67 boxes or more to get over their goal of raising $200.

### Variables in terms of Variables

We can combine like terms, and solve equations in terms of other variables. These equations don't have one definite solution, but a variety of solutions represented by variables.

**18.** Solve for \(a\) in terms of \(b\)

\(3a-2b=3b+2a\)

Add \(2b\) to both sides

This eliminates the b term from the left side

\(3a-2b+2b=3b+2a+2b\)

\(3a=5b+2a\)

Subtract \(2a\) from each side

\(3a-2a=5b+2a-2a\)

Final answer:

\(a=5b\)

**19.** Solve for \(e\) in terms of \(f\)

\(3fe=4\)

You can divide both sides by \(3f\)

\(3fe\div(3f)=4\div(3f)\)

\(e=\frac{4}{3f}\)

**20.** Solve for \(y\) in terms of \(x\)

\(3y+2x=4x-7\)

Isolate the x and y variables on opposite sides of the equation. We want to get the y variable by itself.

So, we will subtract \(2x\) from both sides.

\(3y+2x-2x=4x-7-2x\)

Simplify/combine terms

\(3y=2x-7\)

Divide both sides by 3 to solve for y. Note that we must divide the entire right side by 3.

\(3y\div3=(2x-7)\div3\)

Our solution is this:

\(y=\frac{2x-7}{3}\)

**21.** Solve for \(b\) in terms of \(a\).

\(5(3a+b)=2a\)

Distribute the 5

\(15a+5b=2a\)

Isolate b on the left side, subtract 15a from both sides

\(15a+5b-15a=2a-15a\)

\(5b=2a-15a\)

\(5b=-13a\)

Divide both sides by 5

\(b=\frac{-13a}{5}\)

### Review Questions

**r16.** Solve for \(y\) in terms of \(x\)

\(6x+3y=18\)

**r17.** Solve for \(a\) in terms of \(b\)

\(4b-2a=2a+16\)

**r18.** Solve for \(p\) in terms of \(q\)

\(\frac{2p+q}{3}=3q+8\)

Review Question Solutions

### Review Question Solutions:

Given \(a=5, b=2, c=7\) evaluate...

**r1.** Evaluate

\(5\times a\)

Substitute \(5 \times 5\)

Answer: \(25\)

**r2.** Evaluate

\(3\times c-a\)

Substitute \(3\times 7 - 5\)

Evaluate following order of operations.

\(21-5\)

Answer: \(16\)

**r3.** Evaluate

\(b+a+c-5\)

Substitute: \(2+5+7-5\)

Evaluate: \(7+7-5=14-5=9\)

The answer is 9

**r4.** Solve for x

\(x+5=15\)

Subtract 5 from both sides, isolate x on one side \(x+5-5=15-5\)

\(x=15-5\)

Solution: \(x=10\)

**r5.** Solve for x

\(x\times 3=12\)

Divide both sides by 3 to cancel out the 3 on the left

\(x \frac{3}{3} = \frac{12}{3}\)

Solution: \(x=4\)

**r6.** Solve for x

\(x+1+2=7\)

Combine like terms: \(x+3=7\)

Subtract 3 from each side \(x+3-3=7-3\)

Evaluate: \(x=7-3\)

Solution: \(x=4\)

**r7.** Solve for \(b\)

\(5b=3+2\)

\(5b=5\)

\(5b\div5=5\div5\)

\(b=1\)

**r8.** Given \(x=6\) evaluate the expression

6x+6

Substitute: \(6\times 6 + 6\)

Evaluate: \(36+6\)

Solution: \(42\)

**r9.** Given \(a=1, b=2\) evaluate

\(3a+2b\)

Substitute: \(3\times 1+ 2\times 2\)

Evaluate: \(3+4\)

Solution: \(7\)

**r10.** Solve for \(x\)

\(2x-5=15\)

\(2x-5+5=15+5\)

\(2x=20\)

Solution: \(x=10\)

**r11.** Solve for \(a\)

\(a \times 4 = 20\)

\(\frac{a\times4}{4} = \frac{20}{4}\)

Solution: \(a=5\)

**r12.** Solve for \(b\)

\(54=7b+5\)

\(54-5=7b+5-5\)

\(49=7b\)

\(\frac{49}{7}=\frac{7b}{7}\)

\(7=b\)

Solution: \(b=7\)

**r13.** Solve for x

\(3x+10=-2x-20\)

\(3x+10-10=-2x-20-10\)

\(3x=-2x-30\)

\(3x+2x=-2x+2x-30\)

\(5x=-30\)

\(\frac{5x}{5}=\frac{-30}{5}\)

Solution: \(x=-6\)

**r14.** Solve for y

\(\frac{2y+12}{4}=y+4\)

Multiply by 4 to get rid of the denominator

\(\frac{2y+12}{4}\times 4=4(y+4)\)

\(2y+12=4y+16\)

\(2y+12-12=4y+16-12\)

\(2y=4y+4\)

\(2y-4y=4\)

\(-2y=4\)

\(-2y \div -2 = 4 \div -2\)

Solution: \(y=-2\)

**r15.** Solve for x

\(3x+2x+x-5=4(x+2)\)

Combine like terms

\(6x-5=4(x+2)\)

Distribute the 4

\(6x-5=4x+8\)

Subtract 4x

\(6x-4x-5=8\)

Add 5

\(2x=13\)

Divide by 2

\(\frac{2x}{2}=\frac{13}{2}\)

Solution: \(x=\frac{13}{2}\)

**r16.** Solve for \(y\) in terms of \(x\)

\(6x+3y=18\)

We want \(y\) by itself on the left side.

Subtract 6x: \(3y=18-6x\)

Divide by 3

\(y=\frac{18-6x}{3}\)

Simplify:\(y=\frac{18}{3}-\frac{6x}{3}\)

\(y=6-2x\)

**r17.** Solve for \(a\) in terms of \(b\)

\(4b-2a=2a+16\)

Subtract \(4b\) and \(2a\) from both sides to get the a term by itself.

\(-2a-2a=-4b+16\)

\(-4a=-4b+16\)

Divide by -4

\(a=\frac{-4b+16}{-4}\)

Simplify: \(a=\frac{-4b}{-4}+\frac{16}{-4}\)

\(a=b-4\)

**r18.** Solve for \(p\) in terms of \(q\)

\(\frac{2p+q}{3}=3q+8\)

Get rid of the fraction by multiplying both sides by 3

\(2p+q=3(3q+8)\)

\(2p+q=9q+24\)

Subtract q

\(2p=9q-q+24\)

\(2p=8q+24\)

Divide by 2

\(p=\frac{8q+24}{2}\)

Simplify/Solution: \(p=4q+12\)