P is a solution containing two metal ions N3+ and N2+. the concentration of each is 0.01 mol dm-3 . for EDTA Complexes the formation constants are log K(NY-) =15 and log K(NY2-)=10

At pH=6.0 fractional composition of Y4- is 1x10^-6

with a masking agent(a ligand) L, N3+ forms a complex NL3+ the formation constant, log K(NL)=6

Derive an equation to determine the feasibility of selective titration of N2+ ions in the presence of N3+.

calculate the masking agent L to be added to 1.0 dm3 of the solution P such that only N2+ ions react with EDTA.

How do I derive the equation?

I attached the pic or how I tried to derive the equation but I'm not sure if its correct!