3

I was doing some coding and wanted to code the bisection method, but since this applies to the case where $f(a)f(b)<0$, I started to think how I could generalize this to $f(a)f(b)>0$ and I thought that this would be 'codeable' because I would only need to differentiate the function and find the roots of that, but then I started to wonder whether a (differentiable) function with a double rooth will always have a maximum or minimum in that point. Is this true, or are there some special cases where there is a double rooth, but no (local or absolute) maximum/minimum?

B.K.
  • 75
  • 3
    Are you including the case where the order of the root may be greater than $2$ (for example $x^3$ has a triple root at $0$ but no maximum or minimum) or is the order exactly $2$? – saulspatz Mar 30 '21 at 14:27
  • 2
    Many functions are not differentiable. Even for those that are, differentiation makes many errors worse. Bisection should not rely on differentiation, it should just rely on the sign of the function. – Ross Millikan Mar 30 '21 at 15:00

3 Answers3

2

Let $f$ be a function on some subset of $\mathbb{R}$, and for simplicity suppose that $f$ has a root at $0$. If $f$ has a root of order $p$ at $0$, then this means that we can write $f$ as $f(x)=x^pg(x)$, where $g(x)$ is a continuous function at zero, but does not have a root at zero. As such, we have either $g(0)>0$ or $g(0)<0$. Based on the continuity of $g$, we then know that this is true for some neighborhood of $0$, so if $|x|<\epsilon$ for some $\epsilon>0$, we have $g(x)$ is uniformly positive or negative. For the sake of convenience, assume it is positive.

Now, what happens to $f$ when $|x|<\epsilon$? If $0<x<\epsilon$, then $x^p$ is positive and $g(x)$ is positive, meaning $f(x)$ is positive; if $-\epsilon<x<0$, then $x^p$ has sign of $(-1)^p$, and $f(x)$ has the same sign. Thus, for even $p$, $f$ remains positive and for odd $p$ is switches to being negative in this region. Specifically when $x=0$, we know that $f(x)=0$, so this means that if $p$ is even, then $f(x)$ is positive on the left and right, but zero in the middle. If $p$ is odd, then the sign switches.

This tells us that if $f$ has a root at some point with an even order then the root is a local extrema. When the root has odd order greater than $1$ then it visually looks like a "flat spot", meaning that it looks like it flattens out but then continues its path. When the order is exactly $1$, this means $f$ looks just like a line through the axis. For your case, if the root is exactly a double root, then it is also a local extrema.

Josh B.
  • 2,827
  • Not so. See the counterexample in my answer. As Vítězslav Štembera's answer shows, you've made an assertion that really needs to be an assumption. – saulspatz Mar 30 '21 at 15:05
  • @saulspatz Yes, I assume the level of continuity on $g$, which is not necessarily true. I assumed this because if we are in a situation, as the post describes, where we can "code" the derivatives, then I imagine we are working with "sufficiently smooth" functions. – Josh B. Mar 30 '21 at 16:55
2

It is not true that a differentiable function with a double zero at some point will always have a local minimum or maximum at that point. If the function is allowed to have a higher-order zero, then $f(x)=x^3$ furnishes a simple counterexample.

It's harder to find a counter example for a zero of order exactly $2$. Here's one:

$$f(x)=\begin{cases}x^5\sin\frac1x,&x\neq0\\0,&x=0 \end{cases}$$

It can be shown that $f'(0)=f''(0)=0$, but clearly $f$ takes both positive and negative values in any interval containing $0$.

To confirm the statements about the derivatives, just differentiate as usual when $x\neq0$. For $x=0$, use the following simple consequence of the mean value theorem.

Let $f(x)$ be continuous on the interval $(a, b)$ and differentiable there, except perhaps at some point $a<c<b$. Suppose further that $\lim_{x\to c}f'(x)$ exists. Then $f$ is differentiable at $c$, and $f'(c)=\lim_{x\to c}f'(x)$.

That is, just take the limits of the derivatives as $x\to0$, and if they exist, they're the derivatives at $0$.

saulspatz
  • 53,131
1

Interesting. This is really true under these conditions: Let $g(x)=(x-a)^2f(x)$ defined on the neighbourhood of $a$ (denoted by $U(a)$), where furthermore $f(a)>0,~f\in C^2(U(a))$, then $f$ has local minimum at $a$. This can be seen from: $$g'(x)=2(x-a)f(x)+(x-a)^2f'(x),$$ $$g''(x)=2f(x)+4(x-a)f'(x)+(x-a)^2f''(x) \\ \implies g'(a)=0,~g''(a)>0.$$ If $f(a)<0$ then you get a local maximum.