Chapter 3 Solving Equations and Inequalities

In this section we shall look at some solution methods to some forms of commonly encountered equations and inequalities.

3.1 Quadratic equations

A particularly common form of equations that arise in science and engineering are quadratic equations. These are equations of the form

\[ax^2+bx+c=0\]

where \(a\), \(b\) and \(c\) are constants and we wish to find the values of \(x\) satisfying this equation. Graphically, these are the \(x\)-coordinates where the polynomial function \(f(x)=ax^2+bx+c\) crossses the \(x\)-axis: these values are known as the roots of the polynomial. A quadratic may cross the \(x\)-axis either twice, just once, or not at all.

Figure 3.1: The displayed quadtratic function has 2 roots. Try changing the sliders to find quadratics with just 1 root and with no roots. [Open graph in browser.]

:::

We’ll explore three different methods for finding the roots of a quadratic.


3.1.1 Factorisation by inspection

First consider a quadratic where \(a=1\), that is

\[x^2+bx+c=0.\]

If we can write a quadratic equation as a product of two simple linear factors in the form5:

\[x^2+bx+c = (x+\alpha)(x+\beta)\]

then \(x=-\alpha\) and \(x=-\beta\) are solutions to \(ax^2+bx+c=0\), since for \(x=-\alpha\)

\[(-\alpha+\alpha)(-\alpha+\beta)=0(-\alpha+\beta)=0\]

and similarly for \(x=-\beta\). Furthermore, these will be the only two solutions: it is possible there are two different solutions \(\alpha\neq\beta\), one “repeated” solution where \(\alpha=\beta\) so that the quadratic factorises as \((x+\alpha)(x+\alpha)=(x+\alpha)^2\), or there may be no solutions6. In many cases it is easy to spot the values of \(\alpha\) and \(\beta\). To see this, let’s work backwards and expand the brackets:

\[(x+\alpha)(x+\beta)=x^2+\beta x +\alpha x +\alpha\beta = x^2 + (\alpha + \beta)x + \alpha\beta\]

so we just need to find the values of \(\alpha\) and \(\beta\) that sum to \(b\) and multiply together to give \(c\).

Example 3.1 If we have \[x^2+5x+6=0\] we are looking for two numbers that sum to make \(5\) and multiply to make \(6\), so the answer is clearly \(x=2\) and \(x=3\), giving the factorisation \[x^2+5x+6=(x+2)(x+3).\]

If we have a more general quadratic where \(a\neq1\), then we could start by taking out a factor of \(a\) \[ax^2+bx+c=a\left(x^2+\frac{b}{a}x+\frac{c}{a}\right)=0\] and then dividing both sides by \(a\) \[x^2+\frac{b}{a}x+\frac{c}{a}=0\] The values of \(x\) satisfying this new equation will be the same as those for the original, so we can now use the above method to find the solutions. However, sometimes we not only want the solution, but also want to know how to factorise the quadratic. In this case we shall have to keep the factor of \(a\). To factorise we just need to find the values of the coefficients in the factorisation that will give the answer we need when we expand the brackets.

Example 3.2 Solve \(4x^2 + 8x + 3 = 0\) by factorising.

We need the \(x\) terms to multiply together to make \(4x^2\), so we could have either \[(4x + \star)(x + \star)\] or \[(2x + \star)(2x + \star)\] and we need the constant terms to multiply together to make \(3\), so we could have either \[(\star + 3)(\star + 1)\] or \[(\star - 3)(\star - 1).\] The sum of the products of the outer terms and inner terms needs to be \(8x\) and the only way this is possible is with \[(2x+3)(2x+1).\]

The solutions then come from solving for each factor being \(0\), giving \[x=-\frac{3}{2}\quad\text{ or }\quad x= -\frac{1}{2}\]

Alternatively, we can start by looking for two numbers that add to give the \(b\) coefficient, and multiply to give \(ac\). In this case, we are looking for numbers that add to give \(8\) and multiply to give \(4\times3=12\). The only option is \(2\) and \(6\). Now we write \(8x=2x+6x\) to give \[4x^2 + 2x + 6x + 3 = 0\] and next, we factorise the first two terms and last two terms to give \[2x(2x+1)+3(2x+1)\] and noticing the common factor of \((2x+1)\), we can factorise this to give \[(2x+3)(2x+1)\] as before.

