4
$\begingroup$

Let there be four points (-2,-5), (5,-6), (6,1), (-1,2) that are extrema (maxima / minima). I am trying to find a polynomial that includes these extreme points. I tried

p[x_] = Sum[c[i] x^i, {i, 0, 7}]; 
p[x] /. Solve[{p[-2] == -5, p[5] == -6, p[6] == 1, p[-1] == 2, 
           p'[-2] == 0, p'[5] == 0, p'[6] == 0, p'[-1] == 0}, {c[0], c[1], 
           c[2], c[3], c[4], c[5], c[6], c[7]}]
{-(112909/16464) - (1227475 x)/98784 + (1360085 x^2)/592704 +
  (6599065 x^3)/1185408 - (292265 x^4)/296352 - (310447 x^5)/592704 +
  (13175 x^6)/84672 - (13175 x^7)/1185408}

What is the smallest degree of a polynomial so that its graph includes the four points as extrema?

$\endgroup$
2
  • 1
    $\begingroup$ You have 8 conditions, therefore you need a polynomial with 8 parameters, that is a 7 degree polynomial. $\endgroup$ Commented Aug 12, 2023 at 10:06
  • $\begingroup$ @DanielHuber Well, that's the general case which holds "almost always" (in the mathematical sense). It could have a lower degree for some constraints (quite obviously). One could use Exists and such to figure out constraints on these constraints to succeed with a lower degree. $\endgroup$
    – kirma
    Commented Aug 12, 2023 at 10:52

3 Answers 3

8
$\begingroup$
  • Use the form InterpolatingPolynomial[{{x1,f[x1],f'[x1]},{x2,f[x2],f'[x2]},...}]

  • We use f[x]==y,f'[x]==0,f''[x]!=0 to verify the extreme points.

Clear[pts, data, f];
pts = {{-2, -5}, {5, -6}, {6, 1}, {-1, 2}};
data = PadRight[#, 3] & /@ pts;
f[x_] = InterpolatingPolynomial[data, x] // Expand
f /@ pts[[;; , 1]] == pts[[;; , 2]]
f' /@ pts[[;; , 1]]
f'' /@ pts[[;; , 1]] != 0 // Thread

enter image description here

Reply to comment

Plot[f[x], {x, -3, 7}, Mesh -> {pts[[;; , 1]]}, 
 MeshStyle -> Directive[Red, AbsolutePointSize[6]], 
 AspectRatio -> Automatic, 
 Epilog -> {EdgeForm[Red], FaceForm[LightGreen], Opacity[.8], 
   Polygon@pts}]

enter image description here

$\endgroup$
8
  • $\begingroup$ {{-2, -5}, {5, -6}, {6, 1}, {-1, 2}} is a square. How can I draw it and show it. $\endgroup$ Commented Aug 13, 2023 at 2:07
  • $\begingroup$ @JohnPaulPeter pts = {{-2, -5}, {5, -6}, {6, 1}, {-1, 2}}; poly = Polygon[pts]; Graphics[{EdgeForm[Red], FaceForm[LightGreen], poly}] $\endgroup$
    – cvgmt
    Commented Aug 13, 2023 at 2:10
  • $\begingroup$ Draw in the same graph of f[x]? $\endgroup$ Commented Aug 13, 2023 at 2:12
  • $\begingroup$ Thanks. Let's me try. $\endgroup$ Commented Aug 13, 2023 at 2:19
  • $\begingroup$ @JohnPaulPeter I see it now. See my updated. $\endgroup$
    – cvgmt
    Commented Aug 13, 2023 at 2:22
3
$\begingroup$
pts = {{-2, -5}, {5, -6}, {6, 1}, {-1, 2}};
derivs = {0, 0, 0, 0};
specs = MapThread[{{First@ #1}, Last@ #1, #2}&, {pts, derivs}];
InterpolatingPolynomial[specs, x] // Expand

interpolating polynomial

$\endgroup$
2
  • 1
    $\begingroup$ f'[5]==-769/42, not equal to 0. Similar to f'[-2], f'[6], f'[-1] $\endgroup$
    – Laurenso
    Commented Aug 12, 2023 at 14:32
  • $\begingroup$ @Laurenso Good point, fixed. $\endgroup$
    – MarcoB
    Commented Aug 12, 2023 at 23:34
2
$\begingroup$
val = {{-2, -5}, {5, -6}, {6, 1}, {-1, 2}};

 f = Interpolation[val]

 Series[f[x], {x, 0, 7}]

$$ \frac{51}{14}-\frac{37 x}{84}-\frac{25 x^2}{14}+\frac{25x^3}{84}+O\left(x^8\right)$$

  (f[#1] == #2 &) @@@ val 
  {True, True, True, True}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.