Extremums on HP 42S

12232021, 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 

12232021, 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 

12232021, 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. 

12232021, 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.


12242021, 09:13 AM
(This post was last modified: 12242021 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 ... 

12242021, 11:32 AM
Post: #6




RE: Extremums on HP 42S  
12242021, 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 xaxis: From (x1,y1),(x2,y2), secant line locate the root at the xaxis, 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) 

12242021, 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!


12242021, 04:20 PM
(This post was last modified: 12242021 04:21 PM by toml_12953.)
Post: #9




RE: Extremums on HP 42S
(12242021 09:13 AM)Pekis Wrote: Hello, I wondered that, too. There's only one extremum AFAICS: 1.18 or so as your graph shows. Tom L Cui bono? 

12252021, 04:02 PM
(This post was last modified: 12252021 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\approx2.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 HP42S (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 :


12252021, 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!


« Next Oldest  Next Newest »

User(s) browsing this thread: