## Content

### More graph sketching

#### Sketching graphs of polynomials

The module Polynomials introduces drawing the graphs of polynomials, but does not consider finding the coordinates of the points of inflexion. This is now possible.

By going through the following steps, we can find the important features of the graph of a given polynomial:

1. the $$x$$- and $$y$$-intercepts
2. stationary points
3. where the graph is increasing and where it is decreasing
4. local maxima and local minima
5. behaviour as $$x$$ becomes very large positive and very large negative
6. points of inflexion.

Sometimes it is useful to find the coordinates of a few extra points on the graph.

Note. These steps are only a guide. Some flexibility in approach to these questions is desirable. In this module, we adhere to these steps as an aid to readability.

#### Example

Sketch the graph of $$y=x^3+x^2-8x-12$$.

#### Solution

1. We first find the $$x$$-intercepts and $$y$$-intercepts.
When $$x=0$$, we have $$y=-12$$, and so the $$y$$-intercept is $$-12$$.
When $$y=0$$, \begin{align*} 0 &= x^3+x^2-8x-12 \\ &=(x+2)^2(x-3), \end{align*} so $$x=-2$$ or $$x=3$$. The $$x$$-intercepts are 3 and $$-2$$.
2. The derivative is $\dfrac{dy}{dx} = 3x^2+2x-8 = (3x-4)(x+2).$ So $$\dfrac{dy}{dx}=0$$ implies $$x=-2$$ or $$x=\dfrac{4}{3}$$.
The coordinates of the stationary points are $$(-2,0)$$ and $$(\dfrac{4}{3},-\dfrac{500}{27})$$.
3. The graph of $$\dfrac{dy}{dx}$$ against $$x$$ is a parabola with a positive coefficient of $$x^2$$. We can see:
• $$\dfrac{dy}{dx} = 0$$ if and only if $$x=-2$$ or $$x=\dfrac{4}{3}$$
• $$\dfrac{dy}{dx} > 0$$ if and only if $$x<-2$$ or $$x>\dfrac{4}{3}$$
• $$\dfrac{dy}{dx} < 0$$ if and only if $$-2<x<\dfrac{4}{3}$$.

So the graph is increasing on $$(-\infty,-2) \cup (\dfrac{4}{3},\infty)$$ and decreasing on $$(-2,\dfrac{4}{3})$$.

 Value of $$x$$ Sign of $$\dfrac{dy}{dx}$$ Slope of graph −2 $$\dfrac{4}{3}$$ + 0 − 0 + $$\diagup$$ — $$\diagdown$$ — $$\diagup$$
1. From the investigation of the sign of $$\dfrac{dy}{dx}$$, we see that there is a local maximum at $$x = -2$$, and a local minimum at $$x = \dfrac{4}{3}$$.
2. As $$x \to \infty$$, $$y \to \infty$$, and as $$x \to -\infty$$, $$y \to -\infty$$.
3. The second derivative is $\dfrac{d^2 y}{dx^2} = 6x+2.$ If $$x < -\dfrac{1}{3}$$, then $$\smash{\dfrac{d^2 y}{dx^2}} < 0$$, and if $$x > -\dfrac{1}{3}$$, then $$\smash{\dfrac{d^2 y}{dx^2}} > 0$$. There is an inflexion point where $$x = -\dfrac{1}{3}$$. ##### Exercise 5

Sketch the graph of $$y = 3x^4-44x^3+144x^2$$.

##### Exercise 6

Sketch the graph of $$y=4x^3-18x^2+48x-290$$.

#### Sketching graphs of other functions

The six steps used to help us sketch graphs of polynomials can be used to help sketch other graphs. In the Links forward section, we look briefly at graphs where there are local maxima or minima at which the function is not differentiable.

#### Example

Sketch the graph of $$y = \sqrt{x} - x^2$$, for $$x\geq 0$$.

#### Solution

The first and second derivatives are

$\dfrac{dy}{dx} = \dfrac{1}{2\sqrt{x}} - 2x,\qquad \dfrac{d^2y}{dx^2} = -\dfrac{1}{4}x^{-\frac{3}{2}} - 2, \qquad\text{for } x>0.$

We follow the six steps for sketching polynomial graphs, which are still useful for this type of graph.

