# How can I force an interpolated function to go through a certain point?

Let's take this interpolated function:

f = ListInterpolation[{1, 2, 3, 5, 8, 5}]

I want to make 1/f'[x] go through a certain point (x=2, y=1, say). How can I do it?

The brute force way seems to be generating a list of 1/f'[x] for several values of $$x$$, artificially shifting the $$x=2$$ value to $$y=1$$, and then generating another interpolation function through the new list - but it seems extremely clunky.

As kglr notes in a comment, this is where you realize that you need a piecewise Hermite interpolant. Luckily, the Interpolation[] function in Mathematica can do this.

ff = Interpolation[{{{1}, 1}, {{2}, 2, 1}, {{3}, 3}, {{4}, 5}, {{5}, 8}, {{6}, 5}}];

1/ff'[2]
1

Plot[ff[x], {x, 1, 6},
Epilog -> {Directive[ColorData[97, 4], AbsolutePointSize[5]],
Point[MapIndexed[Append[#2, #1] &, {1, 2, 3, 5, 8, 5}]]}]


• You additionally need InterpolationOrder -> 6  to get a smooth derivative curve Plot[ff'[x], {x, 1, 6}]  . Commented Jan 29, 2020 at 5:56
• The OP didn't specify the order of continuity wanted, so I left it at that. Indeed, the InterpolationOrder can be increased if wanted. Commented Jan 29, 2020 at 6:26