In an earlier post, we looked at expanding binomial products. Remember how the result of the expansion is a mixture of the inputs — the numbers in the input do not appear in the result, but the numbers that do appear in the output arise from sums and products of the inputs.

Factorising is the opposite to expanding — it is the process of determining the factors given the expanded product. It is a kind of decoding, and somewhat harder than expanding, but it is usually easier to work with an expression, and to understand its properties, when it is in factorised form. Often when a calculation results in a complicated expression, an important step towards understanding the result is to find the factors.

But how do you untangle an expanded expression? It is not easy because everything has been mixed together. It’s like being served a fully cooked meal and having to work out the recipe! In fact, mixing inputs through mathematical operations is the basis of encryption, and this is only effective when the associated decryption is difficult. Modern encryption approaches are based on products of large prime numbers precisely because multiplying is easy but factorising is difficult. (This aspect of factorisation is explored in the About Primes activity.)

Nevertheless, it is certainly possible to crack the quadratic code by looking for patterns and relationships, basically doing precisely those things that make maths fun. 🙂

Let’s try an example: if we have the quadratic expression , how might we work out where it came from — i.e. find its factors?

Now there are rules that can be rote learned and applied, but much better is to use some number sense and understanding. There are two numbers to consider: 7 and 12. At first sight there seems to be little connection between them, but notice that 7=3+4, and 12=3×4. They are in fact very closely related, and this is the clue we need. By writing the as , and the 12 as 4 × 3 we can untangle the expression as follows:

To make sure you understand what is going on here, just think in reverse. When the last line is expanded, the product of the outer two terms makes , the product of the inner two terms is , and these are added to make . The 12 comes from the product of the numbers in the brackets, 3 × 4, and the initial term arises from the product of and .

It gets a little harder when you need to think about negative numbers. For example, what are the factors of ? This time we need to try and find two numbers that multiply to 12 but add to -7? Remembering that a negative times a negative is a positive, our two numbers are -3 and -4, and proceeding as before:

So as long as you don’t stumble with the minus signs (especially when brackets are involved) you can see this is really just the same thing — find two numbers with the required sum and product to crack the code.

## Solving quadratic equations

Related to factorising is the problem of solving quadratic equations. This is where we set the quadratic expression equal to zero, and, just as for linear equations (see Solving Equations), find those values of for which the equation holds.

If the quadratic expression is not factorised, e.g.

we cannot see what values of solve the equation, if indeed any do. But if the expression is factorised,

we can immediately see that if or , then one of the terms in brackets evaluates to zero, and so the product is also zero. We say that the solutions, or roots, of the quadratic equation are and .

But why are there two solutions? We will think more about this when we look at quadratic equations as curves in the number plane, but to get an idea of what is going on, remember that the equation

also has two solutions,

## More complicated quadratics

In both of the above examples, the coefficient of the term was 1 — i.e. there was no number multiplying the . What do we do when this is not the case? It should not surprise you to know that it really makes very little difference. We are still trying to “crack a code” by working out the relationships between the numbers we can see, and so deduce where they must have come from.

Let’s look at . Now we have three numbers to think about in the expression: 3, 2 and -5 and want to find a connection. The secret is to realise that the two outside numbers (3 and -5) are connected by a product, whereas the 2 from the in the middle results from a sum.

So, first we multiply the 3 and -5 to get -15, and then consider the factors:

Next, as in the earlier examples, we need to look at the pairs of factors and find a pair that adds to 2. In this way we have considered all three numbers in the expression we wish to factorise. Clearly, -3 and 5 multiply to -15 and add to 2, so let’s see if these two numbers help us untangle our quadratic.

Now you;ve worked that through, I hope you’re impressed. You should be proud of yourself. Just by thinking about how expansion combines values and using your knowledge of multiplication and bracket expansion, you have cracked the quadratic code!

No special rules or memorisation required. Well done!

## Completing the square

Does this method always work? What if the equation was ? None of the factor pairs sum to 3. Or if our equation above was ? In this case none of the factor pairs for 12 add to 10. What does this mean? Are we stuck? How can we approach the problem in this case?

