Fundamental Mathematics from an Advanced Standpoint

Math 4303

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu

Last Edits: 02/26/2026

The Roots of a Parametrized Family of Polynomials

PolyRoots[pol_,var_,{par_,st_,end_},step__:100]:=Module[{pl,x,p,r,rg,rt,s,k},pl=pol/.{var->x,par->p};Print["The roots of the polynomial ",pol,", for ",par," from ",st," to ",end,":"];r=Map[({Chop[Re[#]],Chop[Im[#]]}&),NSolve[pl==0,x][[All,1,2]]];rg=Max[rt=Table[Map[(Norm[#]&),r/.p->k],{k,st,end,(end-st)/10}]];Animate[Show[Graphics[Map[({AbsolutePointSize[8],If[Chop[#[[2]]]==0,Blue,Red],Point[#]}&),r/.p->s]],PlotRange->{{-rg,rg},{-rg,rg}},PlotLabel->Row[{par, " = ", PaddedForm[N[s],{6,1}]}],Axes->True,AxesLabel->{Re,Im},BaseStyle->{12,Bold}],{{s,st,par},st,end,(end-st)/step,ControlPlacement->Bottom,AnimationDirection->ForwardBackward}]]
PolyGraphs[pol_,{var_,st1_,end1_},{par_,st_,end_},{prst_,prend_},step__:50]:=Module[{pl,r,p,pt,rt},pl=pol/.{var->x,par->p};r=Map[({Chop[Re[#]],Chop[Im[#]]}&),NSolve[pl==0,x][[All,1,2]]];Print["The graphs of f(",var,") = ",pol, ", for ",par," from ",st," to ",end,":"];Animate[rt=Select[r/.p->par,(#[[2]]==0&)];pt=Map[(Point[#]&),rt];Plot[pol,{var,st1,end1},PlotStyle->{Green,Thick},AxesLabel->{x,"f(x)"},PlotRange->{prst,prend},BaseStyle->{12,Bold},Epilog->{AbsolutePointSize[8],Blue,pt}],{par,st,end,(end-st)/step,ControlPlacement->Bottom,AnimationDirection->ForwardBackward}]]

PolyGraphs[x^2+b x+2,{x,-4,4},{b,-4,4},{-2,5},50]

PolyRoots[x^2+b x+2,x,{b,-4,4}]

PolyGraphs[x^5-3x^4+α x^3-4α x^2-5,{x,-4,4},{α,-10,10},{-50,80},125]

PolyRoots[x^5-3x^4+α x^3-4α x^2-5,x,{α,-10,10},125]

Below are the roots of a polynomial with complex coefficients. Note the the roots do not show up in complex-conjugate pairs.

PolyRoots[(3-I)x^4+ x^3-4I x^2-10x+α,x,{α,-10,10},125]