# Why FindRoot gives wrong answer for the roots of a vector interpolation function

I've tried to use FindRoot to find the roots of a vector interpolation function,

but Mathematica is clearly giving me the wrong answer.

What's going on here?

Here is my code to reproduce the problem.

Thanks :)

Remove["Global*"] // Quiet;
dat = Table[{t, {2  Cos[t], Sin[t]}}, {t, 0, 2 Pi, 0.5}];
intp = Interpolation[dat, Method -> "Hermite",
InterpolationOrder -> 3];
Plot[intp[t][[1]], {t, 0, 2}]
FindRoot[intp[t][[1]] == 0, {t, 0.5, 0, 2}]


• Commented May 21 at 10:08

## Method-1

• replace [[ ]],Part with Indexed.
FindRoot[Indexed[intp[t], 1] == 0, {t, 0.5, 0, 2}]


{t -> 1.57089}

## Method-2

• intp[t][[1]] return t,that is why the result not right. We can also use
F[t_?NumericQ] := intp[t][[1]];
FindRoot[F[t] == 0, {t, 0.5, 0, 2}]


{t -> 1.57089}

since for t belong to numeric number, intp[t][[1]] return the numeric first part of intp[t].

## Method-3

• Using Evaluated -> False to prevent intp[t][[1]] return t.
FindRoot[intp[t][[1]] == 0, {t, 0.5, 0, 2}, Evaluated -> False]


{t -> 1.57089}

• Thank you very much for the explanation. Could you please explain a bit more about why my code using Part` is incorrect? Commented May 20 at 0:56
• You explained it so clearly！ Thanks, have a nicde day :) Commented May 20 at 1:09