Wolfram Alpha:

```Zeroth Law of Thermodynamics
----------------------------

Most natural processes are not reversible.

i.e. Thot -> Tcold, Tcold -/-> Thot

First law of Thermodynamics
---------------------------

ΔU = Q - W

U = Internal energy
Q = Heat added/subtracted to/from the system
W = Work done on or by the system

Second law of Thermodynamics
----------------------------

It is impossible to extract an amount of heat QH from a hot reservoir and
use it all to do work W.  Some amount of heat must be exhausted to a cold
reservoir.

Work Done by a Gas
------------------

Consider a piston with area A travelling a distance d:

W = Fd
= PΔV
= the area under the P versus V curve.
= ∫PdV

Now PV = nRT so P = nRT/V.  Therefore,

W = ∫PdV = nRT∫dV/V

= nRTln(Vf/Vi)

= (N/NA)RTln(Vf/Vi)

= NkBTln(Vf/Vi)

If the gas is expanding, ΔV is positive and constitutes work being
done by the gas.  Since ΔU = Q - W this means that internal energy
of the gas must decrease.  Conversely, if the gas is being compressed, the
ΔV term is negative.  This constitutes work being done on the gas.
In this case ΔU = Q - (-W) = Q + W so the internal energy of the gas
inreases.

Isothermal, Adiabatic, Isobaric and Isochoric Processes
------------------------------------------------------

Isothermal:

Isothermal processes take place at constant temperature.   In order for
this to happen the system is assumed to be connected to a heat reservoir
that supplies/absorbs heat to maintain the temperature. Changes are
assumed to take place slowly so that equilibrium with the reservoir is
maintained at all times.  We can summarize Isothermal processes by
saying:

ΔT = 0 and  Q ≠ 0

Since ΔU is proportional to T, this implies that ΔU = 0.  Thus,

0 = Q - W ∴ Q = W

Thus, all the heat added to the system is used to do work.

Adiabatic processes take place at non-constant temperature.   The system
is insulated and not connected to a heat reservoir so there is no heat flow
to keep the temperature constant.  Changes are assumed to take place
rapidly.  We can summarize Adiabatic processes by saying:

Q = 0 and ΔT ≠ 0

Correspondingly,

ΔU = -W

Isobaric:

Isobaric processes take place at constant pressure.

Isochoric (aka isovolumetric) processes:

Isochronic processes take place at constant volume.  Since there is no
ΔV involved there is no work done.

Heat Capacities:

U is a funtion of T and V.

dU = (∂U/∂T)V dT + (∂U/∂V)T dV

For constant V, dV = 0. Therefore,

dU = (∂U/∂T)V dT

= CV dT where CV is the heat capacity at constant V

Define Enthalpy, H = U + PV

H is a funtion of T and P.

dH = (∂H/∂T)P dT + (∂H/∂P)T dP

For constant P, dp = 0.  Therefore,

dH = (∂H/∂T)P dT

= CP dT where CP is the heat capacity at constant P

Now,

(∂H/∂T)P = (∂U/∂T)P + (∂PV/∂T)P

(∂H/∂T)P = (∂U/∂T)P + (PdV/dT)P

Now PV = nRT so PdV/dT = R if n = 1

CP = (∂U/∂T)P + R

Now, using the Chain Rule, we can write:

(∂U/∂T)P = (∂U/∂T)V + (∂U/∂T)P(∂V/∂T)P

(∂U/∂T)P = (∂U/∂T)V since there is no change in U when T is constant.

and so,

CP = CV + R

dU = dQ - PdV

= dQ - (nRT/V)dV

For adiabatic process dQ = 0, therefore:

dU = -(nRT/V)dV = CVdT

CVdT/T = -nRdV/V

Integrate both sides and set n= 1 to get:

CVln(Tend/Tbegin) = -Rln(Vbegin/Vend)

∴ CVln(Tend/Tbegin) = Rln(Vend/Vbegin)

∴ ln(Tend/Tbegin)CV = ln(Vend/Vbegin)R

∴ (Tend/Tbegin) = (Vend/Vbegin)R/CV

Now, from before:

CP = CV + R

∴ R/CV = (CP - CV)/CV = γ - 1

(Tend/Tbegin) = (Vend/Vbegin)γ - 1

Using the ideal gas equation PV = nRT we can write:

(PendVend/nR)/(PbeginVbegin/nR) = (Vend/Vbegin)γ - 1

(PendVend)/(PbeginVbegin) = (Vend/Vbegin)γ - 1

Pend/Pbegin = (Vend/Vbegin)γ

PbeginVbeginγ = constant = PendVendγ

This is Boyle's Law where the temperature is not constant.

Entropy:

Consider an isothermal process such that Q = W

From before we can write that:

Q = W = NkBTln(Vf/Vi)

= NkBln(Vf/Vi)

= kBln(Vf/Vi)N

If we assume that the volume of the gas is proportional to the number
of states in the system, the RHS looks very similar to the definition of
the change in entropy derived from statistical mechanics.  Thus, we can
write an alternative thermodynamics equation for the change in entropy
as:

ΔS = S - S' = Q/T

S is a state function or variable. A state function is a property of a
system that is not dependent on how the system arrived at its present
condition (is not time dependent).  Any change in a state function is
only dependent on the initial and final conditions. P, V, and T are other
examples of state functions whereas heat transfers, work transfers
and rates of chemical reactions are not.

Carnot Cycle
------------

A to B -  The gas expands and does work on the surroundings.  The temperature
of the gas does not change during the process, and so U remains
constant.  The gas expansion is due to the absorption of heat
energy, Qhot.  The entropy change, ΔS = Qhot/Thot

B to C -  The gas continues to expand, doing work on the surroundings, and
losing an equivalent amount of internal energy, U. The loss of U
causes it to cool to the "cold" temperature, Tcold. ΔS = 0.

C to D -  The surroundings do work on the gas, causing an amount of heat
energy, Qcold, to flow out of the gas to the low temperature
reservoir.  Again, the temperature does not change so U remains
constant at its new level.  ΔS = -Qcold/Tcold

D to A -  During this step, the surroundings do work on the gas, increasing
its internal energy and compressing it, causing the temperature
to rise to Thot. ΔS = 0.

The Carnot cycle is the most efficient heat engine cycle allowed by physical
laws. When the second law of thermodynamics states that not all the
supplied heat in a heat engine can be used to do work, the Carnot efficiency
sets the limiting value on the fraction of the heat which can be so used.

In order to approach the Carnot efficiency, the processes involved in the heat
engine cycle must be reversible and involve no change in entropy. This means
that the Carnot cycle is an idealization, since no real engine processes are
reversible and all real physical processes involve some increase in entropy.

Consider the adiabatic processes, Q = 0

ΔU = -PΔV

∴ ΔU + PΔV =0

(3/2)nRΔT + nRTΔV/V = 0

(3/2)dt/T + dV/V = 0

(3/2)∫dt/T + ∫dV/V = 0

Tcold       C
[(3/2)lnT]    +  [lnV] = 0
Thot        B

ln(Tcold/Thot)3/2 + ln(Vc/VB) = 0

(Tcold/Thot)3/2(VC/VB) = 1

Take the reciprocal to get:

(Thot/Tcold)3/2(VB/VC) = 1

For D to A we get:

(Thot/Tcold)3/2(VA/VD) = 1

Thus, we can say,

VB/VA = VC/VD

What about the entropy?  Consider the isothermals (ΔU = 0 so Q = W)

ΔS = Qhot/Thot + 0 + Qcol/Tcold + 0

= Whot/Thot + Wcol/Tcold

= (nRThot/Thot)∫dV/V + (nRTcold/Tcold)∫dV/V

= nR{∫dV/V +  ∫dV/V}

= nR{ln(VB/VA) + ln(VD/VC)}

= nR{ln[(VB/VA)(VD/VC)]}

= nR{ln[(VB/VA)/(VC/VD)]}

= nRln(1) from before

= 0

The efficiency, E is:

W = Work done during a cycle = Qhot - Qcold (ΔU = 0)

E = W/Qhot = (Qhot - Qcold)/Qhot

= 1 - Qcold/Qhot

The overall change in internal energy around the cycle is 0.  Therefore,
ΔU = 0 and Q = PdV

We can write from before that:

Qhot = nRThotln(VB/VA) and Qcold = -nRTcoldln(VD/VC) = nRTcoldln(VC/VD)

∴ E = 1 - nRTcoldln(VC/VD)/nRThotln(VB/VA)

= 1 -  Tcoldln(VC/VD)/Thotln(VB/VA)

But from before we have shown that VB/VA = VC/VD.  Thus,

= 1 - Tcold/Thot

If the efficiency is less than 100% we get:

W/Qhot ≤ (1 - Tcold/Thot)

∴ W ≤ Qhot(1 - Tcold/Thot)

(Qhot - Qcold) ≤ Qhot(1 - Tcold/Thot)

Qcold ≥ QhotTcold/Thot

Qcold/Tcold ≥ Qhot/Thot

Scold ≥ Shot ... The 2nd Law of Thermodynamics

This implies that the entropy at the end of the process is greater
than that at the beginning.  The more efficient the process, the less
the increase in entropy will be.  In other words, entropy provides a
measure of the amount of thermal energy that cannot be used to do
work.  The change in entropy will only be 0 for a reversible process
(100% efficiency).  The connection between reversibility and efficiency
can be thought of as follows:

Consider an upright cylinder and piston in a vacuum.

|  W  |
|=====|
|     |
|     |
-----

The gas in the cylinder is compressed by a weight, W.  If W is suddenly
removed, the molecules in the gas will not instantaneously rearrange
themselves and there will be a period of non-equilibrium in P, V and T.
If, on the other hand, W is removed slowly in very small increments,
we can consider the system to be in constant equilibrium. Now, if there
is friction between the piston and the cylinder, any movement of the
piston will generate heat.  Removing increments of W and adding
increments of W to return to the original state both result in the
generation of heat.  Thus, returning both the system and its surroundings
to their original state simultaneously cannot be achieved.  In summary, a
reversible process has to take place slowly and be frictionless.

An implication of the fact that entropy can never decrease is that at the
time of the 'Big Bang', the universe had low entropy and a high degree
of order.  Since then, however, the entropy has increased (and continues
to increase) with time.

It is worthwhile noting that systems that are not isolated may decrease
in entropy, provided they increase the entropy of their environment by
at least that same amount.  An example is the freezing of water.  The
entropy of the water decreases as it freezes, but the heat extracted
increases the entropy of the environment.

The Heat Pump
-------------

The heat engine cycle described can be run in the opposite direction to
become the refrigeration cycle. The cycle remains exactly the same
except that the directions of any heat and work flows are reversed. Heat
is absorbed from the low temperature reservoir and dumped into the high
temperature reservoir with work input required to accomplish all this. The
P-V diagram is the same except that the directions of the processes are
reversed.

In the case of an a/c system, the cold reservoir is the inside of the
building and the outdoors is the hot reservoir.  In the case of a heat
pump, the cold reservoir is the outdoors and the inside of the building
is the cold reservoir.  In both cases the work input is the electrical
power.

- The compressor compresses the refrigerant and raises its pressure
and temperature.  Latent heat is also released as the gas condenses
to a liquid (the boiling point is raised).  This corresponds to CB
of the Carnot cycle.
- While passing through the condenser, the heated refrigerant yields
part of its heat to the hot surroundings with a lower temperature.
This corresponds to BA of the Carnot cycle.
- The expansion phase reduces the pressure of the fluid, and consequently
its temperature. Latent heat is also absorbed as the liquid evaporates
to a gas (the boling point is lowered). This corresponds to AD of the
Carnot cycle.
- When it passes through the evaporator, as its temperature is lower
than the cold surroundings, the fluid picks up heat and the cycle
repeats. This corresponds to DC of the Carnot cycle.

Clausius Statement of the 2nd Law
---------------------------------

|   Thot    |
-----------
|
Q
|
-----------
|  Tcold    |

Q flowing from hot to cold:

ΔS = -Q/Thot + Q/Tcold

Since Thot > Tcold  ΔS > 0

Q flowing from cold to hot:

ΔS < 0 ... not allowed.

Spontaneous Action
------------------

Consider a gas in a container with a partition.  After the partition
is removed we get:

--------------           ------------
| gas  |  vac  |         |     gas    |
|      |       |         |            |
--------------           ------------

We always get the situation of left proceeding to right but never the
other way around in which the gas collects in the left side of the
container.  Why is this?

For the gas expanding we get:

U = Q - PdV

or

Q = U + PdV

Now, ΔS ≥ Q/T  ∴ Q ≤ TΔS.  Thus,

U + PdV ≤ TΔS

or

U + PdV - TΔS ≤ 0

This formula is satisfied for the left to right process but can never be
satisfied in the reverse direction.

----------------------------

H = U + PV

∴ ΔH = ΔU + Δ(PV)

= Q - W + Δ(PV)

= Q - PdV + Δ(PV)

For constant P (isobaric) Δ(PV) = PΔV

∴ ΔH = Qp ... the heat added at constant P.

Enthalpy is useful in chemistry because most reactions occur at constant P ```