https://localsd.blogspot.com/2023/05/how-to-find-local-max-and-min-on-graph.html
How To Find Local Max And Min On Graph