(* action of the spectral flow *)
munk[mu_,n_,kappa_]:=mu+n kappa;
mnk[mu_,M_,n_,kappa_]:=M-n mu-(kappa/2)((n^2)+n);

Conk[beta_,m_,kappa_]:=((2 beta)/3)((1/2)(beta/kappa)+1)+m;

(* X10 and X66 *)
kappa=1;
(* right values *)
(* wrong values *)
p1=With[{mu=0,M=1,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=0,M=2,n=4},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=0,M=3,n=4},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,7},Epilog->{PointSize[0.02],Blue,Red,Point[{p1,p2,p3}]}]

(* X8 *)
kappa=2;
(* right values *)
p1=With[{mu=0,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=1,M=3,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p4=With[{mu=0,M=2,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=0,M=3,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,7},Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3}],Red,Point[{p4,p5,p6}]}]

(* X64 *)
kappa=2;
(* right values *)
p1=With[{mu=0,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p3=With[{mu=0,M=2,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=0,M=3,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,7},Epilog->{PointSize[0.02],Blue,Point[{p1,p2}],Red,Point[{p3,p4,p5}]}]

(* X6 *)
kappa=3;
(* right values *)
p1=With[{mu=0,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p5=With[{mu=0,M=3,n=3},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=1,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,10},Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3,p4}],Red,Point[{p5,p6}]}]