When this situation arises, it tells us that the numbers we are looking for are not integers. In fact they are usually irrational numbers arising from square roots. But we’re not going to let a little thing like that defeat us!

But first an aside. Do you think it is strange that these equations are called quadratics? Doesn’t quad mean 4? Well, in this case quad actually means “square”. Quadratics are equations that are based on an term, and thus they are fundamentally related to squaring.

This is the clue we need to crack the code in this new situation.

Remember another thing we learned when expanding binomial products: the standard form for a perfect square is:

Let’s use this knowledge to solve .

We have already seen that we cannot find two integers that add to 10 and multiply to 12, but, using the hint above, we can make our expression look like a perfect square by writing:

So the equation can be rewritten as

which can be rearranged to form

Taking the square root of both sides (remembering to include both the positive and the negative square root) gives

leading to the solution

These two solutions are definitely not nice, integer values, and that is why we couldn’t use our earlier approach. However, completing the square like this works for any quadratic, and is the foundation of the famous quadratic formula. (And, unless you have been explicitly asked to, or are solving a physical problem, resist the temptation to put that into your calculator and get a decimal approximation. Much better to leave it exact.)

## Parabolas

A really useful thing to remember in any kind of equation solving is that writing

defines a curve in the number plane. We can plug in any value for , get a corresponding value for , and then plot the point . The points with are the points where the curve crosses the x axis (since that’s where in the plane) and these are the solutions to our original equation.

Whatever kind of equation you need to solve, thinking graphically can be a great help.

The shape of the curve tells you what kind of solutions to expect, and can inform you whether or not your answer makes sense. Often exactly those cases which are confusing algebraically make perfect sense graphically.

Linear equations describe straight lines in the number plane, and so (unless the line is parallel to the x-axis) there is always a single solution — a single point where the line crosses the x-axis. In contrast, quadratic equations are not straight lines because the term makes them curve.

Let’s think about what kind of curve a quadratic equation describes.

As we’ve seen, a quadratic equation has the form , but to turn this into a curve we must write

First of all, let’s assume is positive (or even ignore it for now — no problem). For large positive , gets even larger very fast (think how big the squares of large numbers are compared to the number itself). More interestingly, this is also true for large negative , since a negative squared is also positive. But, when is close to zero, is even closer to zero (think about 0.01^{2}, 0.001^{2} etc.). So we have a curve that gets really big at each end, but small in the middle. This is kind of a U shape.

This class of curve is called a Parabola and is a very important curve. There is an activity at the Mathenæum, Parabola Explorer, for exploring the shape and nature of parabolas, and how they link to quadratic equations.

The picture below shows an example for the expression

You can see that the curve crosses the x-axis at and , so the factored form must be (check it out)

Notice that the two numbers in the factored expression are opposite in sign to the solutions, because they must add to zero.

Thinking graphically also illustrates why there are sometimes two solutions to a quadratic equation, sometimes only one, and sometimes none at all. Suppose we were to move the previous curve upwards by 4 units, until the turning point just touches the x-axis. This is easy to do by just adding 4 to every point, which is simply changing the equation to

This gives us a curve as shown next:

The shape of the curve is exactly the same; it has just been moved upwards. (You can do this in the above mentioned activity by locking X and Y and dragging.) And, as we expected, the curve no longer crosses the x-axis, but only touches it at .

Question Find the factors of this new equation, .

What if we were to move it up even further by adding a larger number — say 6? Our equation becomes

As the following picture shows, we now have a curve that does not cross the x-axis at all, and so there are no solutions to .

If we were to try and factor by either of our approaches, we would fail. There are no two numbers that add to -2 and multiply to 3 — not integers, fractions or even complicated expressions including square roots. We can see why by completing the square. This gives us , which we cannot solve since negative numbers do not have square roots.

Finally, if the constant multiplying the term is negative, the parabola shape is flipped over like so:

The curve shown above is simply our first example flipped about the x-axis by multiplying the whole expression by -1. Notice that the roots of the equation are unchanged.

Question What would multiplying by -2 have done to the roots?

