Maxwell's Relations in Thermodynamics ✍️
Maxwell's Relations are four essential connections in thermodynamics developed by the Scottish physicist James Clerk Maxwell in the 19th century. To understand their significance, you must first recognize the problem they address. In thermodynamics, scientists study four key properties of any physical system: volume, pressure, absolute temperature, and entropy. Volume refers to the space a substance occupies. Pressure is the force it exerts outward on its surroundings. Absolute temperature measures heat, starting from the coldest point in the universe, where all molecular motion stops. These three properties are straightforward and can be measured easily with standard instruments in any lab or engineering setting.
Entropy, however, is different. It measures disorder and randomness—specifically, how many different ways the microscopic particles of a system can be arranged while still producing the same overall observable state. A gas compressed into a small space has low entropy because its molecules have limited positions. In contrast, the same gas allowed to expand into a large room has high entropy because its molecules can be arranged in numerous ways. Entropy impacts every natural process in the universe; it explains why ice melts but never spontaneously reforms, why smoke spreads but does not gather back, and why time only moves forward. The Second Law of Thermodynamics states that entropy always increases in any natural process, making it arguably the most crucial concept in physics. Despite its importance, entropy cannot be measured by any existing instrument. No sensor, gauge, or meter can directly measure entropy. This invisibility is the fundamental problem that Maxwell's Relations address.
Maxwell's solution was elegant. He discovered four precise mathematical bridges connecting entropy behavior to the behavior of temperature, pressure, and volume, all of which are easy to measure. These bridges exist because thermodynamic energy depends only on the current state of a system, not on how it reached that state. Think of altitude on a mountain: your current altitude relies solely on your location, not on whether you took a steep path or a gentle winding trail. This principle allows a beautiful mathematical symmetry to emerge, and Maxwell's four relations stem directly from that symmetry, each arising from a different form of thermodynamic energy.
The first relation shows that how a substance expands when heated at constant pressure connects directly to how its entropy changes when compressed at constant temperature but in the opposite direction. This makes sense. A substance that easily expands when heated shows that its molecules prefer to spread out and increase their disorder. Compressing that substance forces the molecules into fewer arrangements, reducing entropy. These two tendencies are opposite expressions of the same molecular behavior. The practical power is clear: instead of measuring the elusive quantity of how entropy responds to pressure, you simply measure how volume responds to temperature, something any lab can do routinely. The relation gives you the entropy answer automatically.
The second relation connects how volume and entropy relate at constant pressure with how temperature reacts to changes in pressure when entropy remains constant. The latter describes processes where no heat enters or leaves the system known as adiabatic processes and these occur frequently in the real world. When air is compressed quickly, heat cannot escape, leading to a dramatic rise in temperature. This is precisely how diesel engines operate; there is no spark plug because the compression alone raises the temperature enough to ignite the fuel. The opposite happens when gas expands rapidly without heat exchange temperature drops, which is the principle behind refrigerators and air conditioners.
CPU vs GPU vs TPU vs NPU vs LPU, explained visually:
5 hardware architectures power AI today.
Each one makes a fundamentally different tradeoff between flexibility, parallelism, and memory access.
> CPU
It is built for general-purpose computing. A few powerful cores handle complex logic, branching, and system-level tasks.
It has deep cache hierarchies and off-chip main memory (DRAM). It's great for operating systems, databases, and decision-heavy code, but not that great for repetitive math like matrix multiplications.
> GPU
Instead of a few powerful cores, GPUs spread work across thousands of smaller cores that all execute the same instruction on different data.
This is why GPUs dominate AI training. The parallelism maps directly to the kind of math neural networks need.
> TPU
They go one step further with specialization.
The core compute unit is a grid of multiply-accumulate (MAC) units where data flows through in a wave pattern.
Weights enter from one side, activations from the other, and partial results propagate without going back to memory each time.
The entire execution is compiler-controlled, not hardware-scheduled. Google designed TPUs specifically for neural network workloads.
> NPU
This is an edge-optimized variant.
The architecture is built around a Neural Compute Engine packed with MAC arrays and on-chip SRAM, but instead of high-bandwidth memory (HBM), NPUs use low-power system memory.
The design goal is to run inference at single-digit watt power budgets, like smartphones, wearables, and IoT devices.
Apple Neural Engine and Intel's NPU follow this pattern.
> LPU (Language Processing Unit)
This is the newest entrant, by Groq.
The architecture removes off-chip memory from the critical path entirely. All weight storage lives in on-chip SRAM.
Execution is fully deterministic and compiler-scheduled, which means zero cache misses and zero runtime scheduling overhead.
The tradeoff is that it provides limited memory per chip, which means you need hundreds of chips linked together to serve a single large model. But the latency advantage is real.
AI compute has evolved from general-purpose flexibility (CPU) to extreme specialization (LPU). Each step trades some level of generality for efficiency.
The visual below maps the internal architecture of all five side by side.
Notice the thread connecting all five. Every generation exists to move data less, because the math was never the hard part. Feeding the math units fast enough is.
The same battle plays out one layer up in software. During LLM inference, a single GPU produces terabytes of KV cache per day, and nearly all of it gets thrown away and recomputed, which is a big reason agent workloads cost what they do.
I wrote a full breakdown of how a disaggregated caching layer fixes this, with up to 14x faster time-to-first-token. The article is quoted below.
You should also check the @lmcache GitHub repo: https://t.co/TXlaLLu04a
(don't forget to star 🌟)
👉 Over to you: Which of these 5 have you actually worked with or deployed on?
Deriving ∫₀^∞ e^{-x²} dx begins by forming its square as the double integral ¼∬e^{-(x²+y²)} dx dy over the full plane.
Polar coordinates convert the integrand to e^{-r²} with area element r dr dθ, θ from 0 to 2π and r from 0 to ∞. The substitution u = r² (du = 2r dr) turns the radial integral into ½∫₀^∞ e^{-u} du, recognized as ½ via the Gamma function at Γ(1) = 1. Angular integration then yields I² = π/4, solving directly for I = √π/2.
This exact normalization constant for the standard normal distribution enables precise probability calculations for measurement deviations in physics experiments.
integrals are often introduced as “finding the area under a curve.” that’s only the beginning. an integral is really a way of accumulating something across a domain.
change the domain, and the meaning of the integral changes. integrate along a path and you measure accumulation over a curve. integrate across a surface and you measure flux. integrate over a volume and you measure the total quantity inside a region. the notation changes because the geometry changes, not because mathematicians wanted more symbols.
this is why you see so many different integrals in physics and engineering. line integrals describe work done along a path. surface integrals measure how much of a field passes through a surface. double and triple integrals compute mass, energy, probability, charge, and countless other quantities distributed through space. they’re all built on the same underlying idea: break something into infinitely small pieces, add them together, and recover the whole.
the beautiful part is that all of these are the same mathematical operation viewed through different geometries. once you stop memorizing the symbols and start asking, “what am i accumulating, and over what object?”, the entire family of integrals collapses into one intuitive idea. that’s what mathematics keeps doing. it takes many seemingly different problems and reveals that they’re all instances of the same pattern.
Three fundamental integrals stand out for their elegant closed forms despite spanning infinite domains.
- The Gaussian ∫_{-∞}^{∞} e^{-x²} dx equals √π.
- The Lorentzian ∫_{-∞}^{∞} 1/(x² + 1) dx totals π.
- The sinc function ∫_{-∞}^{∞} sin(x)/x dx also equals π.
These identities, established through techniques such as contour integration, link analysis across mathematics.
Engineers apply the sinc integral within the sampling theorem to perfectly reconstruct continuous-time signals from discrete samples in digital communications systems.
In 1926, Erwin Schrödinger introduced the equation that became the dynamical law of non-relativistic quantum mechanics:
iℏ ∂ψ/∂t = [−ℏ²/(2m)∇² + V]ψ
It does not describe a particle following one definite path. It describes how the wavefunction evolves and therefore how the probabilities of possible experimental outcomes change with time.
Georg Friedrich Bernhard Riemann pioneered the use of complex analysis in number theory with his zeta function.
The function is defined by the series ζ(s) = ∑_{n=1}^∞ 1/n^s. The functional equation ζ(s) = 2^s π^{s-1} sin(πs/2) Γ(1-s) ζ(1-s) relates its values at s and 1-s through the gamma function and sine term.
This mathematics is used to analyze prime number distributions that enable secure key generation in modern encryption systems.
Visualization of the building blocks of matter in a dynamic 3D spiral.
Elements are arranged by increasing atomic number in layered, helical paths, with central focus on lighter atoms such as C, N, O, and F, expanding outward through transition metals, lanthanides, and superheavy elements. Color zones highlight blocks and periodic trends in a continuous structure.
James Clerk Maxwell's four equations form the foundation of classical electromagnetism, unifying electric and magnetic fields:
∇ · D = ρ, ∇ · B = 0, ∇ × E = −∂B/∂t, ∇ × H = J + ∂D/∂t.
Diagrams detail the Ampère-Maxwell law, the lack of magnetic monopoles, Gauss's law, and Faraday's law in both differential and integral forms.
These equations are used in the design of electric generators, motors, and wireless communication systems.