Post Reply 
Extremums on HP 42S
12-23-2021, 04:51 PM
Post: #1
Extremums on HP 42S
The equation sqrt(ABS(x^3 +2*x +4)) produces extremums where I expect at x~-2.59 and x~0, but does not find the extremum at x~-1.33. Anyone know why?

LBL “FX”
ENTER
ENTER
ENTER
3
Y^X
X<>Y
X^2
2
*
+
4
+
RTN
END
Find all posts by this user
Quote this message in a reply
12-23-2021, 06:18 PM
Post: #2
RE: Extremums on HP 42S
Presuming you are using SOLVE (you don't say what you are using, or how, so we can only guess) you need to provide 2 initial guesses which straddle the desired root. What guesses are you providing and what results to they lead to?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
12-23-2021, 07:07 PM
Post: #3
RE: Extremums on HP 42S
Keep in mind that SOLVE was designed to find roots, not extrema. It will report extrema if it gets stuck on them, but there is no guarantee it will find any, regardless of what starting guesses you provide.

If you are specifically looking for extrema, you should use SOLVE to find roots of the derivative.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-23-2021, 07:09 PM
Post: #4
RE: Extremums on HP 42S
I used the solve protocol, adding MVAR X, RCL X to the routine. Tried -1.35, -1.31 as the bound, and it finds the extremum at X~0.
Find all posts by this user
Quote this message in a reply
12-24-2021, 09:13 AM (This post was last modified: 12-24-2021 09:20 AM by Pekis.)
Post: #5
RE: Extremums on HP 42S
Hello,

Is it this function ? If it's the case, I don't understand your values ...

[Image: ldrheat.png]

[Image: lrdheat.png]
Find all posts by this user
Quote this message in a reply
12-24-2021, 11:32 AM
Post: #6
RE: Extremums on HP 42S
(12-24-2021 09:13 AM)Pekis Wrote:  Is it this function ?
The formula is: \( \mathsf{y} = x^3 + 2(x^2) + 4 \)
Find all posts by this user
Quote this message in a reply
12-24-2021, 12:17 PM
Post: #7
RE: Extremums on HP 42S
I think the function is y = sqrt(abs(x^3+2*x^2+4))

(x^3+2*x^2+4)' = 3*x^2 + 4*x = 3*x*(x+4/3)

To understand why extremum -4/3 is misssed, we need to understand how Secant method work.

Assuming plot is above x-axis:

From (x1,y1),(x2,y2), secant line locate the root at the x-axis, go up, to get y3.
Then, it uses (x2,y2),(x3,y3) to locate x4, go up, to get y4 ...

Extremum that shaped like a \(\bigcup\) may be located.
Extremum that shaped like \(\bigcap\) will not (new x's will move away from it)

[Image: CNX_Calc_Figure_02_01_003.jpg]
Find all posts by this user
Quote this message in a reply
12-24-2021, 03:43 PM
Post: #8
RE: Extremums on HP 42S
Thanks! My equation did use 2*X^2, sorry for my typing. This is neat in that it demonstrates why this particular integration approach may not find all extremums! There is no perfect numerical approach to integration approximations, but some amazingly good ones!
Find all posts by this user
Quote this message in a reply
12-24-2021, 04:20 PM (This post was last modified: 12-24-2021 04:21 PM by toml_12953.)
Post: #9
RE: Extremums on HP 42S
(12-24-2021 09:13 AM)Pekis Wrote:  Hello,

Is it this function ? If it's the case, I don't understand your values ...

[Image: ldrheat.png]

[Image: lrdheat.png]

I wondered that, too. There's only one extremum AFAICS: -1.18 or so as your graph shows.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
12-25-2021, 04:02 PM (This post was last modified: 12-25-2021 04:37 PM by C.Ret.)
Post: #10
RE: Extremums on HP 42S
In the case the investigated function is \( f(x)=\sqrt{\left| x^3+2x^2+4 \right|} \), the extremums can be found solving \( \frac{\partial f(x)}{\partial x}=0 \) equation.

The only problem here is that \( f(x) \) isn't continuous all over the interval and the derivative function \( \frac{\partial f(x)}{\partial x} \) is not definite at the point \( x_d \) where \( x_d^3+2x_d^2+4=0 \) . Numerically, \( x_d\approx-2.5943 \).

This point is indicated by a cross on the following screen capture.

[attachment=10208]

At the discontinuity point \( x_d \), the extremums or root can't be determinate using method based on function continuity.

This explain why the algorithm of the SOLVE instruction of the HP-42S (or related clone or simulators) can only be used inefficiently in vicinity of the discontinuity.

Numerically, if the investigated function is \( f(x)=\sqrt{\left| x^3+2x^2+4 \right|} \); one may determine three extremums :
  • discontinued root at \( x_d\approx-2.5943 \) where \( f(x_d)=0 \)
  • intermediate extremum at \( x_b=-\frac{4}{3} \) where \( f(x_b) = \frac{2.\sqrt{105}}{9}\approx2.2771 \)
  • last extremum on y-axis at \( x_0=0 \) where \( f(x_0)=2 \)
Find all posts by this user
Quote this message in a reply
12-25-2021, 04:16 PM
Post: #11
RE: Extremums on HP 42S
What I find interesting is that the HP 42S does find the zero at ~-2.59!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)