Plotting Quadratic Equations

These topics are covered in the Mathematics syllabus in preparation for the University of Malta MATSEC O level exam. However a strong knowledge of such topics will prove to be extremely important and useful for the workings in the A level topics. These topics are intended as a revision and brush-up for students starting their A level Pure Mathematics in Malta.

Quadratic equations have the following form:

y=ax2+bx+cy=ax^2+bx+c

where a,ba,b and cc are some numbers. However aa must not be zero (a0a\neq 0). In fact, if aa where 00, the equation above becomes y=bx+cy=bx+c which is the equation of a straight line and not a quadratic. The following are examples of quadratic equations:

(1) y=x2+3x1(2) y=3x2+1(3) y=x2+x(4) y=(x1)2\begin{aligned}(1)& \ y=x^2+3x-1\\(2)&\ y=3x^2+1\\(3)& \ y=-x^2+x\\(4)& \ y=(x-1)^2\end{aligned}

In quadratic (1), we have a=1a=1, b=3b=3 and c=1c=-1. In quadratic (2), we note that the term in xx is missing (i.e. b=0b=0). Still this is a quadratic equation because the term in x2x^2 is present. Similarly in quadratic (3), the constant term is missing (i.e. c=0c=0). Still this remains a quadratic equation because the term in x2x^2 is present. Finally, quadratic (4) is a quadratic because when we expand (open up) the brackets we obtain y=x22x+1y=x^2-2x+1 and this has the term in x2x^2 present.

The two different shapes of the quadratic equation

There are two different shapes that a quadratic equation can take, when plotted. The first shape is the U-shape where the quadratic has the shape of the letter “U” and the second shape is the N-shape where the quadratic has the shape of the letter “n”. The shape of the quadratic equation y=ax2+bx+cy=ax^2+bx+c is determine only by the coefficient of x2x^2. If a>0a>0, the quadratic is U-shaped. If a<0a<0, the quadratic is N-shaped. The following diagram helps you remember this rule.

Shape of Quadratics

Example: Determine the shape of the following quadratics:

(a) y=x2+3x1y=x^2+3x-1

We have a=1a=1, thus a>0a>0. So the quadratic is U-shaped. In fact the plot of this quadratic is the following:

(b) y=2x2+4y=-2x^2+4

We have a=2a=-2, thus a<0a<0. So the quadratic is N-shaped. In fact the plot of this quadratic is the following:

(c) y=(x1)2y=(x-1)^2

Let us expand this quadratic equation:

y=(x1)2y=(x1)(x1)y=x22x+1\begin{aligned}y&=(x-1)^2\\y&=(x-1)(x-1)\\y&=x^2-2x+1\\ & \end{aligned}

We have a=1a=1, thus a>0a>0. So the quadratic is U-shaped. In fact the plot of this quadratic is the following:

(b) y=(x+1)2y=-(x+1)^2

Let us expand this quadratic equation:

y=(x+1)2y=(x+1)(x+1)y=(x2+2x+1)y=x22x1\begin{aligned}y&=-(x+1)^2\\y&=-(x+1)(x+1)\\y&=-(x^2+2x+1)\\y&=-x^2-2x-1\end{aligned}

We have a=1a=-1, thus a<0a<0. So the quadratic is N-shaped. In fact the plot of this quadratic is the following:

Plotting Quadratic Equations

We will plot quadratic equations by using just 3 steps as follows:

Step 1: We find the xx-intercept(s) (also known as the root(s)). This is done by letting y=0y=0 in the equation, factorising the quadratic and solving for xx.

Step 2: We find the yy-intercept (the point where the graph crosses the yy-axis). This is done by letting x=0x=0 in the equation and solving for yy.

Step 3: We check whether the curve is U-shaped or N-shaped and draw a curved line through the xx-intercept(s) and the yy-intercept. Note that the graph reaches its minimum/maximum point exactly between the roots.

A note regarding the xx-intercept(s): We will have either two different xx-intercepts, or just one distinct xx-intercept or else no xx-intercepts. The case where we have no xx-intercepts will be discussed in more details in the A-level topic on Differentiation.

