       NMinimize a function of NMaximize

• To: mathgroup at smc.vnet.net
• Subject: [mg79947] NMinimize a function of NMaximize
• From: sapsi <saptarshi.guha at gmail.com>
• Date: Thu, 9 Aug 2007 05:24:10 -0400 (EDT)

```I have a function
g[x_]:=1 (Pi - 2 x*Sqrt[1 - x^2] - 2 ArcSin[x])
d[x_, o_, n_] := Abs[g[x] - Normal[Series[g[y], {y, o, n}]]] /. y -> x

d[] is the absolute difference of g[] and its Taylor series
approximation

dm[p_] := NMaximize[{d[x, p, 3], 0 <= x <= 1}, x][]

dm[] is the maximum absolute difference between the Taylor series
approximation(3rd order) around p and g[].
I wish to find that value of 'p' that minimizes this maximum
difference - i tried plotting and can see where the minima occurs but
would like the exact value. So, it thought this would work

NMinimize[{NMaximize[{ d[x, p, 3], 0 <= x <= 1}, x], 0 <= p <= 1}, p].

NMaximize::nnum: The function value -Abs[-2.41057-(2 (<<19>>-p)^2 \
p)/Sqrt[1-p^2]+2 p Sqrt[1-p^2]+(2 (<<1>>)^3)/(3 Sqrt[1-<<1>>] \
(-1+p^2))-(4 (0.652468-p) (-1+p^2))/Sqrt[1-p^2]+2 ArcSin[p]] is not a
\
number at {x} = {0.652468}. >>
NMaximize::nnum: "The function value \
-Abs[-2.41057-(2\(<<19>>-p)^2\p)/Sqrt[1-p^2]+2\ p\ Sqrt[1-p^2]+(2\(<<\
1>>)^3)/(3\Sqrt[1-<<1>>]\(-1+p^2))-(4\(0.652468-p)\(-1+p^2))/Sqrt[1-p^
\
2]+2\ ArcSin[p]] is not a number at {x} = {0.6524678079740285`}."
NMaximize::nnum: The function value -Abs[-2.41057-(2 (<<19>>-p)^2 \
p)/Sqrt[1-p^2]+2 p Sqrt[1-p^2]+(2 (<<1>>)^3)/(3 Sqrt[1-<<1>>] \
(-1+p^2))-(4 (0.652468-p) (-1+p^2))/Sqrt[1-p^2]+2 ArcSin[p]] is not a
\
number at {x} = {0.652468}. >>
NMinimize::nnum:

Can anyone provide any pointers on how to find the minimum of dm[]?