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 is an equation that contains more than one letter, and once you start looking, literal equations are everywhere. The equations A=lwA = lw, d=rtd = rt, P=2l+2wP = 2l + 2w, and C=2πrC = 2\pi r are all literal equations, and so is nearly every formula in geometry and science.

To solve for a particular variable in such an equation is to rewrite the equation so that one variable stands alone on a side. Every other letter and number is gathered on the other side. Solving A=lwA = lw for ww means reaching w=Alw = \dfrac{A}{l}; solving the same equation for ll means reaching l=Awl = \dfrac{A}{w}. The relationship never changes what it says. You are only rewriting it so a different letter becomes the subject.

The key that unlocks all of this is a small shift in how you read the other letters. When you solve A=lwA = lw for ww, treat ll as one fixed quantity, a stand-in for some length whose value you do not need to know while you work. That is exactly the way the first lesson of this subject taught you to see a letter as a placeholder for a number. Then A=lwA = lw has the same shape as 12=4w12 = 4w, and you already know to divide by the coefficient. Solving for a variable is nothing more than the equation solving of the last few lessons, carried out with letters sitting patiently where the numbers used to be.

The same moves, now with letters

Because the other letters behave like fixed numbers, the tools are the ones you already trust: the properties of equality. You may add, subtract, multiply, or divide both sides by the same quantity (nonzero for multiplying and dividing), and each move produces an equivalent equation. To solve for a target variable, undo the operations wrapped around it in reverse order, using inverse operations, until it stands alone. The only difference from before is that the numbers you add or divide by now wear letters.

Why isolating a letter uses the very same moves#

The properties of equality do not care whether the multiplier you divide by is a numeral or a letter: they let you divide both sides by it all the same, provided it is not zero.

So divide both sides of A=lwA = lw by ll. On the right, the ll in the numerator cancels the ll you divided by, leaving ww alone:

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

Read the result the usual way round and w=Alw = \dfrac{A}{l}, provided l≠0l \neq 0. The single move, dividing both sides by the coefficient of the target, is the same one that finished every equation in the last few lessons. Treating ll as a fixed quantity is what makes a letter behave like the 44 in 4w=124w = 12.

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
The area formula solved for the width. A rectangle of length l and width w has area A, so A equals l times w. Dividing both sides by the length l isolates the width, giving w equals A over 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, which a real trip guarantees is not zero:

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

The rearranged formula reads rate as distance divided by time, which is exactly the average rate over the whole trip. Solving instead for tt is the mirror image: dividing by rr gives t=drt = \dfrac{d}{r}, provided r≠0r \neq 0, that is, the trip actually covers some distance.

Rearranging a formula in more than one step

Most formulas wrap the target in more than one operation, so you peel them off in reverse order, just as you did solving two-step equations. Strip away anything added to the target first, then divide by whatever multiplies it. The whole routine from the equation-solving lesson carries over unchanged; the constants are simply letters now.

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. The division must reach the whole left side, every term of it:

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 aim it the other way and read Fahrenheit from Celsius, 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.

That is the companion formula every weather report uses. Rearranging once, rather than re-solving from scratch each time, is the whole payoff: one derivation hands you a formula aimed straight at Fahrenheit.

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

The equation y=mx+by = mx + b describes a line. Solving for yy takes no work at all, since yy already stands alone. Solving for xx takes the familiar two steps. Subtract bb from both sides:

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

Then divide by the coefficient mm, assuming the line is not horizontal so that m≠0m \neq 0:

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

Keep the whole numerator y−by - b together over mm. Throughout, yy is treated as a fixed quantity, no different from the constants mm and bb, and that is what lets the ordinary moves work.

Check your understanding

Solve ax+b=cax + b = c for xx, where a≠0a \neq 0 and aa, bb, cc are fixed constants.

Answer choices

When the target appears in more than one term

Every formula so far held the target in a single term. The one genuinely new situation is a target that appears in two or more terms at once. Try a numeric case first. In 3x+2x=203x + 2x = 20, both terms already hold xx, so combine them the way you combine like terms anywhere: 3x+2x=5x3x + 2x = 5x, which turns the equation into 5x=205x = 20, so x=4x = 4. Writing 3x+2x3x + 2x as (3+2)x(3 + 2)x is exactly the distributive law read backward.

