# Function extrema and Maple accuracy

1. Sep 22, 2006

### P3X-018

Hi,
I have a function

$$f(x) = \frac{\cos(x^2)+x}{x^2+2},\quad x\in[0,3]$$

I have to find the extreme values of the function in in the range [0,3], with Maple, by solving f'(x) = 0. Maple will solve these numerical, and I get 3 values.
$c_1 = 0.5345058769$, $c_2=1.732313261$ and $c_3=2.461303848$.
Now there is an uncertantity in this, which can be seen, by calculating f'(c), for c1 (which should be a maxima) it is f'(c1) = -2*10^(-10). Surly this value x = c1 most be a little to the right of the true value of the maxima. Now how can I confirm that there isn't anyvalues in a small range around c1, so that $f(c_1-\delta) \gg f(c_1)$ for a very small value of $\delta>0$?

2. Sep 23, 2006

### P3X-018

The teacher suggested using the Mean Value Theorem, and/or using that if is differentiable in a point a, then there exists a function $\rho$, such that

$$f(a+h) = f(a)+f'(a)h+\rho(h)h$$

where the function has the property that $\lim_{h\rightarrow0}\rho(h)=0$ and $\rho(0) = 0$ (so it has continuty in 0).

But I just can't see how I can use these methods to argue. I was hoping someone just could give a hint.

3. Sep 23, 2006

### Data

There isn't any way to argue rigorously without knowing something about Maple's algorithms (because you don't know how large the $\delta$ is). But if you make an assumption, say, that $\delta \leq 0.1$, then you can try to bound $f^\prime$ and use the MVT argument above.

You should have something like

$$f^\prime (x) = -\frac{2x^3\sin (x^2)+4x\sin (x^2) + x^2 - 2 + 2x\cos (x^2)}{(x^2 + 2)^2}.$$

Take this in absolute value and use the triangle inequality to bound the numerator by a polynomial $P(x)$, and call the denominator $D(x)$. Note that D(x) is larger than P(x) for sufficiently large x (because it involves an $x^4$ term), so try to find some $a\in \mathbb{R}$ such that $P(x) \leq aD(x)$ for at least all x in [0,3]. Since you're using maple already, you had might as well just use it again (try a=2, and then try to make it as small as you can, though that's not too important!).

Then you'll have
$$|f^\prime(x)| \leq \frac{P(x)}{D(x)} \leq \frac{aD(x)}{D(x)} \leq a$$

for all x in [0,3] and you can use the MVT argument with your estimated bound on $\delta.$

Last edited: Sep 23, 2006
4. Sep 23, 2006

### P3X-018

I don't quite understand how I should use that a and the MVT.

But I tried the following. Since f'(c1) = -2*10^(-10), the error is in the 10th decimal and beyond (I've put Digits = 10, the default value), so I tried to calculate some values of c1 - n*10^(-11), and check for what value of n, will I get f'(c1 - n*10^(-11)) < 0. And I get that this is true for n < 5.
But what does this proof? Is it enough as an argument?

5. Sep 23, 2006

### Data

Well, if you can bound the derivative by $a$ and you assume a small deviation from the actual extremum (call the deviation $\delta$ and assume delta is smaller than some fixed value [a reasonable estimate for Maple's precision]) then you can put a bound on how much the function can deviate between the Maple output and the actual extremum.

It turns out that in fact

$$|f^\prime (x)| \leq 2$$

for all x (and you can show this by the method I outline in my last post - this isn't a least upper bound, but it'll do for an estimate). So in fact, $|f(x) - f(x-y)| \leq 2y$ for all real x and y.

So if the real maximum is at $C$ and maple outputs $c$ and you assume that $|C-c| = \delta \leq 0.1$, say, then $|f(C)-f(c)| \leq 2\delta \leq 0.2$.

I have to admit this doesn't really look like anything involving the MVT. What is being used here is essentially the fund. theorem of calculus (which of course you need the MVT to prove):

If the max is at C and Maple outputs c, then you want to bound $|f(C)-f(c)|$. Well, by the FTC,

$$f(C)-f(c) = \int_c^C f^\prime (x) dx$$

and by an easy theorem this means

$$|f(C)-f(c)| \leq \int_c^C |f^\prime (x)|dx.$$

Now, we've bounded $|f^\prime (x)|$ by $a$, so we just get

$$|f(C)-f(c)| \leq \int_c^C adx = a(C-c) = a\delta.$$

Last edited: Sep 23, 2006