1. We first find the $$x$$-intercepts: \begin{align*} \sqrt{x} - x^2 &= 0 \\ \sqrt{x}(1-x^{\frac{3}{2}}) &= 0, \end{align*} which gives $$x = 0$$ or $$x = 1$$.
2. We find the stationary points by solving $$\dfrac{dy}{dx} = 0$$: \begin{align*} \dfrac{1}{2\sqrt{x}} - 2x &= 0 \\ 1 &= 4x^\frac{3}{2} \\ x^\frac{3}{2} &= \dfrac{1}{4} \\ x &= \Bigl(\dfrac{1}{4}\Bigr)^{\frac{2}{3}}. \end{align*} So there is a stationary point at $$x = \bigl(\dfrac{1}{4}\bigr)^{\frac{2}{3}} = 2^{-\frac{4}{3}}$$.
3. If $$0 < x < 2^{-\frac{4}{3}}$$, then $$\dfrac{dy}{dx} > 0$$, and if $$x > 2^{-\frac{4}{3}}$$, then $$\dfrac{dy}{dx} < 0$$.

We can summarise this in a gradient diagram.

Value of $$x$$ Sign of $$\dfrac{dy}{dx}$$ Slope of graph $$2^{-\frac{4}{3}}$$ + 0 − $$\diagup$$ — $$\diagdown$$
Hence, there is a local maximum at $$x = 2^{-\frac{4}{3}}$$. The corresponding $$y$$-value is \begin{align*} y &= \bigl(2^{-\frac{4}{3}}\bigr)^{\frac{1}{2}} - \bigl(2^{-\frac{4}{3}}\bigr)^2 = 2^{-\frac{2}{3}} - 2^{-\frac{8}{3}} \\ &= 2^{-\frac{8}{3}}\bigl(2^2 - 1\bigr) = 3 \times 2^{-\frac{8}{3}}. \end{align*}
4. We can also determine that there is a local maximum at $$x = 2^{-\frac{4}{3}}$$ by carrying out the second derivative test. When $$x = 2^{-\frac{4}{3}}$$, $\dfrac{d^2y}{dx^2} = -\dfrac{1}{4}\bigl(2^{-\frac{4}{3}}\bigr)^{-\frac{3}{2}} - 2 = -\dfrac{1}{4}\bigl(2^2\bigr) - 2 = -3.$ Since $$\dfrac{dy}{dx} = 0$$ and $$\dfrac{d^2y}{dx^2} < 0$$ at $$x = 2^{-\frac{4}{3}}$$, the point $$x = 2^{-\frac{4}{3}}$$ is a local maximum.
5. As $$x \to \infty$$, $$y \to -\infty$$. We do not consider $$x \to -\infty$$, since the domain of the function is $$[0,\infty)$$.
6. For all $$x > 0$$, we have $\dfrac{d^2y}{dx^2} = -\dfrac{1}{4}x^{-\frac{3}{2}} - 2 < 0.$

Hence, there are no points of inflexion.

We can now sketch the graph. #### Example

Sketch the graph of $$f(x) = e^x+e^{-2x}$$.

#### Solution

The domain of $$f$$ is all real numbers. The first two derivatives of $$f$$ are \begin{align*} f'(x) &= e^x-2e^{-2x} \\ f''(x) &= e^x+4e^{-2x}. \end{align*}
1. For all $$x$$, we have $$e^x > 0$$ and $$e^{-2x} > 0$$, and therefore $$f(x) > 0$$. Hence, there are no $$x$$-intercepts. We have $$f(0) = 2$$, and so the $$y$$-intercept is 2.
2. We find the stationary points by solving $$f'(x) = 0$$: \begin{align*} e^x - 2e^{-2x} &= 0 \\ e^{3x} &= 2 \\ x &= \dfrac{1}{3}\log_e 2. \end{align*} So there is a stationary point at $$x = \dfrac{1}{3}\log_e 2$$. The value of the function at this point is $$f(\dfrac{1}{3}\log_e 2) = 3 \times 2^{-\frac{2}{3}}$$.
3. If $$x<\dfrac{1}{3}\log_e 2$$, the gradient is negative and the graph of $$y=f(x)$$ is decreasing.
If $$x>\dfrac{1}{3}\log_e 2$$, the gradient is positive and the graph of $$y=f(x)$$ is increasing.
4. We have $$f''(x) = e^x+4e^{-2x} > 0$$, for all $$x$$. So there is a local minimum at $$x=\dfrac{1}{3}\log_e 2$$.
5. As $$x \to \infty$$, $$f(x) \to \infty$$, and as $$x \to -\infty$$, $$f(x) \to \infty$$.
6. Since $$f''(x) = e^x+4e^{-2x} > 0$$, for all $$x$$, there are no inflexion points. #### Example

Sketch the graph of $$f(x) = e^{-x}+x$$.

#### Solution

