Review example 5.10 and exercise 5.10. Suppose 1.58 moles of N2 and 0.420 moles of O2 occupy 22.41 L at a total pressure of 2.00 atm.

Use XA = to determine the (decimal) mole fractions of both components.
Then, use XA = to determine the partial pressures (PA) of both components.
Show all applicable units.

How would you get the total moles? I know you have to divide moles of O2 by total moles I got 0.013 then I divided 1.58 moles if N2 by 28 and I got 0.06. Is this right? Then the formula would be XO2 =pO2/ptotal right

Total mols = mols O2 + mols N2 = 1.58 + 0.420 = ?

You divided mols/molar mass to find X and that isn't right.
XO2 = nO2/total mols.
XN2 = nN2/total mols
Then you can find partial pressure of each this way.
pO2 = XO2*Ptotal
pN2 = XN2*Ptotal

To calculate the total moles, you need to add the moles of N2 and O2 together. In this case, it would be:

Total moles = moles of N2 + moles of O2 = 1.58 moles + 0.420 moles = 2.00 moles

Your calculation of dividing the moles of O2 by the total moles is correct. This is how you calculate the mole fraction of O2 (XO2):

XO2 = moles of O2 / total moles = 0.420 moles / 2.00 moles = 0.210

Similarly, to calculate the mole fraction of N2 (XN2), you divide the moles of N2 by the total moles:

XN2 = moles of N2 / total moles = 1.58 moles / 2.00 moles = 0.790

Now, for the partial pressures of each component, you can use the formula:

PA = XA * Ptotal

To find the partial pressure of O2 (PO2), you would use the mole fraction of O2 (XO2) and the total pressure (Ptotal):

PO2 = XO2 * Ptotal = 0.210 * 2.00 atm = 0.420 atm

Similarly, to find the partial pressure of N2 (PN2), you would use the mole fraction of N2 (XN2) and the total pressure (Ptotal):

PN2 = XN2 * Ptotal = 0.790 * 2.00 atm = 1.580 atm

Therefore, the decimal mole fractions are XO2 = 0.210 and XN2 = 0.790, and the partial pressures are PO2 = 0.420 atm and PN2 = 1.580 atm.