A gas initially at STP is heated to 50°C keeping the volume constant. What is its new pressure?

I used this formula:
P1 = 1 atm
T1 = 273 K
T2 = 323 K
solve for P2
P2 = P1 (T2/T1)

But, where do I use the 50 degrees C?
Also, is my answer correct:
P2 = 1atm x 323K/273K = 1.18 atm

Yes, your answer is correct. The 50 C is the 323 K.

To solve this problem, you need to use the ideal gas law, which states: PV = nRT.

However, in this case, the volume is kept constant, so we can simplify the equation to P/T = constant. This implies that the pressure and temperature are directly proportional when the volume is held constant.

To use the formula you mentioned, P2 = P1 (T2/T1), you use the temperatures in Kelvin. When you converted 50°C to Kelvin, you correctly obtained 323K.

So, your formula is correct, and plugging in the values:
P2 = 1 atm x (323K/273K) = 1.18 atm.

Therefore, your answer of P2 = 1.18 atm is correct.

Don't worry about explicitly using the 50 degrees Celsius in this formula. By converting the temperature to Kelvin, you have effectively accounted for the change in temperature.