Solving for a Variable

Learning goals

  • Isolate a chosen letter, treating the others as fixed numbers
  • Rearrange A=lwA = lw into w=Alw = \dfrac{A}{l}
  • Factor the target out when it appears in several terms
  • State the nonzero condition that dividing by a letter assumes
  • Check a rearranged formula with simple numbers from the original

What it means to solve for a variable

A literal equation contains more than one letter, such as A=lwA = lw, d=rtd = rt, or P=2l+2wP = 2l + 2w. Many geometry and science formulas have this form.

To solve for a variable means to get that variable alone on one side, with no copy of it on the other side. For a rectangle with positive lengths, solving A=lwA = lw for ww gives w=Alw = \dfrac{A}{l}; solving for ll gives l=Awl = \dfrac{A}{w}.

Treat the other letters as fixed numbers while you work. For example, 12=4w12 = 4w gives w=3w = 3 by division by 44. In A=lwA = lw, the fixed quantities AA and ll play the roles of 1212 and 44. Their values need not be known yet to carry out the same division.

The same moves, now with letters

The properties of equality still apply. Add or subtract the same quantity on both sides, or multiply or divide both sides by a nonzero quantity. Undo the operations around the target variable in reverse order.

Why isolating a letter uses the same moves#

For 18=6w18 = 6w, dividing both sides by 66 gives 186=w\dfrac{18}{6} = w, so w=3w = 3. Multiplying by 66 reverses that step: 6⋅3=186 \cdot 3 = 18.

For A=lwA = lw, divide both sides by ll, provided l≠0l \neq 0:

Al=lwl=w.\frac{A}{l} = \frac{lw}{l} = w.

Thus w=Alw = \dfrac{A}{l}. Multiplying both sides by ll recovers A=lwA = lw, so the rearrangement keeps the same relationship. The steps are the same as with the number 66, and they work for any value of ll that is not zero.

Rearranging the area formula A = lw into w = A over lA rectangle whose top side is labeled l, whose left side is labeled w, and whose interior is labeled A. Beside it, the equation A equals l times w has an arrow labeled divide by l pointing to the rearranged form w equals A over l.lwAA = l w÷ lw = A / lsolving the area formula for the width
For a rectangle with positive length l and width w, A = lw. Dividing by the nonzero length gives w = A/l.

Worked example 1 Solve d=rtd = rt for the rate rr

The distance formula d=rtd = rt multiplies the rate rr by the time tt. To solve for rr, undo that multiplication by dividing both sides by tt, provided the elapsed time is nonzero:

dt=rtt=r,sor=dt.\frac{d}{t} = \frac{rt}{t} = r, \qquad\text{so}\qquad r = \frac{d}{t}.

In words, the rate is the distance divided by the time, which is the average rate over the whole trip. Solving for tt works the same way: dividing by rr gives t=drt = \dfrac{d}{r}, provided r≠0r \neq 0. With a rate of zero, you cannot get the time back by dividing.

Rearranging a formula in more than one step

When several operations surround the target, undo the last one first. In 2w+2l2w + 2l, the last operation is adding 2l2l. In 59(F−32)\dfrac{5}{9}(F - 32), it is multiplying the whole group by 59\dfrac{5}{9}. The order depends on how the expression was built.

Worked example 2 Solve P=2l+2wP = 2l + 2w for the width ww

The perimeter of a rectangle is P=2l+2wP = 2l + 2w. The target ww sits inside the term 2w2w, with 2l2l added on, so undo in reverse. Subtract the added 2l2l from both sides first:

P−2l=2w.P - 2l = 2w.

Now divide both sides by the coefficient 22, dividing every term of the left side:

w=P−2l2.w = \frac{P - 2l}{2}.

Watch that last step. Dividing only the PP and forgetting the 2l2l gives the wrong P2−2l\dfrac{P}{2} - 2l; the correct result is P−2l2\dfrac{P - 2l}{2}, which equals P2−l\dfrac{P}{2} - l once each term is divided.

Worked example 3 Solve C=59(F−32)C = \dfrac{5}{9}(F - 32) for FF

