## Extremum and second derivative

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Patrick
Posts: 31
Joined: Wed May 03, 2017 3:30 pm

### Extremum and second derivative

Hello,

Since I wanted to experiment a way of producing d/dX using the complex variable method, I implement one of Thomas Klemm's post on my hp42s. Even if the structure of my program is quite messy, it gives me d/dX, the extremum and the sign of the second derivative. The main issue here is when I try to execute the same program on my DM42, it doesn't work as expected.

For instance, with a very simple equation like f(x)=2x^2-4, my hp42s gives me an extremum at (0,-4), an F(X)'' of 4 (a minimum) with an initial guess of any number. When I run the same data on the dm42 and Free42, with an initial guess of 1, I get an extremum at (0.9899,-4) and a f(x)'' of -39 196 080 396 (a maximum) witch is obviously false. The only way to get the correct minimum is to provide an initial guess of 0 or very close to 0, like 1E-6.

I know that there's a lot to do to improve my program, but it seems to be accurate on the hp42s.

What should be done to make it work on the DM42 ? I must be missing something.

Here attached is my program. Just enter the equation in EQ and execute dF.

Attachments
d-dX.zip
Unit SN: 00044

dlachieze
Posts: 191
Joined: Thu May 04, 2017 10:20 am
Location: France

### Re: Extremum and second derivative

It seems to come from the x<>y at step 30. You're recovering the Solver previous estimates and uses as the x solution. As the Free42 Solver implementation is different from the 42s implementation you get a different value. But what you need is what you stored in R00, so as a quick fix just replace step 30 by RCL 00 (and then you can simplify your program as you don't need anymore R01...).
DM42: 00425 - DM41X: β00066

Patrick
Posts: 31
Joined: Wed May 03, 2017 3:30 pm