## Thinking about the equation of a parabola

In the Parabola Explorer activity, and also in each of the above pictures, you will see that the equation of the parabola is presented in two ways — standard form: , and vertex form: . For reasons I have never understood, we tend to use the standard form, but the vertex form is much more informative. From an equation in vertex form you can immediately see the turning point (i.e. the vertex), and finding the solution by completing the square takes only two simple steps.

See if you can work out how to use the vertex form of the equation by looking at the pictures and trying other examples in the Mathenæum activity. The best way to start is with the basic parabola

and see how the equation changes as the it gets moved around the plane, and when its shape is made wider or narrower. I think you will agree that the vertex form is much easier to work with than , and if anyone disagrees with you, just ask them to describe how changing the value of in standard form changes the shape of the curve! 🙂

## Applications of quadratics

Quadratics arise frequently in mathematical applications. The distance travelled when accelerating, the path of a projectile, the cross-sectional shape of a satellite disk, length and area optimisations for materials or containers, are all examples of important everyday problems that use quadratics.

To illustrate, here are some interesting examples to work through.

Example 1: Calculating paper sizes

Suppose we are considering paper sizes with the following requirements:

1. One size of paper (shown on the left) needs to have the property that when folded in half to make the two smaller sheets and , both and must have the same aspect ratio (i.e. width divided by height) as the original sheet of paper.

2. A second size of paper (shown on the right) needs to have the same aspect ratio when a maximum size square is removed from the top. In this case is the largest square that can be cut from the original sheet, and the remainder, piece , must have the same aspect ratio as the original sheet of paper.

Calculate the ratio for each original sheet of paper, and what is length of the original sheets if the width is to be 210mm in each case?

### Click to show/hide solution

The original sheet sizes need to be 210mm by 297mm to meet requirement 1, and 210mm by 340mm to meet requirement 2. Let’s go through the working and see how quadratics gave us these dimensions.

Because we are calculating relative sizes, we can consider the width of each sheet as having length 1, and a height of . We need to find a value for that has the required aspect ratio property in each case.

For sheet 1, the ratio of width over height is originally . When folded in half, we have a sheet of paper of height 1 (i.e. the original width) and short side . For the aspect ratio to be the same, we need

This is a quadratic equation in disguise! Multiply both sides by , and then by 2 to get

and so

So, the paper we need must be times as high as it is wide, and a particular sheet with width 210mm needs height mm. (Only the positive root makes sense for this problem.)

This ratio is the ratio used in standard A series paper — A0, A1, A2 etc, and an A4 sheet has dimensions 210mm by 297mm.

For sheet 2, the square we need to remove has dimension 1 by 1, leaving a rectangle at the bottom with height 1 (the long side of the left over is the original short side) and width . This time, for the aspect ratio to be the same as the original sheet, we need

Once again, this is a quadratic in disguise. Multiply both sides by to get the equation we need to solve:

Completing the square

We only need the solution (unless you have a need of negative length paper!), so

This is a very famous number in Mathematics — the golden ratio, and is closely related to the Fibonacci numbers.

Example 2: Calculating a sale price

When calculating a price at which to sell some items, the seller needs to consider the cost to acquire the items and the desired profit. The higher the price, the greater the profit, but the items cannot simply sold at a huge price since the price also affects the volume of sales — if the price is too high, no one will buy the item and there will be no profit at all.

Question: Suppose you have ordered 100 items to sell at a cost of $9 each. Assuming every $1 in the price means you lose one sale, you need to determine a price, S, at which to sell them.

- Write an equation for the profit in terms of S.
- Describe this equation.
- What range of possible sale prices S result in a profit?
- How many sales are there at each breakeven price?
- (Extension) What is the optimal price, and associated profit?

### Click to show/hide solution

Obviously the higher the sale price you choose, the fewer you will sell. You can get rid of all 100 items if you give them away free, but because each $1 of price means we miss out on a sale, the quantity actually sold can be modelled as .

