Nernst equation is derived from the thermodynamic expression of free energy: #DeltaG=DeltaG^@+RTlnQ# and we know that #G=-nFE#, therefore, Nernst equation will be:

#E=E^@-(RT)/(nF)logQ#

where #Q# is the reaction quotient, #R# is the universal gas constant #R=8.3145 J/(mol.K)#, #F# is Faraday's constant #F=96485 C/(mol e^-)# and #T# is the temperature in Kelvin.

Example,

RedOx Reaction: #2Al(s) + 3Mn^(2+)->2Al^(3+)+3Mn(s)# at #25^@C#