# Solve from interpolation function

I have the following list and its interpolating finction x1:

point={{0., 0.}, {0.2, 1.}, {0.25, 1.5}, {0.3, 1.}, {0.5, 0.}};x1 =
Interpolation[point]


I would like to obtain values of x for which y=1 and I try:

Solve[x1[x] == 1, x]


but the output is:

NSolve::ifun: Inverse functions are being used by NSolve, so some solutions
may not be found; use Reduce for complete solution information.
{{InterpolatingFunction[{{0., 0.5}}, <>] -> 0.3}}


with a unique solution x=0.3. From the plot of x1, I expect that will be two different solutions. How can I solve this?Thanks

Try

FindRoot[x1[x] == 1, {x, .25, 0., 0.25}, Method -> "Secant"]
(*{x -> 0.2}*)
FindRoot[x1[x] == 1, {x, .25, 0.25, 0.5}, Method -> "Secant"]
(*{x -> 0.3}*)


Use numerical solver,

NSolve[x1[x] == 1, x]


{{x -> 0.3}}

• Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[{x1[x] == 1, 0 <= x <= 0.5}, x] doesn't evaluate the two(!) solutions. Feb 13, 2019 at 9:54