Functions
Limits and Derivatives
Applications of Differentiation
Integration

The Guess and Check Method for Solving Equations

What It Means to Solve Equations

(If you already read the main lesson before clicking this topic, skip this section)

Perhaps before you’ve seen a problem like “Solve for \(x\) in the equation \(3x+1=7\).” You’ve probably also learned a few ways you could go about “solving for \(x\)” in order to get the problem done. But what does it actually mean to solve for \(x\)? What does that \(x\) mean once we have it?

Suppose you are given a function like \(f(x)=3x+1\). Recall a function is nothing more than a “machine” that takes an input (\(x\)-value) and gives you some output (\(y\)-value). So when you see an equation like \(3x+1=7\), and are asked to “find \(x\),” you are being asked “when does the function \(f(x)=3x+1\) produce an output \(y=7\)?” or rather “for what \(x\)-value does the function \(f(x)=3x+1\) produce an output of \(7\)?” Put in yet another alternative way: “what \(x\)-value(s) make the equation true?”

Similarly, if you are given a pair of functions, say \(f(x)=3x+1\) and \(g(x)=x^2+1\), and are asked to solve for \(x\) in the equation \(f(x)=g(x)\) (or rather \(3x+1=x^2+1\). What this is asking is “when are these two functions equal?” or “for what \(x\)-value are the \(y\)-values the same?” or, more simply: “When are the functions’ outputs the same?”

Regardless of the situation in which you are solving for \(x\), any \(x\)-value for which the equation is true is called a solution of the equation.

Solving Equations by Guess-and-Check

Guess-and-check is perhaps the most inefficient and (forgive me) outright dumb method for solving equations… at least by hand. It takes a while, is often tedious unless one recognizes a pattern quickly, and sometimes leads you away from the correct answer. Many naiive computer algorithms rely on clever variants of the guess-and-check method (or other table search procedure) so we cover it here.

Often, one uses this method in their head, by just plugging different numbers into the function to see what works. Sometimes it’s obvious what you need to plug in. Sometimes it’s not. Let’s explore two examples illustrating this.

We are essentially being asked to find all solutions of the equation \(x^2+1=17\). One could try plugging in \(x=2\) into the left-hand side(LHS) to get \((2)^2+1=5\) but that is not the needed \(17\). One could also try \(x=3\) but that makes the LHS equal to \(10\). However, trying \(x=4\) gives us \((4)^2+1=17\).

However, is this the only \(x\)-value that works? It turns out that \(x=-4\) also works! So the solutions to the equation are \(x=4,-4\). There are no others.


Finding when two functions are equal

In the last example, it was fairly easy to guess which \(x\)-values worked and solved the equation. When you are trying to determine when two functions are equal to one another, it is useful to organize things in a table.

Essentially, this problem is asking for the \(x\)-value that makes the equation \(x^2+1=-4x-3\) true. We will organize our work using a table

\(x\)\(f(x)=x^2+1\)\(g(x)=-4x-3\)
\(1\)\(2\)\(-7\)
\(2\)\(5\)\(-11\)
\(3\)\(10\)\(-15\)
\(0\)\(1\)\(-3\)
\(-1\)\(2\)\(1\)
\(-2\)\(5\)\(5\)

Reading down the table, notice that as we start with inputs \(1\) through \(3\), the results of \(f(x)\) and \(g(x)\) get further and further apart. That might indicate that we are “headed the wrong direction” with our inputs. So on the fourth line, we started at \(x=0\) and started counting backwards, noticing that the outputs of \(f(x)\) and \(g(x)\) are now getting closer together, until finally they are equal at \(x=-2\). Therefore, the solution to the equation is \(x=-2\).


Ugly solutions

The last few examples had convenient whole-number solutions. More often than not, in practice, the solution one finds to an equation is an approximate solution. Approximate solutions can often be found using guess and check as well. However, it often requires that you plug in decimal values for inputs as opposed to merely whole numbers, and paying very close attention to what the outputs of the function are doing compared to the one you want.

Let’s use a table here.

\(x\)\(f(x)\)Comments
\(1\)\(2\)Too low
\(2\)\(5\)Too high, so solution is between \(1\) and \(2\), hopefully.
\(1.5\)\(3.25\)Pretty close to \(3\), so let’s try something slightly less than \(1.5\).
\(1.4\)\(2.96\)This is really close, but slightly under \(3\). Let’s plug in something between \(1.4\) and \(1.5\).
\(1.45\)\(3.1025\)Too big. Need something smaller than \(x=1.45\). Lets just try \(1.41\) which is between \(1.4\) and \(1.45\).
\(1.41\)\(2.9881\)This is really, really close to \(3\), so we could use this \(x\)-value as an approximate solution to the equation. We could keep plugging in more \(x\)-values to get a more precise approximation, but \(x=1.41\) produces an output that is only off by \(0.0119\) which isn’t much.

The implied existence of solutions

When we ask a question like “Solve \(4x+1=x^2-5\) for \(x\),” we are implicitly stating that there actually is an \(x\)-value that makes this equation true. However, just because we can set two functions equal to one another, it does NOT mean that there is a solution! For instance, there is no real number \(x\) that solves the equation \(x^2+1=0\); No \(x\)-value will make \(x^2+1\) equal to \(0\). You will be guessing and checking forever. Unfortunately, the guess-and-check method does not really give us a means that consistently can tell us whether or not a solution exists. So when you use this method, you are seeking a solution to an equation in faith that a solution indeed exists (when it very well might not).

\(x=3\)

Simply plug in different \(x\)-values until the left-hand-side function produces an output of \(13\), so that it matches the right-hand-side

Aim for a solution \(x\)-value so that the output of \(3x+1\) is around 0.01 away from \(9\).

\(x=\frac{8}{3}=2.67\)ish

Sequentially plug in different \(x\)-values and see what the function \(3x+1\) produces for its outputs, changing your inputs based on whether the last output was too high or too low. See table below for how I went about this.

\(x\)\(f(x)=3x+1\)\(g(x)=9\)Too high/low?
\(1\)\(4\)\(9\)Too low (\(4<9\))
\(2\)\(7\)\(9\)Too low (\(7<9\))
\(3\)\(10\)\(9\)Too high \(10>9\)
\(2.5\)\(8.5\)\(9\)Too low
\(2.6\)\(8.8\)\(9\)Too low, but getting really close!
\(2.65\)\(8.95\)\(9\)Still too low, but very close!
\(2.67\)\(9.01\)\(9\)\(9.01\) is \(0.01\) away from \(9\), so we will take \(x=2.67\) as an approximate solution.

Try to find an \(x\)-value solution so that the outputs of \(2x+7\) and \(3x-2.2\) are less than \(0.1\) away from each other.

\(x=9.2\) (exact solution)

Sequentially plug in different \(x\)-values and see what the function \(2x+7\) and \(3x-2.2\) produces for its outputs, changing your inputs based on whether the last outputs got closer or further away from one another. See table below for how I went about this.

\(x\)\(2x+7\)\(3x-2.2\)Difference (closer or further)
\(7\)\(21\)\(18.8\)difference: \(2.2\)
\(9\)\(25\)\(24.8\)difference: \(0.2\), getting closer than before
\(9.1\)\(25.2\)\(25.1\)difference: \(0.1\), getting closer than before
\(9.3\)\(25.6\)\(25.7\)difference: \(0.1\), same as before
\(9.2\)\(25.4\)\(25.4\)difference: \(0\): we found the exact solution! \(x=9.2\)
Scroll to Top