Calculate the mass of salts needed for constructing a buffer using potassium monobasic phosphate and potassium dibasic phosphate with the total concentration of 100 mM. The solution is to be prepared in DI water and the pKa value for potassium monobasic phosphate is 7.21 and for potassium dibasic phosphate is 12.67. The target pH for the resulting solution is 7.

Use the Henderson-Hasselbalch equation.

pH = pKa + log [(base)/(acid)]
Substitute pH and pKa and calculate the ratio of base/acid.
The second equation you need is
base + acid = 0.1 M
Those two equations solved simultaneously will give you concn acid and concn base, from there you can get to grams.
Post your work if you get stuck.

I should have given more info. I figured that I would use the H-H equation and the total conc., but what I don't get is why do I need two pka's.

I can get to the mass easily, but it seems that I could use either pka=7.21 or 12.67 with the base +acid =.1M.

(1)acid+base=.1M

potassium dibasic phosphate:

7=12.67 + log(base/acid)
(base/acid)=2.138x10^-6 subst. in (1)

base+base/2.138x10^-6=.1 solving
base=2.13x10^-7M
Mass of base=2.13x10^-7 x (174.18g)=3.71x10^-5g

Now I can find the mass of the acid as well by substituting for the base, but how do I make use of kpa = 7.21, why do I need it?

I don't know that you do; however, the problem may be confusing you with the use of pKa (or I suppose it could be confusing me).

pK = 7.21 is pK2 for H3PO4 and
pK = 12.67 is pK3 for H3PO4.
I think you want to use pK2 for H3PO4 and I don't think you need the other one.
pK2 for H3PO4 is for buffers utilizing KH2PO4 and K2HPO4.
Draw a titration curve for H3PO4 vs KOH. You start with H3PO4. The first equivalence point is when all H3PO4 has been converted to KH2PO4. All intervening points on that curve are calculated with pK1 for H3PO4.
The second equivalence point occurs when all of the KH2PO4 has been converted to K2HPO4. The intervening points between the first and second equivalence point is calculated using pK2. The third equivalence point occurs when all of the K2HPO4 has been converted to K3PO4. The pH of points between the second and third equivalence points is calculated using pK3. After, the third equivalence point, of course, the pH is just excess KOH. Therefore, I think pK2 is the one you want and it is the 7.21.

To calculate the mass of salts needed for constructing the buffer, we need to determine the molar concentrations of the two salts and then use these concentrations to calculate the mass.

Step 1: Calculate the molar concentrations of the two salts.
- We know that the total concentration of the buffer is 100 mM.
- Let's assume the molar concentration of potassium monobasic phosphate (KH2PO4) is x mM.
- The molar concentration of potassium dibasic phosphate (K2HPO4) can then be calculated as (100 - x) mM.

Step 2: Convert the mM concentrations to M (mol/L).
- To do this, we divide the mM values by 1000.
- So, the molar concentration of KH2PO4 is x/1000 M, and the molar concentration of K2HPO4 is (100 - x)/1000 M.

Step 3: Calculate the ratio of the salt concentrations using the Henderson-Hasselbalch equation.
- The Henderson-Hasselbalch equation is pH = pKa + log ([A-] / [HA]), where [A-] is the concentration of the conjugate base and [HA] is the concentration of the acid.
- In our case, KH2PO4 acts as an acid (HA) and K2HPO4 acts as its conjugate base (A-).
- The pKa value for KH2PO4 is 7.21, and we want the resulting pH to be 7.
- Substituting the values into the equation, we get 7 = 7.21 + log ((100 - x) / x).

Step 4: Solve the equation for x.
- Rearrange the equation to isolate x: log ((100 - x) / x) = 7 - 7.21.
- Take the antilog of both sides: (100 - x) / x = 10^(-0.21).
- Simplify: (100 - x) / x = 0.7048.
- Cross-multiply: 100 - x = 0.7048x.
- Simplify: 100 = 1.7048x.
- Divide both sides by 1.7048: x = 58.64.

Step 5: Calculate the mass of each salt.
- The molar mass of KH2PO4 is 136.09 g/mol, and the molar mass of K2HPO4 is 174.18 g/mol.
- Mass of KH2PO4 = (x/1000) M * (136.09 g/mol) * volume of the solution (in L).
- Mass of K2HPO4 = [(100 - x)/1000] M * (174.18 g/mol) * volume of the solution (in L).

Note: The volume of the solution is not provided in the question, so you would need to know or assume a specific value in order to calculate the masses accurately.

By following these steps, you can calculate the mass of salts needed to construct the buffer solution.