Fundamental Mathematics from an Advanced Standpoint

Math 4303

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

Last Edits: 9/22/2009

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},DisplayAllSteps ->True,AnimationDirection->ForwardBackward,AnimationRepetitions->1]]
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},PlotRange->{prst,prend},BaseStyle->{12,Bold},Epilog->{AbsolutePointSize[8],Blue,pt}],{par,st,end,(end-st)/step},DisplayAllSteps ->True,AnimationDirection->ForwardBackward,AnimationRepetitions->1]]

PolyGraphs[y(1-y)-b,{y,-1,2},{b,-1,1},{-3,2},50]

PolyRoots[y(1-y)-b,y,{b,-1,1}]

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

PolyRoots[ρ^5-3ρ^4+α ρ^3-4α ρ^2-1,ρ,{α,-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)ρ^4+ ρ^3-4I ρ^2-10ρ+α,ρ,{α,-10,10},125]