The domain of $$f$$ is all real numbers. The first two derivatives are $$f'(x) = -e^{-x}+1$$ and $$f''(x) = e^{-x}$$.
1. We have $$f(0) = 1$$, so the $$y$$-intercept is 1. We will see later that there is a local minimum at $$x=0$$. Indeed, the minimum value of the function occurs when $$x=0$$. Hence, there are no $$x$$-intercepts.
2. Solving $$f'(x) = 0$$ gives $-e^{-x}+1 = 0 \ \iff\ e^{-x} = 1 \ \iff\ x = 0.$ Hence, there is a stationary point at $$x =0$$.
3. If $$x<0$$, the gradient is negative and the graph of $$y=f(x)$$ is decreasing.
If $$x>0$$, the gradient is positive and the graph of $$y= f(x)$$ is increasing.
4. We have $$f''(x) = e^{-x} > 0$$, for all $$x$$. Hence, there is a local minimum when $$x=0$$.
5. If $$x \to -\infty$$, then $$f(x) \to \infty$$. If $$x \to \infty$$, then the line $$y=x$$ is an asymptote, since $$e^{-x} \to 0$$. ##### Exercise 7
Sketch the function $$f \colon (0,\infty) \to \mathbb{R}$$ given by $$f(x) = x^2 \log_e x$$.

#### Maxima and minima at end points

It may be that the maximum or minimum value of a graph occurs at the endpoints of that graph. Here are two examples to illustrate the need to check endpoints when trying to find the maximum and minimum values of a function.

#### Example

Sketch the graph of the function $$f \colon [1,3] \to \mathbb{R}$$ given by $$f(x) = x^2(x-4)$$, and find the maximum and minimum values of the function.

#### Solution

If $$f(x) = 0$$, then $$x=0$$ or $$x=4$$, which are outside the domain. Therefore the graph has no $$x$$-intercepts.

We next find the derivative and the second derivative of $$f$$:

\begin{align*} f'(x) &= 3x^2-8x = x(3x-8) \\ f''(x) &= 6x-8. \end{align*}

Hence, there is a stationary point at $$x=\dfrac{8}{3}$$, and a point of inflexion at $$x=\dfrac{4}{3}$$.

To determine if $$x=\dfrac{8}{3}$$ is a local maximum or minimum, we use the second derivative test:

$f''\Bigl(\dfrac{8}{3}\Bigr) = 8 > 0,$

and hence there is a local minimum at $$x=\dfrac{8}{3}$$.

We now find the values of $$f$$ at the two endpoints and the local minimum:

$f\Bigl(\dfrac{8}{3}\Bigr) = -\dfrac{256}{27},\qquad f(1) = -3,\qquad f(3) = -9.$

Hence, the maximum value of $$f$$ is $$-3$$, and it occurs when $$x=1$$. The minimum value of $$f$$ is $$-\dfrac{256}{27}$$, and it occurs when $$x=\dfrac{8}{3}$$. #### Example

Define $$f \colon [-7,6] \to \mathbb{R}$$ by $$f(x) = 3x^4+8x^3-174x^2-360x$$. Find the maximum and minimum values of the function.

#### Solution

The first and second derivatives are

\begin{align*} f'(x) &= 12x^3+24x^2-348x-360 \\ &= 12(x^3+2x^2-29x-30) = 12(x+1)(x-5)(x+6) \\ f''(x) &= 36x^2+48x-348 = 12(3x^2+4x-29). \end{align*}

So $$f'(x)=0$$ implies $$x = 5$$ or $$x = -1$$ or $$x=-6$$. There are stationary points at these three values. We use the second derivative test:

$f''(5) = 792 > 0,\qquad f''(-1) = -360 < 0,\qquad f''(-6) = 660 > 0.$

Hence, there is a local minimum at $$x=5$$, a local maximum at $$x=-1$$, and a local minimum at $$x=-6$$.

We have the following points on the graph:

• the left endpoint $$(-7,-1547)$$
• a local minimum $$(-6,-1944)$$
• a local maximum $$(-1,181)$$
• a local minimum $$(5,-3275)$$
• the right endpoint $$(6,-2808)$$. The maximum value of the function $$f$$ is $$181$$, which occurs at $$x=-1$$, and the minimum value of $$f$$ is $$-3275$$, which occurs at $$x=5$$.

##### Exercise 8

Sketch the graph of the function $$f \colon [-1,2] \to \mathbb{R}$$ given by $$f(x) = x^2(x+4)$$, and find the maximum and minimum values of this function.

Next page - Content - Maxima and minima problems