I’m trying to get an interactive output that allows me to plot both the function f and its tangent line y by changing the parameter x0. However I’m not able to obtain the plot of y. This is the code:
Your original posted code does not work as in the illustration. The function f and y are missing their arguments.
The reason it wouldn’t work with f and y is that Manipulate localizes x0. This means the x0 symbol in the definition of y is a different symbol than the x0 in Manipulate.