The pressure gauge on a tank registers the gauge pressure, which is the difference between the interior and exterior pressure. When the tank is full of oxygen (O2), it contains 9.00 kg of the gas at a gauge pressure of 40.0 atm. Determine the mass of oxygen that has been withdrawn from the tank when the pressure reading is 25.0 atm. Assume the temperature of the tank remains constant.

I set up a ratio using the ideal gas law.
Then I found oxygen in moles.
n= (mass of oxygen)/(molar mass)

PV/nRT (initial) = PV/nRT (final)
I just assumed that V and T are constant, and R is a constant.
so I come out with
P1/n1 = P2/n2
I solved for n2=n1*(P2/P1)
Then I converted back to kg. Then I subtracted that value from the initial mass value. However, I'm not getting the correct answer. Can someone let me know what I'm doing wrong?

I assume you used P1 = 41 atm and P2 = 26 atm because they are gauge?

P1 = 41 atm

P2 = 26 atm

P V = n R T
V is constant
R is constant
T is constant
so
P1 /n1 = p2/n2
n is proportional to kg, no need for moles here
so
41/9 = 26/x
x = 9*26/41 = 5.7 kg left
or 9-5.7 = 3.3 removed

I actually used P1=40 atm and P2=25 atm

I got a very similar answer (3.375 kg removed), but I'm still getting it wrong. Am I not taking something into account?

Your approach is mostly correct, but there seems to be a small mistake in your calculations. Let's go through the steps again to identify the error.

Given:
Initial pressure, P1 = 40.0 atm
Final pressure, P2 = 25.0 atm
Initial mass of oxygen, m1 = 9.00 kg

Step 1: Convert initial mass to moles
To use the ideal gas law, we need to convert the initial mass of oxygen to moles using the molar mass of oxygen (O2). The molar mass of O2 is 32.00 g/mol.

m1 = 9.00 kg = 9000 g (converted to grams)
n1 = m1 / Molar mass of O2 = 9000 g / 32.00 g/mol = 281.25 mol (rounded to 4 decimal places)

Step 2: Apply the ideal gas law equation
PV/nRT (initial) = PV/nRT (final)

Since the temperature (T) and volume (V) remain constant, they cancel out on both sides of the equation. Therefore, we can simplify the equation to:

P1/n1 = P2/n2

Step 3: Solve for n2 (moles of oxygen at final pressure)
Rearrange the equation to solve for n2:

n2 = n1 * (P1/P2)

Substituting the values:

n2 = 281.25 mol * (40.0 atm / 25.0 atm) = 450 mol (rounded to 3 decimal places)

Step 4: Convert moles to mass
To determine the mass of oxygen, we need to convert the moles of oxygen at the final pressure to mass using the molar mass of O2.

m2 = n2 * Molar mass of O2 = 450 mol * 32.00 g/mol = 14400 g = 14.40 kg (rounded to 2 decimal places)

Step 5: Calculate the mass of oxygen withdrawn
The mass of oxygen withdrawn from the tank is the difference between the initial mass (m1) and the final mass (m2).

Mass of oxygen withdrawn = m1 - m2 = 9.00 kg - 14.40 kg = 5.40 kg (rounded to 2 decimal places)

So, the correct mass of oxygen that has been withdrawn from the tank when the pressure reading is 25.0 atm is 5.40 kg.