This site is a work in progress. New lessons are added regularly. Contact us

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. The word comes from the Latin littera, for 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 though it were a known number, a stand-in for some fixed length you simply have not been told. 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#

When you solved a numerical equation like 4w=124w = 12, you divided both sides by 44 to reach w=3w = 3. A literal equation is no different. In A=lwA = lw the width ww is multiplied by the length ll, exactly as it was multiplied by 44 before. The difference is that now the multiplier is a letter whose value you have not been told. The properties of equality do not care whether that multiplier is a numeral or a letter. They let you divide both sides by that multiplier 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}. Nothing here is new. 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 though it were a fixed number is what makes a letter behave like the 44 in 4w=124w = 12. That is the whole idea behind solving for a variable.

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 how a speedometer would compute it. Solving instead for tt is the mirror image: dividing by rr gives t=drt = \dfrac{d}{r}.

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:

P2l=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=P2l2.w = \frac{P - 2l}{2}.

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

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

The formula C=59(F32)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=F32.\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, and the graphing chapter will lean on it constantly. Solving for yy takes no work at all, since yy already stands alone, and that is exactly the form a grapher wants. Solving for xx takes the familiar two steps. Subtract bb from both sides:

yb=mx.y - b = mx.

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

x=ybm.x = \frac{y - b}{m}.

Keep the whole numerator yby - b together over mm. Throughout, the value of yy is treated as a known number, 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, treating aa, bb, and cc as known 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, as in ax+bx=cax + bx = c. You cannot divide the trouble away in one stroke, because xx is sitting in two places, and dividing by aa would clear it from the first term only. 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+b0a + 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:

axbx=c.ax - bx = c.

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

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

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

x=cab.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:

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

The factor pulled out was 1+rt1 + rt, not rtrt. The lone PP is P1P \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.

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 numbers that assumption is automatic. With letters it is a genuine condition, 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, because a side length, a speed, and a duration are all positive. In a purely symbolic rearrangement you should name the condition out loud: w=Alw = \dfrac{A}{l} holds provided l0l \neq 0, and x=cabx = \dfrac{c}{a - b} holds provided aba \neq b.

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.

Check your understanding

The formula m=ybxm = \dfrac{y - b}{x} 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.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions 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 promotes ll to a known number, a length you simply have not been told 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.