The formula C=59(F−32)C = \dfrac{5}{9}(F - 32) turns a Fahrenheit temperature into Celsius. To get Fahrenheit from Celsius instead, solve for FF. The target is under two layers: it is inside the parentheses, and the whole parenthesis is multiplied by 59\frac{5}{9}. Undo the outer layer first by multiplying both sides by the reciprocal 95\frac{9}{5}:

95C=F−32.\frac{9}{5}C = F - 32.

Then add 3232 to both sides to free FF:

F=95C+32.F = \frac{9}{5}C + 32.

This form gives the Fahrenheit temperature directly from the Celsius temperature, so you can use it for every new reading without rearranging again.

Worked example 4 Solve y=mx+by = mx + b for xx

In y=mx+by = mx + b, yy already stands alone. To solve for xx, treat yy, mm, and bb as fixed numbers. Subtract bb from both sides:

y−b=mx.y - b = mx.

Then divide by the coefficient mm, provided m≠0m \neq 0:

x=y−bm.x = \frac{y - b}{m}.

Keep the whole numerator y−by - b together over mm.

Check your understanding

Which formula solves ax+b=cax + b = c for xx, where a≠0a \neq 0 and aa, bb, cc are fixed constants? Test your choice with a=2a = 2, b=1b = 1, c=7c = 7 by substituting its value of xx into 2x+1=72x + 1 = 7.

Answer choices

When the target appears in more than one term

When the target appears in several terms, combine those terms first. In 3x+2x=203x + 2x = 20, the left side is (3+2)x=5x(3 + 2)x = 5x. Dividing by 55 then gives x=4x = 4.

This is the distributive law in reverse, the same idea used for combining like terms and factoring expressions. It also works when the coefficients are letters, as in ax+bx=cax + bx = c. Dividing by aa alone, even when a≠0a \neq 0, leaves x+baxx + \dfrac{b}{a}x on the left. Factor first, so that the target appears only once.

Why a target in two terms must be factored out#

Start with 4x+3x=354x + 3x = 35. Use the distributive law to gather the two copies of xx:

4x+3x=35,x(4+3)=35,7x=35.\begin{gathered} 4x + 3x = 35, \\ x(4 + 3) = 35, \\ 7x = 35. \end{gathered}

Dividing by the nonzero combined coefficient 77 gives x=5x = 5. Check: 4(5)+3(5)=20+15=354(5) + 3(5) = 20 + 15 = 35. The same law works for any fixed coefficients aa and bb in place of 44 and 33:

ax+bx=x(a+b).ax + bx = x(a + b).

So ax+bx=cax + bx = c becomes x(a+b)=cx(a + b) = c. If a+b≠0a + b \neq 0, divide both sides by a+ba + b:

x=ca+b.x = \frac{c}{a + b}.

If a+b=0a + b = 0 instead, the equation is 0=c0 = c: it has no solution when c≠0c \neq 0, and every real xx works when c=0c = 0.

Use the same steps when the target starts on both sides of the equation. Bring every term containing the target to one side first, then factor it out.

Worked example 5 Solve ax=bx+cax = bx + c for xx

Here the target xx appears on both sides, in axax and in bxbx. First bring both xx terms to the same side by subtracting bxbx from both sides:

ax−bx=c.ax - bx = c.

Now the two copies of xx sit together, so factor xx out by reading the distributive law backward:

x(a−b)=c.x(a - b) = c.

With xx in a single place, divide both sides by a−ba - b, which requires a≠ba \neq b so the divisor is not zero:

x=ca−b.x = \frac{c}{a - b}.

Worked example 6 Solve A=P+PrtA = P + Prt for the principal PP

The amount in a simple-interest account after a time tt is A=P+PrtA = P + Prt, the principal PP plus the interest PrtPrt it earns. To recover the principal from the final amount, solve for PP. The target appears in both terms on the right, so factor it out. Both PP and PrtPrt share the factor PP:

A=P(1+rt).A = P(1 + rt).

Now PP multiplies the single quantity 1+rt1 + rt, so divide both sides by it, provided 1+rt≠01 + rt \neq 0:

P=A1+rt.P = \frac{A}{1 + rt}.

