4. Plotting stuff#

It is sometimes said that a picture is worth a thousand words, and a quick look through any scientific journal could well convince you of this claim. Graphical representations perform a key role in science to help illustrate, explain and evaluate complex relationships.

We can produce high quality graphical representations of the functions that we are interested in using computer tools such as Wolfram Alpha, Desmos, or GeoGebra.

However, whilst we can use the computer to do plots for us, being able to idenitify various plot features without a computer is still a useful skill because the reasoning steps form the background to understanding more advanced concepts such as limits.

In this chapter we will look at the graphs of quadratics and rational fractions. After completing the chapter you should be able to plot these functions without using a computer, and identify any vertical, horizontal or oblique asymptotes.

4.1. Quadratics#

The general form of a quadratic may be given in expanded form or as a completed square:

(4.1)#\[\begin{align} y&=ax^2+bx+c \\ &= a\left(x+\frac{b}{2a}\right)^2+\frac{4ac-b^2}{4a} \end{align}\]

The \(y\)-intercept is at \(y=c\). The \(x\)-intercepts can be found by factorisation or use of the completed square form. The number of roots depends on the sign of the discriminant.

The shape of the plotted quadratic is called a parabola. It curves continuously in a direction that depends on the sign of \(a\), as illustrated in the schematic plots below:

../_images/a78fda1a3bf9ca8fd3a067e81fb41dba72cb79b4c52e955a4bd8eeab46eb6299.png

Fig. 4.1 The shape of the quadratic function \(y=ax^2+bx+c\), which is called a parabola.#

The parabola has a single turning point, which can be identified from the completed square form of the quadratic function. The squared factor \(\displaystyle \left(x+\frac{b}{2a}\right)^2\) is minimised at the point

(4.2)#\[\begin{equation} \biggr(x_*\ ,\ y_*\biggr)=\biggr(-\frac{b}{2a},\frac{4ac-b^2}{4a}\biggr) \end{equation}\]
  • If \(a>0\) this point is a minimum

  • If \(a<0\) this point is a maximum

The plot below illustrates an example case where the quadratic has two distinct real roots.

../_images/12073090a1342f551e4cfbc70a6441f33d7cae518f068644345f68491fb1d3c8.png

Fig. 4.2 A plot of the quadratic \(y=ax^2+bx+c\) with \(a>0\). The plot illustrates the case where there are two negative \(x_0,\ x_1\). The minimum point is denoted by \((x_* \ , \ y_*)\)#

If the quadratic does not have two distinct real roots, the curve will lie entirely above or below the horizontal axis, according to the sign of \(a\). If there is a single \(x\)-intercept, this will coincide with the turning point of the function and the function will just touch the horizontal axis.

Exercise 4.1

Plot the following curves without the assistance of a computer or calculator, and without using differentiation. Describe the steps you took to deduce the shape in each case:

(a) \(y=x^2+6x+8 \qquad\) (b) \(y=x^2+6x+9 \qquad\) (c) \(y=x^2+6x+10 \qquad\)

4.2. Reciprocals#

The term reciprocal means “one over something”. The most elementary reciprocal function is

(4.3)#\[\begin{equation} y=\frac{1}{x} \end{equation}\]

This fraction is undefined when \(x=0\). However, we can try some values of \(x\) that are close to zero. We observe that as \(x\) gets close to zero the fraction “blows up”, either in the positive or negative direction according to the sign of \(x\).

Conversely, by trying some very large values of \(x\) we observe that the fraction approaches zero, whilst remaining positive or negative according to the sign of \(x\).

We may represent these results graphically, as shown below. The dashed lines on the plot are called asymptotes. The curve continually approaches an asymptote, but does not meet it. For this function:

  • The line \(y=0\) is a horizontal asymptote

  • The line \(x=0\) is a vertical asymptote

../_images/9f8fe3b0057ebe55aa81313b9132f755c65547f5998c1e07c7cad1e2e79db737.png

Fig. 4.3 A plot of the function \(1/x\), showing horizontal and vertical asymptotes.#

We may obtain similar plots for other reciprocals.

Exercise 4.2

Identify any asymptotes of each of the following functions, and plot their curves:

(a) \(\displaystyle y=\frac{1}{x^2} \qquad\) (b) \(y=\displaystyle \frac{1}{x^2+1}\)

The number of vertical asymptotes is determined by the number of distinct roots of the denominator. For example, let us consider the following function:

(4.8)#\[\begin{equation} y=\frac{1}{(x-2)(x-4)} \end{equation}\]

This example has a horizontal asymptote \(y=0\) and vertical asymptotes at \(x=2,4\). It is convenient to examine the sign of the function on each side of the asymptotes using a table:

\(x<2\)

\(2<x<4\)

\(x>4\)

\((x-2)\)

-

+

+

\((x-4)\)

-

-

+

\(\displaystyle \frac{1}{(x-2)(x-4)}\)

+

-

+

By plotting the horizontal and vertical asymptotes and using the table to identify the correct sign of the function, we may deduce that \(y\) has the shape shown below:

../_images/a05ac9459dbbdea480a270e718a1a1d9ec0d3fef80bafcc5fa55acb0ee6166c9.png

Notice that the function changes sign at each asymptote. We can anticpate this behaviour from the fact that each root has multiplicity 1.

It may not be obvious that the plot of the function should be symmetric in the line \(x=-3\). We can understand this by looking at the completed square form of the quadratic:

(4.9)#\[\begin{equation} y = \frac{1}{(x-3)^2-1} \end{equation}\]

The denominator is minimised at \(x=-3\) and this corresponds to a local maximum of \(y\).

Exercise 4.3

Identify any asymptotes of each of the following functions, and plot their curves:

(a) \(\displaystyle y =\frac{1}{x^2+6x+10}\qquad\) (b) \(\displaystyle y=\frac{1}{x^2+6x+9}\qquad\) (c) \(\displaystyle y=\frac{1}{x^2+6x+8}\)

4.3. Rational fractions#

We now consider the more general case of rational fractions, such as the following example. We can see that the function will have a vertical asymptote at \(x=1/2\). However, the behaviour of the function for “large” \(x\) is less obvious:

(4.10)#\[y = \frac{3x^2+2x}{1-2x}\]

For these examples, we use partial fraction decomposition to make progress:

(4.11)#\[\begin{equation} y= -\frac{3x}{2}-\frac{7}{4}-\frac{7}{4.(2x-1)} \end{equation}\]

The decomposition allows us to analyse what happens to the function as \(x\) becomes large, in either the positive or negative direction. In that case, the value of \(1/(2x-1)\) becomes small, and so the function approaches the oblique asymptote

\[\begin{equation*} y=-\frac{3}{2}x-\frac{7}{4} \end{equation*}\]

The sign of \(1/(2x-1)\) determines whether the function approaches the asymptote from above or below.

../_images/22b7ae19b7c0e57ddf83ed58ea881186f552ac1c36dde10b18d147b9aba35e0f.png

Fig. 4.4 Plotting the function \((3x^2+2x)/(1-2x)\).#

Exercise 4.4

Produce a plot of the following function and identify any asymptotes:

\[\begin{equation*} y=\frac{x^2+3x+1}{(2x-3)(2x+3)} \end{equation*}\]