I have an equation which I would like to solve for values of m
m^2+x*m+1=0
I know I can find these roots using polyroot(c(1,x,1)).
I’d like to plot these roots in R for varying x such that all the real roots of the polynomial are plotted for each value of x.
Note, the polynomial may become more complex than this, ruling out application of the quadratic or cubic formulas.
Any thoughts as to how I could accomplish this?
Thanks!
I think this will do the trick. Just set
Xto whatever values you want to evaluate.