- Our expected profit is just the total revenue, minus the total cost 100 × $9 = $900. An equation describing the profit is therefore
- This equation is a quadratic in S.
- The profit equation is a concave down (i.e. an upside down) parabola, so the profit is positive between the roots.

To find the roots you need to solve , but you can multiply by -1 without changing the roots to get the slightly easier form . Completing the square givesand so you breakeven if the items are sold for $90 (i.e. few sales but a large profit on each) or $10 (many sales but only a small profit on each). You make a profit for sale prices between $10 and $90.

- 90 items are sold at $10, and 10 items are sold at $90. Each case brings in $900 in revenue, exactly balancing the costs.
- The optimal price is the price with maximum profit. This is the turning point exactly between the two roots, so at S=$50 you make 50 sales with revenue $2500. Subtracting the $900 in costs leaves $1600 in profit.

## 2 Puzzles: Calculate these mathematician’s ages

### Puzzle 1

Diophantus was a mathematician from Ancient Greece (yes – another one!) who studied equations, especially those that had integer solutions, and was a significant contributor to the development of algebraic notation. Very little is known of his life, but a puzzle in an anthology from 500AD contained the following details:

- Write an equation that represents this information.
- Describe this equation.
- Solve the equation and determine Diophantus’s age when he died.

### Click to show/hide solution

- If Diophantus lived until he was years old, the question can be written as an equation like so:
- This is a linear equation in .
- The equation simplifies to
Rearrange to get

multiply both sides by 28, divide by 3, and we have . Diophantus lived to be 84. This means his boyhood lasted 14 years, he married at 26, grew his beard at 33, had a son at 38, the son lived until he was 80, and he died 4 years later at 84.

But, there is another way to get this solution.

We know, from the context of the question, that his final age must be an integer, and all the steps must be at integer ages as well. This tells us that Diophantus’s age must be a multiple of 6, 7, 12 and 2. Now anything that is a multiple of 12 is automatically a multiple of 6 and 2, so we just need the least common multiple of 12 and 7, and that is 84. The answer must therefore be 84, or some integer multiple of 84, but given it is unlikely he lived to 168 or more, 84 is the only possibility, and a quick substitution confirms the fact.

We will need reasoning more like this to solve the next problem.

### Puzzle 2

Augustus de Morgan, a nineteenth century mathematician famous for his work in formal logic and mathematical induction, answered when asked his age that:

- In what year was he born?
- What is the value of ?
- What other years have this property?

### Click to show/hide solution

If we assume de Morgan was born in the year , then the statement “I was years old in the year ” becomes the equation

You guessed it, it’s another quadratic! But we can’t just solve for , because is not known. When something like this happens, the best way for us to proceed is to think about what we do know. Well, we know that is an integer (because of how we talk of ages), and we know that is in the 1800s. Let’s see if that is enough to solve the problem.

First we rewrite the equation as

then completing the square we get

Now, because is an integer, must be an odd integer (so when we add the we get an integer). This tells us that is an odd number squared, so for positive integers .

Expanding this gives

leading to

for the Triangular Numbers .

This is where we use the other bit of information, that is in the 1800s.

Considering the possible values reveals , and to be our candidate birth years. Now, further assuming that he was an adult when this exchange took place, we can neglect the second possibility, and say with confidence that Augustus de Morgan was born in 1806.

Now we can use our knowledge of to solve the quadratic for . The equation becomes , which is easily solved to get . (In fact you can solve this quadratic it in your head by remembering where the equation came from: it is just , and you can see right away that if the matches the 43, the automatically matches the 42.)

Question What is the other solution to and why can we ignore it?

The answers to the three parts of the puzzle are:

- He was born in 1806.
- because he was 43 in the year 1849, and 1849 = 43
^{2}. - Any year that is twice a triangular number will have this property.

Unfortunately triangular numbers get further and further apart as they increase, so the chances of being able to re-use de Morgan’s nerdy comment are getting smaller. But there are people around today that can still do it; you might wish to work out in what year they must have been born.

## Bamboozler: Quadratic Chaos

That last puzzle was pretty tricky, but it doesn’t qualify for this topic’s bamboozler. My quadratic bamboozler is something much stranger…