Not all quadratics will factorise “nicely”, that is to say, where the coefficients in the linear factors will be integers. In this case, it can be very difficult to determine the coefficients by inspection and the following two methods can be applied instead.

3.1.2 Completing the square

In this method, we first rewrite a quadratic equation \[ax^2+bx+c=0\] into the form \[a(x-h)^2+k=0\] that is, a squared term plus a constant, hence the name “completing the square”.

We then solve by rearranging and taking square roots \[\begin{align*} (x-h)^2+k&=0\\ (x-h)^2&=-k\\ x-h&=\pm\sqrt{-k}\\ x&=h\pm\sqrt{-k} \end{align*}\] where \(\pm\) means there is one solution coming from taking the \(+\) option and the other from taking the \(-\) option.

We just need to find \(h\) and \(k\). They are given by \[h=-\frac{b}{2a},\quad k=c-\frac{b^2}{4a}.\]

It is not necessary to remember these formulae, we can instead figure out the coefficients as we go along.

Example 3.3 (Completing the Square) Consider the quadratic equation \[2x^2+12x-26=0.\] We first take out the factor \(a=2\) \[2x^2+12x-26=2(x^2+6x-13)\] Next we can make a square term that agrees with the first two terms by taking half the \(x\) coefficient (i.e. \(6\div2=3\)): \[(x+3)^2=x^2+6x+9.\]

This differs from the required result in the constant term by \[-13-9=-22\] and so we need to “complete the square” by adding \(-22\), to obtain \[2x^2+6x+13=2[(x+3)^2-22]=2(x+3)^2-44.\]

The solutions are then \[\begin{align*} 2(x+3)^2-44&=0\\ 2(x+3)^2&=44\\ (x+3)^2&=22\\ x&=-3\pm\sqrt{22}. \end{align*}\]

Another use of completing the square is in determining the location of the minimum or maximum point of a quadratic function. We know that the graph of such a function is a parabola which either opens upwards in a “\(\cup\)” shape or opens downwards in a “\(\cap\)” shape, so it has a minimum or a maximum, respectively: the sign of the \(x^2\) coefficient determines this, with \(+\) corresponding to upward opening and \(-\) corresponding to downward opening. In the previous example, after completing the square we obtained \(y=2(x+3)^2-44\), and since the coefficient in \(2x^2\) is positive the quadratic function must have a minimum somewhere. Since the term \((x+3)^2\) must be positive, the smallest it can be is when \(x=-3\) and the term is \((-3+3)^2=0\). This means we must have a minimum at \(x=-3\) where \(y=2(-3+3)^2-44=-44\). This idea can be generalised: find the value of \(x\) that makes the squared term \(0\), and then the minimum/maximum \(y\) value is equal to the constant term.

3.1.3 The quadratic formula

Sometimes it is difficult to find the solutions using the above methods and so thankfully we have a general forumula for finding them (or to determine if there are no real number solutions).

Theorem 3.1 (Quadratic Formula) The solutions to the quadratic equation \[ax^2+bx+c=0\] are given by \[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}.\]

If the quantity \(\Delta = b^2-4ac\), known as the discriminant, is such that \(\Delta>0\) then there will be two different solutions, if \(\Delta = 0\) then there will be one solution; if \(\Delta\) is negative, then there are no real number solutions (since we cannot take the square root of a negative number).

Exercise 3.1 Derive the quadratic formula. Hint: use the method of “completing the square” on the general form of a quadratic equation \(ax^2+bx+c=0\).

3.2 Higher order polynomials

We are often interested in finding the values of \(x\) for which \(f(x)=0\), known as the roots of a polynomial. We already know how to find roots of a quadratic using the quadratic formula (section 3.1). We will now look at the more general factor theorem that can help in finding roots of higher degree polynomials.

If we factorise the quadratic equation \[x^2-3x-10=0\] we obtain \[(x+2)(x-5)=0.\] If the product of two numbers is zero, then either one or both of the numbers must be zero. So the possible roots are \[(x+2)=0 \quad \implies\quad x=-2\] or \[(x-5)=0\quad \implies\quad x=5.\] More generally, a factor \((x-a)\) corresponds to a root \(x=a\). Knowing the factors tells us the roots, and vice versa. It turns out this holds more generally for any degree polynomial.

Theorem 3.2 (Factor Theorem) The value \(x=a\) is a root of the polynomial equation \(f(x)=0\) if and only if \((x-a)\) is a factor of the polynomial \(f(x)\).

We already have a fool-proof way to solve quadratic equations – use the quadratic formula. There are also formulae for cubic and quartic polynomials, but these are a bit more complicated. Furthermore, it turns out it is impossible to derive a formula for quintic and higher degree polynomials! The factor theorem can be helpful in finding roots of polynomials greater than degree 2. Here is an example.

Example 3.4 (Factor theorem applied to a cubic polynomial) Find the roots of the cubic polynomial \[f(x)=x^3-7x-6.\]

After a little trial and error with small integer values of \(x\) we find \[f(3)=3^3-7(3)-6=0\] which by the factor theorem implies that \((x-3)\) is a factor. Now applying polynomial division by the factor \((x-3)\) we find \[\frac{x^3-7x-6}{x-3}=x^2+3x+2\] so that \[x^3-7x-6=(x-3)(x^2+3x+2).\] Now that we have taken out one linear factor we are left with a quadratic factor, which we know how to deal with. Factorising the quadratic factor yields \[x^3-7x-6=(x-3)(x+1)(x+2).\] Hence the roots are \[x=3, x=-1,\,\text{ and } x=-2.\]

3.3 Simultaneous equations

Sometimes a problem will be formulated in terms of multiple equations with multiple, shared variables. The set of equations usually represent constraints between the variables and we need to determine which values of the variables are valid solutions, i.e. which values satisfy all of the equations simultaneously – hence such sets of equations are known as simultaneous equations. Sometimes we can solve simultaneous equations by rearranging one equation to set one of the variables as the subject and then substitute this into another equation in order to eliminate one of the variables.

3.3.1 Simultaneous linear equations

We begin with the simplest type of simultaneous equations: the case when all of the equations are linear, that is, geometrically they correspond to straight lines in the plane. We will just consider the case of two equations in two unknowns (the variables \(x\) and \(y\)). There are three possible types of solution, which we illustrate with the following three examples.

Example 3.5 Solve the following two simultaneous equations in the variables \(x\) and \(y\): \[\begin{align*} 3x+2y&=5,\\ x-4y&=1. \end{align*}\] We could start by rearranging equation two to make \(x\) the subject \[x=1+4y\] (it does not matter which equation we choose first or which variable we choose first, this choice was just easier to re-arrange) and then substitute this back in for \(x\) in equation one \[3(1+4y)+2y=5\] and then solve for \(y\) \[\begin{align*} 3(1+4y)+2y&=5\\ 3+12y+2y&=5\\ 14y&=2\\ y&=\frac{1}{7}. \end{align*}\] Now that we have the value for \(y\) we can substitute this back into either equation to find \(x\). Since we already rearranged equation two to make \(x\) the subject, we might as well use that: \[x=1+4y=1+\frac{4}{7}=\frac{11}{7}.\] Hence the solution is \[x=\frac{11}{7},\quad y=\frac{1}{7}.\] Geometrically, the two linear equations describe lines in the plane. If we have \(x\) and \(y\) values that satisfy both equations simultaneously, we have a point \((x,y)\) that lies on both lines: that is, \((x,y)\) is a point of intersection of the two lines.

Figure 3.2: The lines \(3x+2y=5\) (red line) and \(x-4y=1\) (blue line) intersect at a single point. [Open graph in browser.]

Example 3.6 Solve the following two simultaneous equations in the variables \(x\) and \(y\): \[\begin{align*} -x+3y&=2,\\ 2x-6y&=11. \end{align*}\] We could start by rearranging equation one to make \(x\) the subject \[x=3y-2\] and then substitute this back in for \(x\) in equation two \[2(3y-2)-6y=11\] and then solve for \(y\) \[\begin{align*} 2(3y-2)-6y&=11\\ 6y-6-6y&=11\\ 0&=17. \end{align*}\] which is impossible. This tells us there are no solutions to the simultaneous equations; that is, there are no values of \(x\) and \(y\) that satisfy both equations at the same time. Geometrically, the two equations correspond to parallel lines, and of course, two parallel lines never intersect.

Figure 3.3: The lines \(-x+3y=2\) (red line) and \(2x-6y=11\) (blue line) are parallel and do not intersect. [Open graph in browser.]