Here rr is the interest rate per time unit, written as a decimal, and tt uses that same time unit. For nonnegative rr and tt, 1+rt1 + rt is at least 11, so division is allowed. The factor pulled out is PP; the factor left in parentheses is 1+rt1 + rt. The lone PP is P⋅1P \cdot 1, so the 11 must remain. Expanding P(1+rt)P(1 + rt) checks that both original terms return.

Check your understanding

Solve mx+nx=pmx + nx = p for xx, where m+n≠0m + n \neq 0.

Answer choices

Dividing by a letter, and checking the result

Recall the nonzero-denominator rule from Algebraic Fractions: division is defined only when the divisor is not zero. For known numbers such as 22 and 2π2\pi, we know the divisor is not zero. A symbolic divisor may be zero even when its separate letters are not. For example, a−ba - b is zero whenever a=ba = b. State the nonzero condition before dividing. A real situation may guarantee it, the way positive side lengths do for a rectangle, but a letter by itself does not.

The formula x=ca−bx = \dfrac{c}{a - b} from Example 5 applies only when a≠ba \neq b. When a=ba = b, return to ax=bx+cax = bx + c: subtracting axax gives 0=c0 = c. If c=0c = 0, any real xx works; if c≠0c \neq 0, none does. The rearranged fraction cannot describe those cases.

Also keep restrictions already present in the original equation. Clearing a denominator does not make a previously excluded value allowed. For example, p=qrp = \dfrac{q}{r} requires r≠0r \neq 0. Multiplying by rr gives q=prq = pr, but the original restriction r≠0r \neq 0 still applies.

To isolate a letter that starts in the denominator, consider 4=28r4 = \dfrac{28}{r} with r≠0r \neq 0. Multiplying by rr gives 4r=284r = 28, then dividing by 44 gives r=7r = 7. Checking, 28/7=428/7 = 4.

For the general equation p=qrp = \dfrac{q}{r}, start from q=prq = pr. If p≠0p \neq 0, dividing by pp gives r=qpr = \dfrac{q}{p}. This value is allowed only when q≠0q \neq 0, since the original requires r≠0r \neq 0. If pp and qq are both zero, every nonzero rr works in the original equation. If exactly one of them is zero, no allowed rr works. So there is exactly one solution when pp and qq are both nonzero, and not otherwise.

Check your understanding

Solve C=2πrC = 2\pi r for rr. Which condition, if any, belongs with your answer?

Answer choices

The area formula A=lwA = lw and the box-volume formula V=lwhV = lwh use letter divisors when rearranged. Positive dimensions guarantee those divisors are nonzero. If the letters can be any numbers, you have to state that each divisor is not zero.

Check your understanding

Isolate ww in A=lwA = lw and hh in V=lwhV = lwh. Which pair gives the formulas and the algebraic divisor conditions that justify them?

Answer choices

To check a rearrangement, choose simple numbers that satisfy the original formula and its restrictions. For a rectangle with l=5l = 5 and w=3w = 3, the area is A=15A = 15. The rearranged formula gives Al=155=3\dfrac{A}{l} = \dfrac{15}{5} = 3, matching the original width.

If the numbers do not match, there is an error somewhere. A successful check is useful, but one set of numbers cannot prove the formula for every input. For that, you rely on the reversible algebra steps.

Check your understanding

The formula m=y−bxm = \dfrac{y - b}{x}, with x≠0x \neq 0, can be rearranged. Solve it for yy.

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)
A bit of history (optional)

The letters in a formula have not always followed today’s conventions. In 1591, François Viète used letters for both known and unknown quantities. He distinguished them with consonants for known quantities and vowels for unknown ones. That let a calculation describe a pattern rather than just one numerical problem.

René Descartes used a different division of the alphabet in La Géométrie, published in 1637. Letters near the beginning, such as aa, bb, and cc, represented known quantities; letters near the end, such as xx, yy, and zz, represented unknowns. This convention became familiar enough that a reader can often guess the roles of letters before reading the explanation.

This is only a convention, and any letter can stand for a known or an unknown quantity. You can rearrange a formula for aa just as well as for xx, depending on which quantity the problem asks you to find.

MacTutor: the history of letters for known and unknown quantities

Your progress

See all your progress →