Solving a fifth order polynomial equation with varying coefficients
Hi, I have a fifth order polynomial in x whose coefficients depend on a certain variable k. Now, I want to find the real roots of that polynomial for each value of k, say from 0.1 to 2 in steps of 0.05 and after finding the roots, I need to plot the corresponding root versus the k from which it was obtained. How can I do that? If anyone could help, that would be highly appreciable.
I have already tried to find the roots for each value of k and then got a set of values for k and x then plotted it. But that is quite cumbersome and it has one disadvantage. If any one of the roots changes value then I have to repeat the whole process all over again. If all of the things could be included in a single program, that would be very helpful.
Please add your code, or at least the polynomial depending on
k
.