Consider the following cell:

Pt|H2(g,1atm)|H+(aq,?M)||Ag+(aq1M)|Ag(s)
If the voltage of this cell is 1.04V at 25C and the standard potential of the Ag+/Ag couple is .8V, calculate the hydrogen ion concentration in the anode compartment.
I just need help setting up the problem, i believe i am suppose to be using Nernst

To solve this problem, you are indeed correct that you need to use the Nernst equation. The Nernst equation relates the voltage of an electrochemical cell to the concentrations (or activities) of the participating species.

The Nernst equation is given by:

E = E° - (RT/nF) * ln(Q)

Where:
- E is the cell voltage
- E° is the standard electrode potential for the Ag+/Ag couple (0.8V in this case)
- R is the ideal gas constant (8.314 J/(mol·K))
- T is the temperature in Kelvin (25 degrees Celsius is equal to 298 Kelvin)
- n is the number of electrons transferred in the balanced equation for the half-reaction
- F is the Faraday constant (96485 C/mol)
- Q is the reaction quotient, which is the ratio of product concentrations to reactant concentrations, raised to the power of the stoichiometric coefficients

Given the cell setup:

Pt|H2(g, 1atm)|H+(aq, ?M)||Ag+(aq, 1M)|Ag(s)

We can see that the half-reactions are as follows:
At the cathode: Ag+(aq) + e- -> Ag(s) | E° = 0.8V
At the anode: H2(g) -> 2H+(aq) + 2e-

Since the electrons cancel out in the overall reaction, n = 2.

Now let's set up the Nernst equation for this cell using the given information:

1.04V = 0.8V - (8.314 J/(mol·K) * 298 K / (2 * 96485 C/mol)) * ln(Q)

Simplifying the equation gives:

0.24V = (2.303 * 8.314 J/(mol·K) * 298 K / (2 * 96485 C/mol)) * ln(Q)

0.24V = (5981.5 J/mol) * ln(Q)

Now, isolate the natural logarithm of Q:

ln(Q) = 0.24V / (5981.5 J/mol)

Using the properties of logarithms, we can then solve for Q:

Q = e^(0.24V / (5981.5 J/mol))

Once you've calculated Q, you can use it to find the concentration of H+ by relating it to the concentration ratio of products to reactants in the anode compartment. Since the concentration of Ag+ is 1M and Ag(s) is a solid, their concentrations can be considered constant and do not affect Q. Let's assume the concentration of H+ is xM. Then:

Q = [H+]^2 / (1M) = x^2 / 1

Simplifying Q and solving for x will give you the hydrogen ion concentration in the anode compartment.