(* X44 *)
kappa=4;
(* right values *)
p1=With[{mu=0,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=0,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=1,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p7=With[{mu=2,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p8=With[{mu=2,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p9=With[{mu=1,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p10=With[{mu=2,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p11=With[{mu=2,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,10},
Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3,p4,p5,p6,p7,p8}],Red,Point[{p9,p10,p11}]}]

(* X62 *)
kappa=4;
(* right values *)
p1=With[{mu=0,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p4=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=0,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=0,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p7=With[{mu=1,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p8=With[{mu=1,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p9=With[{mu=2,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p10=With[{mu=2,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p11=With[{mu=2,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p12=With[{mu=2,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,10},
Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3}],Red,Point[{p4,p5,p6,p7,p8,p9,p10,p11,p12}]}]

{p4,p5,p6,p7,p8,p9,p10,p11,p12}

Map[mumToxa,{p4,p5,p6,p7,p8,p9,p10,p11,p12}]

(* X5 *)
kappa=5;
(* right values *)
p1=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=0,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=1,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=1,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=1,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=1,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p7=With[{mu=2,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p8=With[{mu=2,M=1,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p9=With[{mu=2,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p10=With[{mu=2,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p11=With[{mu=0,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p12=With[{mu=0,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,13},Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3,p4,p5,p6,p7,p8,p9,p10}],Red,Point[{p11,p12}]}]

(* X33 *)
kappa=8;
(* right values *)

p1=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=0,M=3,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=0,M=4,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=2,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=3,M=-1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=4,M=-1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
(* wrong values *)
p7=With[{mu=0,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p8=With[{mu=1,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p9=With[{mu=2,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p10=With[{mu=3,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p11=With[{mu=3,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p12=With[{mu=4,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p13=With[{mu=4,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[-((2 mu)/3)((1/2)(mu/kappa)+1),{mu,0,17},Epilog->{PointSize[0.02],Blue,Point[{p1,p2,p3,p4,p5,p6}],Red,Point[{p7,p8,p9,p10,p11,p12,p13}]}]

(* X42 -- tentative *)
kappa=8;
p1=With[{mu=0,M=2,n=2},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p2=With[{mu=1,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p3=With[{mu=1,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p4=With[{mu=2,M=0,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p5=With[{mu=2,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p6=With[{mu=3,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p7=With[{mu=3,M=2,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p8=With[{mu=4,M=1,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
p9=With[{mu=4,M=2,n=1},{munk[mu,n,kappa],mnk[mu,M,n,kappa]}];
Plot[{fcon[x],3/4(x+1)},{x,0,4},
Epilog->{PointSize[0.02],Blue,Point[Rpointx5],Point[Rpointx3],Point[Rpointx6],Red,Point[Wpointx5],Point[Wpointx3],Point[Wpointx6],Green,Point[Map[mumToxa,{p1,p2,p3,p4,p5,p6,p7,p8,p9}]]}]

(* collect all {x,alpha} for different models in a single table *)
Rpointx={};Wpointx={};

ClearAll[pmax,lmax,lmax2,h1,GVTab,PTTabnew,DTTabnew,PTTabGv,h1fun,h1int,h1ser];
SetDirectory[NotebookDirectory[]];
(* choose your favorite CICY *)
<<X42.m
{CY,chi,kappa,c2}

(* Castelnuovo bound on the D0-charge for PT invariants *)
MMin[Q_]:=Ceiling[-((Q^2)/(2kappa))-(Q/2)];
(* Castelnovo bound on the genus of GV invariants *)
gMax[Q_]:=Floor[((Q^2)/(2 kappa))+(Q/2)+1];
(* action of the spectral flow *)
mun[mu_,n_]:=mu+n kappa;
mn[mu_,M_,n_]:=M-n mu-(kappa/2)((n^2)+n);
(* spectral flow transformation bringing D2 brane charge to the interval [0,κ/2] *)
SFmu[κ_,μ_]:=Module[{x= Round[μ/κ]},If[κ x > μ,κ x-μ ,μ-κ x]];
SFM[κ_,μ_,M_]:=Module[{x= Round[μ/κ]},If[κ x > μ,M+μ x+(κ/2)x(1-x)-(κ x-μ),M+μ x+(κ/2)x(1-x)]];

ChiO1[mu_,M_,n_]:=(kappa/2)n(n-1)+(n-1) mu-M+(kappa/6)+(c2/12);
mumToxa[{mu_,m_}]:={mu/kappa,-3/2m/mu};

(* rules for substitution of invariants *)
repPT={PT[mu_,n_]:>If[n<MMin[mu],0,If[mu+1<=Length[PTTabnew],If[n-MMin[mu]+2<=Length[PTTabnew[[mu+1]]],PTTabnew[[mu+1,n-MMin[mu]+2]],PT[mu,n]],PT[mu,n]]]};
JTab=CoefficientList[h1int,q];
repJ={J[mu_,n_]:>If[n<MMin[mu],0,If[mu+1<=Length[JTab]&& n+1<=Length[JTab[[mu+1]]]+MMin[mu],JTab[[mu+1,n-MMin[mu]+1]],J[mu,n]]]};

fcon[x_]:=If[x<1, x+(1/2),If[x<(15/8),Sqrt[2x+(1/4)],If[x<(9/4),(2/3)x+(3/4),If[x<3,(1/3)x+(3/2),(1/2)x+1
]]]];
Con[beta_,m_]:=((2 beta)/3)fcon[(beta/kappa)]+m;
nMin2 [mu_,M_]:=Module[{n},n=1;
While[Con[mun[mu,n],mn[mu,M,n]]>=0,n++];
n
];
NTab2=Array[nMin2 [#1-1,#2-1+MMin[#1-1]]&,{IntegerPart[kappa/2]+1,10}];
(* adds the first column encoding the shifts of the D0-charge *)
 NTab2=Transpose[Join[{Table[-MMin[mu],{mu,0,IntegerPart[kappa/2]}]},Transpose[NTab2]]];
MatrixForm[NTab2]

(* limits of summation *)
ULbeta[beta_,m_]:=beta+((3 kappa m)/(2 beta))+(kappa/2);
ULm[beta_,m_,betap_]:=((((beta-betap))^2)/(2 kappa))+(1/2)(beta+betap)+m;
LLm[betap_]:=-((((betap))^2)/(2 kappa))-(1/2)betap;
(* answer from Soheyla's Thm 2 *)
S2[mu_,M_,n_]:=Module[{Mun,Mn},Mun=mun[mu,n];Mn=mn[mu,M,n];((((-1))^(ChiO1[mu,M,n]+1))/(ChiO1[mu,M,n]))(PT[Mun,Mn]-Sum[Sum[(((-1))^(ChiO1[mu,M,n]-mup+mp+1))(ChiO1[mu,M,n]-mup+mp)PT[mup,mp] J[SFmu[kappa,Mun-mup],SFM[kappa,Mun-mup,Mn-mp+mup]],{mp,Ceiling[LLm[mup]],Floor[ULm[Mun,Mn,mup]]}],{mup,1,IntegerPart[ULbeta[Mun,Mn]]}])
];
(* result for n-dn *)
dn=1;
DTs=Table[Table[S2[mu,M,nMin2[mu,M]-dn],{M,MMin[mu],6+MMin[mu]}],{mu,0,kappa/2}]/.repPT;
JDT=DTs/.repJ//MatrixForm
JTab[[1;;IntegerPart[kappa/2]+1,1;;5]]//MatrixForm

Rpoint={};
Wpoint={};
For[mu=0,mu<=kappa/2,For[M=MMin[mu],M<=6+MMin[mu],
If[NumericQ[JDT[[1,mu+1,M-MMin[mu]+1]]],If[JDT[[1,mu+1,M-MMin[mu]+1]]==JTab[[mu+1,M-MMin[mu]+1]],
Rpoint=Append[Rpoint,{mun[mu,nMin2[mu,M]-dn],mn[mu,M,nMin2[mu,M]-dn]}],Wpoint=Append[Wpoint,{mun[mu,nMin2[mu,M]-dn],mn[mu,M,nMin2[mu,M]-dn]}]
]];M++];mu++];
Plot[-mu((1/2)(mu/kappa)+1),{mu,0,15},
Epilog->{PointSize[0.02],Blue,Point[Rpoint],Red,Point[Wpoint]}]

Rpointx=Flatten[Append[{Rpointx},Map[mumToxa,Rpoint]],1];
Wpointx=Flatten[Append[{Wpointx},Map[mumToxa,Wpoint]],1];

(* plotting in (x,\alpha) plane -- orange line is Castelnuovo bound *)
Plot[{fcon[x],3/4(x+1)},{x,0,6},Epilog->{PointSize[0.02],Blue,Point[Rpointx],Red,Point[Wpointx]}]

Sort[Rpointx]

Sort[Wpointx]

(* results for X5,X6,X8,X10, dn=1 *)
Rpointx5={{2,(39/20)},{2,(9/5)},{(6/5),(3/2)},{(11/5),(24/11)},{(11/5),(45/22)},{(11/5),(21/11)},{(11/5),(39/22)},{(7/5),(12/7)},{(7/5),(3/2)},{(12/5),(9/4)},{(12/5),(17/8)},{(12/5),2},{2,2},{2,(7/4)},{(4/3),(3/2)},{(7/3),(15/7)},{(7/3),(27/14)},{(10/3),(51/20)},{2,(15/8)},{(3/2),(3/2)},{(5/2),(21/10)},{(7/2),(18/7)},{2,(39/20)},{2,(9/5)},{(6/5),(3/2)},{(11/5),(24/11)},{(11/5),(45/22)},{(11/5),(21/11)},{(11/5),(39/22)},{(7/5),(12/7)},{(7/5),(3/2)},{(12/5),(9/4)},{(12/5),(17/8)},{(12/5),2},{2,2},{2,(7/4)},{(4/3),(3/2)},{(7/3),(15/7)},{(7/3),(27/14)},{(10/3),(51/20)},{2,(15/8)},{(3/2),(3/2)},{(5/2),(21/10)},{(7/2),(18/7)},{(9/2),(19/6)},{(9/2),3},{6,4}};
Wpointx5={{1,(3/2)},{1,(6/5)},{2,(33/20)},{1,(3/2)},{3,(5/2)},{3,(7/3)},{(7/3),(12/7)},{1,(3/2)},{3,(5/2)},{3,(9/4)},{4,3},{(5/2),(9/5)},{(7/2),(33/14)},{1,(3/2)},{3,(5/2)},{4,3},{4,(21/8)},{5,(33/10)},{1,(3/2)},{1,(6/5)},{2,(33/20)},{3,(5/2)},{3,(12/5)},{(11/5),(18/11)},{(12/5),(15/8)},{(12/5),(7/4)},{1,(3/2)},{3,(5/2)},{3,(7/3)},{3,(13/6)},{(7/3),(12/7)},{(10/3),(12/5)},{(10/3),(9/4)},{1,(3/2)},{3,(5/2)},{3,(9/4)},{4,3},{4,(45/16)},{4,(21/8)},{(5/2),(9/5)},{(7/2),(33/14)},{1,(3/2)},{3,(5/2)},{4,3},{4,(21/8)},{5,(33/10)},{6,(15/4)}};
(* results for X33, X44, X66, dn=1 *)
Rpointx3={{2,(25/12)},{2,2},{2,(23/12)},{(10/9),(3/2)},{(11/9),(18/11)},{(11/9),(3/2)},(*{(1/3),1},*){(4/3),(13/8)},{(13/9),(45/26)},{(13/9),(21/13)},{2,(33/16)},{2,(15/8)},{2,(27/16)},{(5/4),(3/2)},{(9/4),(13/6)},{(9/4),2},{(9/4),(11/6)},{(3/2),(7/4)},{(5/2),(9/4)},{(5/2),(21/10)}};
Wpointx3={{1,(3/2)},{1,(4/3)},{(10/9),(27/20)},{(11/9),(15/11)},{(4/3),(3/2)},{(4/3),(11/8)},{(13/9),(3/2)},{(13/9),(18/13)},{1,(3/2)},{(9/4),(5/3)},{(3/2),(3/2)},{(5/2),(39/20)},{1,(3/2)},{3,(5/2)},{4,3},{4,(21/8)}};
(* results for X62, X64, dn=1 *)
Rpointx6={{2,(33/16)},{(5/4),(3/2)},{(9/4),(13/6)},{(9/4),2},{(3/2),(7/4)},{2,(15/8)},{(5/2),(21/10)}};
Wpointx6={{1,(3/2)},{2,(15/8)},{2,(27/16)},{3,(5/2)},{(9/4),(11/6)},{(9/4),(5/3)},{(3/2),(3/2)},{(5/2),(9/4)},{(5/2),(21/10)},{(5/2),(39/20)},{1,(3/2)},{3,(5/2)},{3,(9/4)},{(3/2),(3/2)},{(5/2),(9/5)}};
(* results for X42 *)
Rpointx42={{(3/8),1},{(1/2),(9/8)},{(9/8),(3/2)},{(5/4),(3/2)},{(5/4),(33/20)},{(11/8),(18/11)},{(3/2),(13/8)},{(3/2),(7/4)},{2,(63/32)},{2,(33/16)},{(17/8),(33/17)},{(17/8),(69/34)},{(17/8),(36/17)},{(9/4),2},{(9/4),(25/12)},{(9/4),(13/6)},{(9/4),(9/4)},{(19/8),(81/38)},{(19/8),(42/19)},{(19/8),(87/38)},{(5/2),(93/40)}};
Wpointx42={{1,(21/16)},{1,(3/2)},{(9/8),(4/3)},{(11/8),(3/2)},{(3/2),(3/2)},{2,(27/16)},{2,(57/32)},{2,(15/8)},{(17/8),(30/17)},{(17/8),(63/34)},{(9/4),(23/12)},{(19/8),(39/19)},{(5/2),(87/40)},{(5/2),(9/4)}};

(* plotting in (x,\alpha) plane -- orange line is Castelnuovo bound *)
(* the red point {2,15/8} or (mu,n)=(8,-10) from X62 is suspicious - colored in green -*)
Pl=Plot[{fcon[x],3/4(x+1),x/2+1,Sqrt[2x]},{x,0,5},Epilog->{PointSize[0.02],Blue,Point[Rpointx5],Point[Rpointx3],Point[Rpointx6],Red,Point[Wpointx5],Point[Wpointx3],Point[Wpointx6],Green,Point[{2,15/8}],Point[{9/4,11/6}]},PlotRange->{1,4}]

Pl=Plot[{fcon[x],3/4(x+1),x/2+1,Sqrt[2x]},{x,1,4},Epilog->{PointSize[0.02],Blue,Point[Rpointx5],Point[Rpointx3],Point[Rpointx6],Point[Rpointx42],Red,Point[Wpointx5],Point[Wpointx3],Point[Wpointx6],Point[Wpointx42],Green,Point[{2,15/8}],Point[{9/4,11/6}]},PlotRange->{1,4}]

Pl=Plot[{fcon[x],3/4(x+1),x/2+1,Sqrt[2x]},{x,1,4},Epilog->{PointSize[0.02],Blue,Point[Rpointx42],Red,Point[Wpointx42],Green,Point[{2,15/8}],Point[{9/4,11/6}]},PlotRange->{1,4}]

ClearAll[mu,M,n,kappa];
FullSimplify[mumToxa[{mun[mu,n],mn[mu,M,n]}]/.{mu->kappa x,M->-2/3 kappa alpha x}]

xan[x_,alpha_,n_]:={n+x,((4 alpha x+3 n (1+n+2 x))/(4 (n+x)))};

Show[Pl,Table[ParametricPlot[xan[x,0,n],{n,0,4},PlotStyle->Dotted],{x,0,4,1/2}]]

xaToxdelta[{x_,alpha_}]:={x,-2/3 x(alpha-3/4(x+1))};
fcond[x_]:=1/2x(x+1)-2/3x fcon[x];Pld=Plot[{fcond[x],-2/3 x(Sqrt[2x]-3/4(x+1))},{x,0,4.5},Epilog->{PointSize[0.02],Blue,Point[xaToxdelta/@Rpointx5],Point[xaToxdelta/@Rpointx3],Point[xaToxdelta/@Rpointx6],Point[xaToxdelta/@Rpointx42],Red,Point[xaToxdelta/@Wpointx5],Point[xaToxdelta/@Wpointx3],Point[xaToxdelta/@Wpointx6],Point[xaToxdelta/@Wpointx42],Green,Point[xaToxdelta/@{{2,15/8},{9/4,11/6}}]}]

Simplify[fcond[x],x>3]