# Define a differentiable function on $[-3, 3]$ that has an absolute maximum and minimum at $-1$ and $1$, respectively.

This question(2B-6-c) appears in Unit 2 of Exercises(on Applications of Differentiation) MIT's 18.01SC. The original question only seeks a plot of such a function, which I found to be trivial. I'm interested in defining such a function explicitly. A general question I would like to be answered is:

Define a differentiable function $$f$$ on a given closed interval, with known absolute maximum and minimum.

In this particular case, I tried working with the elementary cubic polynomial $$f(x)=\frac{x^3}{3}-x$$. This polynomial has $$x=\pm 1$$ as local maximum and minimum. The endpoints(here, $$\pm 3$$) serve as the absolute maximum/minimum. In another attempt, I tried the cubic polynomial $$f(x)=x(x+3)(x-3)$$(which has its roots at the endpoints and 0), but the absolute maximum/minimum do not occur at $$x=\pm 1$$. I also worked my way around some piecewise functions, but couldn't resolve issues of continuity(which clearly blows up differentiability). How do I resolve this conundrum? I seek answers to this particular case, as well as the general case.

Edit: The identity function and absolute value functions cannot account for given absolute extrema; they are the endpoints of the interval for these functions.

• Does $f(x) = -\sin\frac{\pi x}2$ satisfy your requirements? Jun 12 '20 at 19:59
• @CalumGilhooley Yes! I believe by adjusting the coefficient of $x$ in this function I can solve for the general case as well? Jun 12 '20 at 20:12
• It'll give you one internal global maximum and one internal global minimum, but not at points of your own choosing, if that matters. A spline function might be the most flexible general tool for the job. Jun 12 '20 at 20:23

The differentiable function $$[-3, 3] \to \mathbb{R},$$ $$x \mapsto -\sin(\pi x/2)$$ has global maxima of value $$1$$ at $$\{-1, 3\}$$ and global minima of value $$-1$$ at $$\{-3, 1\}.$$

Interpreting the general question in the most stringent way possible (without going overboard!):

Given $$a, b, c, d$$ and $$r, s, v, w$$ such that $$a < c < d < b$$ and $$r < v < s$$ and $$r < w < s,$$ we wish to construct a differentiable function $$f \colon [a, b] \to [r, s]$$ that has a strict global maximum of value $$s$$ at $$c,$$ and a strict global minimum of value $$r$$ at $$d,$$ and additionally satisfies $$f(a) = v,$$ $$f(b) = w,$$ and $$f'(a) = f'(b) = 0.$$

Thus we want $$f$$ to increase (let us say strictly) from $$v$$ to $$s$$ on $$[a, c],$$ decrease (strictly) from $$s$$ to $$r$$ on $$[c, d],$$ and increase (strictly) from $$r$$ to $$w$$ on $$[d, b].$$

One solution is this spline function: $$f(x) = \begin{cases} v + (s - v)g\left(\frac{x-a}{c-a}\right) & \text{if } a \leqslant x \leqslant c, \\ s - (s - r)g\left(\frac{x-c}{d-c}\right) & \text{if } c \leqslant x \leqslant d, \\ r + (w - r)g\left(\frac{x-d}{b-d}\right) & \text{if } d \leqslant x \leqslant b, \end{cases}$$ where $$\begin{gather*} g(t) = 3t^2 - 2t^3, \ g'(t) = 6t(1 - t) \ (0 \leqslant t \leqslant 1), \\ g(0) = 0, g(1) = 1, g'(0) = g'(1) = 0, \\ g'(t) > 0 \ (0 < t < 1). \end{gather*}$$

A suitable function would be $$y=xe^{\frac{-x^2}{2}}$$ on $$[-3,3]$$.

Note that you would be able to adjust the position of the maximum and minimum to arbitrary values, say $$u$$ and $$v$$ by replacing $$x$$ with $$\alpha(x-x_0)$$ where $$x_0=\frac{u+v}{2}$$ and $$\alpha=\frac{2}{v-u}$$.

• But the maximum and minimum occur at the endpoints for $y=x$, which is not what I seek. I'll check for $y=xe^{-x^{2}}$ though. May 22 '20 at 7:39
• Will you please consider making an edit to your answer? As such my question remains unanswered, and the "1 answer" mark on the active questions list might prevent others from taking the opportunity to answer it. May 22 '20 at 7:55
• @Manan Done. I didn't realise you needed specific locations for the maximum and minimum, nor until I saw your edit that you wanted the turning points to be in the interior of the interval. If you need specific $y$ values you can multiply and add to the function appropriately. May 22 '20 at 8:16
• I'm not sure if it still answers either of my questions: a differentiable function on $[-3,3]$ with absolute maximum/minimum occuring at $\pm 1$ or a general approach for closed intervals. May 22 '20 at 8:21
• @Manan do you mean it is not differentiable on [-3,3] or that the absolute maximum and minimum are not at $\pm1$. I am not sure what sort of generalisation you are talking about - if it is only a horizontal shift and scaling you replace $x$ by $\alpha(x-x_0)$. May 22 '20 at 8:44