The same idea rescues a symbolic equation like ax+bx=cax + bx = c, where the coefficients are letters instead of numbers. Dividing both sides by aa (assuming a≠0a \neq 0) does remove the coefficient from the first term, but the second term becomes bax\dfrac{b}{a}x: xx is still sitting in two places, just with different coefficients now. No single division finishes the job until the two copies of xx are combined into one, the same combining step that turned 3x+2x3x + 2x into 5x5x above. The fix is the factoring skill from the expanding lesson, the distributive law read in reverse.

Why a target in two terms must be factored out#

Suppose the variable you are solving for, xx, appears in two separate terms, as in ax+bx=cax + bx = c. The distributive law says x(a+b)=ax+bxx(a + b) = ax + bx. Read from right to left, that same equation says

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

which gathers the two copies of xx into a single factor. This is the crucial move: once xx appears only once, multiplied by the quantity a+ba + b, one division finishes the job. Divide both sides by a+ba + b, which is legal as long as a+b≠0a + b \neq 0:

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

Factoring is not a trick saved for tidy expressions; it is the one step that turns two appearances of the target into one. And once the target appears a single time, the ordinary inverse operations isolate it exactly as before.

The same routine handles a target that 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}.

Collecting the target on one side and factoring it out is the routine whenever the variable you want appears more than once.

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}.

For an account earning interest, rr and tt are positive, so 1+rt1 + rt is always at least 11 and the division is safe. The factor pulled out was 1+rt1 + rt, not rtrt. The lone PP is P⋅1P \cdot 1, so a 11 stays behind inside the parentheses; dropping it and writing P=ArtP = \dfrac{A}{rt} is the most common slip here.

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

Every division in this lesson, by ll, by tt, by a+ba + b, quietly assumed the divisor was not zero. With a written number, you can see whether it is zero before you divide. With a letter, or an expression built from letters, you cannot see its value, so you name the condition instead: the same nonzero-denominator rule from the algebraic-fractions lesson. An expression you divide by, or place under a fraction bar, must not be zero, and any value that would make it zero is excluded. For the geometry and motion formulas above, the condition takes care of itself: a side length is positive, and for a trip that actually happens, its distance and duration are both positive, which forces its rate to be positive too. In a purely symbolic rearrangement you should name the condition out loud: w=Alw = \dfrac{A}{l} holds provided l≠0l \neq 0, and x=ca−bx = \dfrac{c}{a - b} holds provided a≠ba \neq b. When the excluded value does happen, in this case a=ba = b, the rearranged formula simply does not apply, and the original equation needs its own look, separate from the rearranging done here.

Check your understanding

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

Answer choices

Now try one where the divisor really is a letter. The volume of a box is V=lwhV = lwh, the length times the width times the height.

Check your understanding

Solve V=lwhV = lwh for hh. What condition must accompany your rearranged formula?

Answer choices

A rearranged formula is easy to check, and the check is worth the few seconds. Pick simple numbers that fit the original, then confirm the rearranged version agrees. Take w=Alw = \dfrac{A}{l}. A rectangle with l=5l = 5 and w=3w = 3 has area A=15A = 15, and the rearranged formula returns Al=155=3\dfrac{A}{l} = \dfrac{15}{5} = 3, matching the width you started with. When a test case comes out wrong, a sign or a stray term in the rearrangement is off. This test catches a slip exactly as substituting a numeric answer back into the original equation does.

Now try it yourself. The first checkpoint rearranged ax+b=cax + b = c into x=c−bax = \dfrac{c - b}{a}. Pick a=2a = 2, b=1b = 1, c=7c = 7: compute xx from the rearranged formula, then substitute that value into the original 2x+1=72x + 1 = 7 and confirm both sides match.

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)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

A single line like A=lwA = lw speaks for every rectangle there has ever been. That reach is younger than it looks. For most of the history of mathematics a general rule was stated in words, or shown once with particular numbers, and readers copied the pattern. The known amounts in a problem had no symbols of their own. Only the unknown got a letter.

Rene Descartes fixed the habit we still keep, in a book he published in 1637. Letters from the front of the alphabet, aa, bb and cc, would stand for quantities being treated as known. Letters from the far end, xx, yy and zz, would stand for the ones being hunted. Nothing deep sits behind the choice, and it could have gone the other way. What it bought was a formula you could read at a glance, its fixed parts and its target already sorted.

That sorting is the move this lesson asks of you, and you make it yourself every time. Solving A=lwA = lw for ww treats ll as a fixed quantity, a length whose value you do not need yet. Solve the same formula for ll instead and the two letters trade places. The line on the page never changes. Your decision about which letter is the target is the thing that changes.