How can I find the maximum and minimum of a Parabola polynom using Java?

  • Context: High School 
  • Thread starter Thread starter LSDwhat?
  • Start date Start date
  • Tags Tags
    Max
Click For Summary

Discussion Overview

The discussion centers around finding the maximum and minimum values of a quadratic polynomial of the form ax² + bx + c within a specified interval defined by two points. Participants explore both the mathematical concepts involved and the implementation of these concepts in Java programming.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant requests assistance in creating a Java algorithm to determine the maximum and minimum of the quadratic polynomial.
  • Another participant suggests that understanding the underlying mathematics is essential before focusing on programming.
  • A participant expresses a lack of knowledge about the mathematics involved, emphasizing their need for clarification rather than code.
  • There is a discussion about the nature of maxima and minima, with one participant stating that maxima and minima are related to the values of Y corresponding to X values.
  • Another participant corrects this by stating that maxima and minima are determined by the values of Y in relation to their surrounding values, not directly by X.
  • A theorem is presented regarding conditions for maxima and minima, specifically mentioning boundary points and the derivative of the function.
  • It is noted that the function's critical point occurs at x = -b/(2a), and participants are advised to evaluate the function at the boundaries and this critical point to find the maximum and minimum values.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to finding the maximum and minimum values, with differing levels of understanding about the mathematics involved and the programming implementation. There is also a disagreement regarding the characterization of the shape of the graph of the polynomial.

Contextual Notes

Some participants express uncertainty about the mathematical concepts necessary for solving the problem, and there are unresolved questions about the relationship between the polynomial's graph and its maxima and minima.

LSDwhat?
Messages
13
Reaction score
0
I need to make to functions in java that gives the maxim and minin of the Parabola polynom ax2+bx+c for an interval of two given points.

I have no Idea how to make this algorithm , could you help ?

I have come to something like this :
if (-b/(2*a)>=x1 && -b/(2*a)<=x2)
return (-b/(2*a));
 
Physics news on Phys.org
LSDwhat? said:
I have no Idea how to make this algorithm , could you help ?
Figure out the math first, then worry about how to program it.
 
Hurkyl said:
Figure out the math first, then worry about how to program it.

I don't know the math that's why I'm asking. I don't want the java code.
 
Well, what do you know about finding minima and maxima?

Alternatively, what do you know about the shape of the graphs of parabolas?
 
Hurkyl said:
Well, what do you know about finding minima and maxima?

Alternatively, what do you know about the shape of the graphs of parabolas?

well the maxima should be the value of Y which is the bigger to a value of X and the minima the same.

About the shape its sinusoidal waves.
 
LSDwhat? said:
well the maxima should be the value of Y which is the bigger to a value of X and the minima the same.

About the shape its sinusoidal waves.

Careful, you are mixing apples and oranges. The max(min) will be the value of Y which is bigger(smaller) than every other value of Y for some region around your max(min) value.

Not X like you said, X is the input variable that determines your Y.

You should try graphing ax^2 + bx + c for various values of a, b, and c to verify if it has "sinusoidal waves."

that also might give you some intuition into the the max(min) of a parabola
 
Theorem: If E ⊂ R and f: E → R, and f has a maximum or minimum at x ∈ E, then one of the following three is true:
(1) x is a boundary point of E,
(2) f'(x) = 0, or
(3) f is not differentiable at x.

In your case, f(x) = ax2 + bx + c and E is the interval [x1, x2]. Then the only possibilities are these: (1) x is one of the boundary points x1 or x2 of E, or (2) f'(x) = 2ax + b = 0, so x = -b/2a. Look at the values of f at those three points; the largest one is the maximum, and the smallest one is the minimum.
 

Similar threads

Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 4 ·
Replies
4
Views
12K
Replies
30
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K