Example 1: Plot the following equation: y=x2+2x3y=x^2+2x-3

In Step 1, let y=0y=0,

0=x2+2x30=(x+3)(x1)\begin{aligned}0&=x^2+2x-3\\0&=(x+3)(x-1) \end{aligned}
x+3=0  x1=0x=3x=1\begin{aligned} x+3&= 0  &  x-1& = 0\\x&=-3 & x&=1\end{aligned}

Therefore the roots are (3,0)(-3,0) and (1,0)(1,0)

In Step 2, we let x=0x=0,

y=02+2(0)3y=3\begin{aligned}y&=0^2+2(0)-3\\y&=-3 \end{aligned}

Therefore the yy-intercept is (0,3)(0,-3). We draw a curve through the roots and the yy-intercept that is symmetric between the roots. Note that since a>0a>0, the curve will be U-shaped.

Example 2: Plot the following equation: y=2x2+4y=-2x^2+4

In Step 1, let y=0y=0,

0=2x2+40=x22 (divide both sides by 2)0=(x+2)(x2)\begin{aligned}0&=-2x^2+4\\0&=x^2-2 \text{ (divide both sides by }-2 )\\0&=(x+\sqrt{2})(x-\sqrt{2})\end{aligned}
x+2=0  x2=0x=2x=2\begin{aligned} x+\sqrt{2}&= 0  &  x-\sqrt{2}& = 0\\x&=-\sqrt{2} & x&=\sqrt{2}\end{aligned}

Therefore the roots are (2,0)(-\sqrt{2},0) and (2,0)(\sqrt{2},0)

In Step 2, we let x=0x=0,

y=2(02)+4y=4\begin{aligned}y&=-2(0^2)+4\\y&=4 \end{aligned}

Therefore the yy-intercept is (0,4)(0,4). We draw a curve through the roots and the yy-intercept that is symmetric between the roots. Note that in this example, a=2>0a=-2>0, hence the curve will be N-shaped.

Example 3: Plot the following equation: y=(x1)2y=(x-1)^2

In Step 1, let y=0y=0,

0=(x1)20=(x1)(x1)\begin{aligned}0&=(x-1)^2\\0&=(x-1)(x-1)\end{aligned}
x1=0  x1=0x=1x=1\begin{aligned} x-1&= 0  &  x-1& = 0\\x&=1 & x&=1\end{aligned}

Note that here we have just one distinct root (in other words, a repeated root) which is given by the coordinates (1,0)(1,0).

In Step 2, we let x=0x=0,

y=(01)2y=(1)2y=1\begin{aligned}y&=(0-1)^2\\y&= (-1)^2\\y&=1\end{aligned}

Therefore the yy-intercept is (0,1)(0,1).

For Step 3, let us expand the quadratic in order to determine its shape.

y=(x1)2y=(x1)(x1)y=x22x+1\begin{aligned}y&=(x-1)^2\\y&=(x-1)(x-1)\\y&=x^2-2x+1\end{aligned}

Since a=1>0a=1>0, the curve will be U-shaped. We draw a U-shaped curve passing through the root and the yy-intercept.

Summary

We have learnt how to plot a quadratic equation in 3 simple steps. In Step 1, we find the xx-intercepts (roots), in Step 2, we find the yy-intercept and finally in Step 3, we determine the shape of the quadratic (U-shape or N-shape) and plot the curve.

Note that in the case of a quadratic equation that has no roots (no xx-intercepts), we need to find the minimum or maximum point in order to be able to get a decent plot. However this case will be covered in the topic of Differentiation.

Exercises

Plot the following quadratic equations:

a) y=x2xy=x^2-x

b) y=4x2y=4-x^2

c) y=x2y=x^2

d) y=x2+4x+4y=x^2+4x+4

e) y=2x22x+12y=2x^2-2x+\frac{1}{2}

f) y=2(x+1)(x+4)y=2(x+1)(x+4)