and i want to calculate the value of x closest to the largest non- trivial zero of y. In this case, that would be x = 28.4141. In the above case, there are only two zeros of y (including the trivial one) but I might have other functions in which there may multiple non- trivial zeros and I would want the code to pick the value of x closest to the largest one. If there are no non-trivial zeros, then the code should pick the trivial solution. Any pointers will be appreciated.