To start, choose a random number between 0 and 1, write it down and call it . Next, use this number to make two new numbers, one by doubling to get , and the other by subtracting from 1 to get . Then multiply these two new numbers together and write down the result. Now make this result your new , and repeat the process.

Let’s see what happens…

I’m going to start with , but it doesn’t really matter as long as you don’t choose 0, 1 or 0.5. This gives me and for my pair of new numbers, and their product is 0.48. This is the next value for , and repeating the process gives 0.96 × 0.52 = 0.4992.

Continuing in this way for 7 steps produces the values shown in the table below.

Iteration | ||||

1 | 0.4 | 0.8 | 0.6 | 0.48 |

2 | 0.48 | 0.96 | 0.52 | 0.4992 |

3 | 0.4992 | 0.9984 | 0.5008 | 0.49999872 |

4 | 0.49999872 | 0.99999744 | 0.50000128 | 0.49999999999672 |

5 | 0.49999999999672 | 0.99999999999345 | 0.50000000000328 | 0.5 |

6 | 0.5 | 1 | 0.5 | 0.5 |

7 | 0.5 | 1 | 0.5 | 0.5 |

Question The process seems to have gotten stuck at 0.5. Can you work out why?

Question Does it matter what number we start with? Try some others.

Now let’s analyse this process using algebra. Writing the process algebraically, we get . A fixed point is a value of that doesn’t change each time we apply our rule. Clearly will always stay 0, but that’s not very interesting. To find another fixed point, we can set and solve the resulting quadratic:

with solutions and .

We have just shown that if you land on , you stay there forever. But notice from the values in the table how each step we get closer and closer to ? That shows that this fixed point is attractive or stable — once your values get close to it, they are drawn in until they land on it. Kind of like a mathematical black hole.

But not all fixed points are stable, and when they’re not, some really bamboozling things can happen. And that’s what we are going to explore now.

### The Logistic Map

The Logistic Map is a simple model of population growth and decay, where a population size, given by , is updated generation by generation. A population of 1 means the maximum size, and 0 means extinction. The rate of population growth is determined by a constant, . If there was no death, each generation of the new population would be r times the current population, i.e. , and the population would grow exponentially. But the model includes death (because of competition for limited resources) and this effect reduces the population by each generation.

Thus, the logistic map, described by the process for and , is a model of the interaction between birth and death processes in a population.

The worked example above was for just one instance of the logistic map: the map. But what happens if we use other values for the growth rate in the equation? Well, what happens is simply amazing! It is too hard to do many cases manually, but you can use the activity page at Quadratic Chaos to explore this incredible quadratic in detail.

Complete the exercises there and you will have found examples of fixed points, 2-cycles, 4-cycles, period doubling cascades, 5-cycles, 3-cycles and randomness etc. All from one tiny little quadratic!

### Chaos Theory

Prior to the development of chaos theory, it was believed that the ability to perfectly describe a physical system with a mathematical model implied the ability to fully predict its future behaviour. Chaos theory undermines this view since even with a perfect description, the predictability of a chaotic system downgrades very rapidly. In fact, maintaining predictability within a perfectly described chaotic system requires the initial conditions to be known to infinite precision — clearly impossible in real life.

The meteorologist Edward Lorenz, who did a great deal to bring mathematical chaos to wider attention, captured this idea quite poetically when he gave a talk in 1972 entitled Does the flap of a butterfly’s wings in Brazil set off a tornado in Texas?

The key aspect of these systems is nonlinearity. Mathematically, this means the models involve terms like (e.g. quadratics) or other powers, and physically it means that there is feedback in the system; as the system grows it begins to negatively affect its own growth.

The importance of chaos and related concepts (such as fractals) in real world systems has been one of the most significant developments in our mathematical and scientific understanding of nature over the last half century. The idea that the incredible complexity we see in nature may often arise from very simple equations (the logistic map is just one of many simple models that exhibit this behaviour) and that equations with unpredictable outcomes do not necessarily involve random inputs, is certainly bamboozling, and represents a major shift in our approach to the mathematical modelling of nature.