Example 3.7 Solve the following two simultaneous equations in the variables \(x\) and \(y\): \[\begin{align*} 2x-y&=2\\ 4x-2y&=4 \end{align*}\] we can rearrange equation one to make \(y\) the subject \[y=2x-2\] and then substitute this back in for \(y\) in equation two \[4x-2(2x-2)=4\] and then solve for \(x\) \[\begin{align*} 4x-2(2x-2)&=4\\ 4x-4x+4&=4\\ 0x&=0\\ 0&=0. \end{align*}\] This equality holds for any value of \(x\), so \(x\) can be any number. Therefore so long as \(y\) satisfies one of the equations, for example \[y=2x-2\] then the pair of values \((x,y)\) is a solution: in this case any point on the line \(y=2x-2\) is a solution, so we have infinitely many solutions. Note that equation two is just \(2\times\) equation one, so they are effectively the same equation and describe the same line in the plane, hence all of their points intersect. The solutions are just the points that lie on the line described by equation one, or equivalently, equation two.

Figure 3.4: The lines \(2x-y=2\) (red line) and \(4x-2y=4\) (blue line) are in fact the same line, so intersect at all points on the line: there is a solution for any value of \(x\) or any value of \(y\). [Open graph in browser.]

The three examples above demonstrate the three general possibilities for two equations with two unknowns: one pair of solutions \((x,y)\); no solutions; infinitely many solutions along a line. This is simply the three ways that two lines could intersect in the plane: at one point; at no points (parallel, unequal lines); at all points (the equations describe the same line).

We shall look at a systematic way to deal with linear simultaneous equations in arbitrary dimensions (any number of equations and any number of variables) in section 7.

3.3.2 Non-linear simultaneous equations

Example 3.8 Given the following two simultaneous equations, solve for the variables \(x\) and \(y\) \[\begin{align*} 2x+y&=7,\\ x^2-xy&=6. \end{align*}\] We note that the first equation is linear, but the second is non-linear. It will be easiest to rearrange the first (linear) equation for \(y\), to get \[y=7-2x\] and then substituting this into the second (non-linear) equation \[\begin{align*} x^2-x(7-2x)&=6\\ 3x^2-7x-6&=0\\ (3x+2)(x-3)&=0\\ \end{align*}\] so the factorisation tells us \[x=-\frac{2}{3},\text{ or } x = 3.\] Now substiting these two possibilities back into the first equation gives \[\begin{align*} 2(-\frac{2}{3})+y&=7\\ y&=\frac{25}{3} \end{align*}\] and \[\begin{align*} 2(3)+y&=7\\ y&=1. \end{align*}\] To summarise, the solutions are: \[x = -\frac{2}{3},\quad y = \frac{25}{3}\] and \[x=3,\quad y=1.\] We can think about this problem graphically as we did for simultaneous linear equations: each equation describes a line or curve in the plane, and a solution corresponds to a point of intersection.

Figure 3.5: The lines \(2x+y=7\) (red line) and the curve \(x^2-xy=6\) (blue curve) intersect at two points. [Open graph in browser.]

The example presented above is relatively simple. In some real-world scenarios equations might be very complicated (with many variables or many simultaneous equations), and it is known that some equations are impossible to solve by hand. In these cases we need to turn to computational techniques. We’ll look at some computational techniques in section 18.

3.4 Exponentials and Logarithms

We shall now look at solving some equations involving exponentials and logarithms: recall that these functions are inverses of one another. First, we look at some of the rules for manipulating logs (which can be derived from the rules of exponents).

Rules of Logs:

1.   \(\log_a(xy)=\log_a(x)+\log_a(y)\)

2.   \(\log_a(x^p)=p\log_a(x)\)

3.   \(\log_a(\frac{x}{y})=\log_a(x)-\log_a(y)\)

4.   \(\log_a(1)=0\)

5.   \(\log_a(a)=1\)

3.4.1 Standard Bases

In science and engineering applications it is common to use base \(e\), base \(2\) and base \(10\). For base \(10\), the following notation is sometimes used

\[\log(x)=\log_{10}(x)\]

but we should always check what the author intends as sometimes \(\log(x)\) is used to mean \(\ln(x)\).

We can also change between bases in logarithms with the following rule:

\[\begin{equation*} \log_a(y)=\dfrac{\log_b (y)}{\log_b (a)}. \end{equation*}\] This allows us to calculate \(\log_a\) of a number in terms of \(\log_b\).

3.4.2 Change of Base for Exponentials

An exponential function with base \(a\) can be re-written in any other base \(b\) with a constant factor in the argument as follows:

\[\begin{aligned}a^x&=b^{\log_b (a^x)} \quad \text{(note that } b^{\log_b y}=y\text{)} \\&=b^{x\log_b (a)}\\&=b^{kx},\quad \text{where }k=\log_b(a).\end{aligned}\]

The “natural” choice of base for mathematical use is \(b=e\) and hence we usually only consider exponential functions in the form \[e^{kx} \text{ where } k=\ln(a).\]

3.5 Inequalities

Assume we are comparing two expressions \(P\) and \(Q\) that depend on the variable \(x\) and need to find, for example, the values of \(x\) for which \(P>Q\). Let us take a look at a range of examples to see how to solve these types of problems.

Example 3.9 We wish to find all values of \(x\) satisfying the following inequalities.

  1. \(2x+6<18.\)

    Here we can easily re-arrange the inequality (subtract \(6\) from each side and divide by the positive number \(2\) – which preserves the direction of the inequality) to obtain \[x<6.\]

  2. \(x^2-7x+12>0\)

    Factorise the l.h.s. to give \((x-3)(x-4)>0\), so to be positive the factors on the left need to be either both positive or both negative, i.e.:

    1. \((x-3)>0\) and \((x-4)>0\), so we must have both \(x>4\) and \(x>3\), which means that we must take \(x>4\).

    2. \((x-3)<0\) and \((x-4)<0\), so we require both \(x<3\) and \(x<4\), which means we must take \(x<3\).

    Since either situation a or b satisfies the inequality the solution is \(x<3\) or \(x>4\).

  3. \(\left|10-3x\right|\leq 8\), where \(|\cdot|\) denotes the absolute value. We must have both:

    1. \[\begin{align*} 10-3x&\leq 8\\ -3x&\leq-2\\ x&\geq \frac{2}{3} \end{align*}\]

      i.e. the interval \(x\geq\dfrac{2}{3}.\) And,

    2. \(-(10-3x)\leq 8\), leading to \(x\leq 6\).

    Hence \(\dfrac{2}{3}\leq x \leq 6\).

  4. \(\dfrac{1}{x-3}>\dfrac{1}{x-2}\)

    Let’s first do this the wrong way to illustrate a point. Let’s multiply both sides by \((x-2)\) to obtain \[\begin{gather*} \frac{x-2}{x-3}>1\\ \frac{x-2}{x-3}-1>0\\ \frac{(x-2)-(x-3)}{x-3}=\frac{1}{x-3}>0 \end{gather*}\] giving the solution \(x>3\).

    We can check the solution graphically by plotting the l.h.s. and r.h.s. and seeing where the l.h.s. is greater than the r.h.s.

    Figure 3.6: A plot of the inequality \(\frac{1}{x-3}>\frac{1}{x-2}\): the solid red line is the l.h.s and the dashed blue line is the r.h.s.. We are interested in finding the values of \(x\) where the red line is above the blue line (the red-shaded region). [Open graph in browser.]

    It would appear that something has gone wrong! There is a second interval \(x<2\) where the inequality holds true. The problem is that we multiplied by the factor \((x-2)\) forgetting the fact that \(x\) is a variable, so this factor could be positive or negative depending on the value of \(x\) and hence can flip the inequality. We could still perform this multiplication so long as we keep track of the two possible cases when \((x-2)\) is positive or negative. However, a safer strategy is to first subtract the r.h.s. from the l.h.s., then factorise as much as possible:

    \[\frac{1}{x-3}-\frac{1}{x-2}=\frac{(x-2)-(x-3)}{(x-3)(x-2)}=\frac{1}{(x-3)(x-2)}>0.\]

    Hence for the denominator to be positive we must have either \(x>3\) and \(x>2\), or \(x<3\) and \(x<2\). Together these yield the solution \(x<2\) or \(x>3\).

The general strategy for finding \(P>Q\) (or similar) is therefore: (1) Consider \(P-Q\) and factorise as much as possible; (2) Determine the sign of each factor of \(P-Q\) for varying \(x\); (3) Determine when \(P-Q>0\) (and hence when \(P>Q\)).


  1. In fact, any quadratic can be factorised as a product of two linear factors, but we may need complex numbers to do this; more on this in section 5.↩︎

  2. That is, no solutions for which \(\alpha\) and \(\beta\) are real numbers, but there will instead be complex number solutions.↩︎