1. Introduction — The Two Postulates
Einstein's 1905 Special Theory of Relativity rests on just two principles:
These force us to abandon absolute time. Space and time mix into spacetime.
2. Special Relativity Mathematics
Lorentz Transformation
For frames $S$ and $S'$ moving at relative speed $v$ along $x$, assume linear transformations:
Apply Postulate 2: a light pulse $x = ct$ must satisfy $x' = ct'$.
Full derivation (click)
- Set $ct' = \gamma(ct - vt) = \gamma(c-v)t$ and $x'= \gamma(ct - vt)$ from above gives consistency.
- Also require inverse: $x = \gamma(x' + vt')$. Substitute $x'$ and $t'$.
- Solving yields $k = v/c^2$ and $\gamma^2(1 - v^2/c^2)=1$.
$t' = \gamma\left(t - \dfrac{vx}{c^2}\right)$
$y' = y,\; z' = z$
Time Dilation — Light Clock Proof
A photon bounces between mirrors distance $L$ apart. Proper time (in clock's rest frame): $\Delta t_0 = 2L/c$.
In lab frame moving at $v$, the photon traces a triangle. By Pythagoras: $(c\Delta t/2)^2 = L^2 + (v\Delta t/2)^2$ →
Moving clocks run slower.
Length Contraction
Measure a rod of proper length $L_0$ in $S'$ by timing its ends at simultaneous $t$ in $S$. Using $x' = \gamma(x - vt)$:
Relativistic Velocity Addition
Differentiate Lorentz transforms: $u' = dx'/dt'$:
Minkowski Spacetime Interval
Define invariant interval (signature $-,+,+,+$):
Invariance proof: Substitute Lorentz: $c\Delta t' = \gamma(c\Delta t - \beta \Delta x)$, $\Delta x' = \gamma(\Delta x - \beta c\Delta t)$. Then $-c^2\Delta t'^2 + \Delta x'^2 = \gamma^2[-(c\Delta t - \beta \Delta x)^2 + (\Delta x - \beta c\Delta t)^2] = -c^2\Delta t^2 + \Delta x^2$. Same for $y,z$.
Energy–Momentum
Relativistic momentum: $\mathbf{p} = \gamma m \mathbf{v}$. Work-energy: $dE = \mathbf{F}\cdot d\mathbf{x} = v\,dp$.
Derivation of $E = \gamma mc^2$
$E = \int v\,dp = \int v\,d(\gamma m v) = mc^2\int \beta d(\gamma\beta)$. With $\gamma = (1-\beta^2)^{-1/2}$, integrate: $E = \gamma mc^2 + \text{const}$. Choose $E(v=0)=mc^2$.
Eliminating $v$:
For massless particles: $E = pc$.
3. Interactive SR Demos
Time Dilation
Left: proper light clock. Right: geometry shows longer diagonal path $c\Delta t/2 = \sqrt{L^2 + (v\Delta t/2)^2}$.
Length Contraction — Ladder Paradox
$L = L_0/\gamma = $8.00 m (barn = 10 m)
Minkowski Diagram & Light Cone
Click diagram to place event. Yellow: light cone. Blue: $ct'$ axis (worldline, $x=vt$). Green: $x'$ axis.
| t (units) | x | |
|---|---|---|
| Lab S | - | - |
| Moving S' | - | - |
$s^2 = $- (invariant)
Velocity Addition Calculator
Relativistic: $w = (u+v)/(1+uv) =$ 0.889 c
Classical: $u+v =$ 1.20 c (impossible)
4. General Relativity Mathematics
Equivalence Principle
Locally, gravity is indistinguishable from acceleration. A freely falling observer experiences inertial motion.
Curved Spacetime & Metric
Interval generalizes: $ds^2 = g_{\mu\nu}dx^\mu dx^\nu$ where $g_{\mu\nu}$ is the metric tensor (10 independent functions). Flat Minkowski: $g_{\mu\nu} = \text{diag}(-1,1,1,1)$.
Geodesic Equation
Free particles follow geodesics:
Einstein Field Equations
| Term | Meaning |
|---|---|
| $G_{\mu\nu}=R_{\mu\nu}-\tfrac12 R g_{\mu\nu}$ | Einstein tensor — spacetime curvature |
| $\Lambda$ | Cosmological constant |
| $T_{\mu\nu}$ | Stress-energy of matter/energy |
| $8\pi G/c^4$ | Coupling constant $\approx 2.07\times10^{-43}$ |
Schwarzschild Solution & Gravitational Time Dilation
For spherical mass $M$, vacuum metric ($r > R_s$):
Proper time at rest: $d\tau = \sqrt{1-r_s/r}\, dt$
Clocks deeper in gravity (smaller $r$) run slower.
5. Interactive GR Demos
Gravitational Time Dilation: Earth vs GPS
| Effect | Rate difference | Per day |
|---|---|---|
| GR (gravity) | - | - |
| SR (speed) | - | - |
| Net (GPS gains) | - | - |
GPS satellites must correct ~+38.6 µs/day, else positions drift ~10 km/day.
Light Bending
Deflection: $\theta \approx 4GM/(c^2 b) =$ 1.75" (Einstein 1919: 1.75" at Sun's limb)
Orbit Precession
Mercury's real GR precession: 43 arcsec/century. Animation exaggerated.
6. Proofs — Full Derivations
Lorentz Transformation (step-by-step)
1. Linearity from homogeneity: $x' = A x + B t$, $t' = C x + D t$.
2. Origin of $S'$: $x'=0 \Rightarrow x=vt \Rightarrow B = -Av$.
3. Inverse by relativity: replace $v\to -v$: $x = A(x' + vt')$.
4. Light invariance $x=ct \Leftrightarrow x'=ct'$ gives $A = D$ and $C = -Av/c^2$.
5. Composition yields $A^2 = 1/(1-v^2/c^2) = \gamma^2$.
$E = mc^2$ from Work-Energy
$p = \gamma m v$, $E = \int v dp = m\int_0^v v d(\gamma v)$. Using $d\gamma = \gamma^3 v dv/c^2$:
$E = mc^2(\gamma -1) + E_0$. Setting $E_0 = mc^2$ gives $E = \gamma mc^2$.
Expand: $\gamma \approx 1 + v^2/2c^2$ → $E \approx mc^2 + \tfrac12 mv^2$.
7. GNU Octave Examples
1. Gamma and time dilation
% gamma.m
c = 299792458; v = 0.9*c;
gamma = 1/sqrt(1-(v/c)^2)
dt0 = 1; dt = gamma*dt0 % moving clock ticks
2. Lorentz transform
function [xp,tp] = lorentz(x,t,v)
c=299792458; beta=v/c; g=1/sqrt(1-beta^2);
xp = g*(x - v*t); tp = g*(t - v*x/c^2);
end
[xp,tp] = lorentz(1e6, 0.01, 0.8*299792458)
3. Minkowski diagram
v = 0.6*c; beta=v/c; g=1/sqrt(1-beta^2);
t = linspace(-1,1,200); x=0*t;
xp = g*(x - v*t); tp = g*(t - v*x/c^2);
plot(t,x,'k', tp,xp,'b'); axis equal; grid on
xlabel('ct'); ylabel('x'); legend('S','S''')
4. Relativistic energy
m = 9.11e-31; v=0.99*c; g=1/sqrt(1-(v/c)^2);
E = g*m*c^2; p = g*m*v;
E_check = sqrt((p*c)^2 + (m*c^2)^2)
5. Schwarzschild time dilation
G=6.6743e-11; M=5.972e24; c=299792458;
r = 6371e3 + 20200e3; rs = 2*G*M/c^2;
factor = sqrt(1 - rs/r) % GPS clock rate
6. Geodesic (Newtonian + GR correction)
% simple precessing orbit
G=6.6743e-11; M=1.989e30; c=299792458;
a=5.79e10; e=0.206; k=3*G*M/(c^2*a*(1-e^2));
th=linspace(0,4*pi,1000); r=a*(1-e^2)./(1+e*cos(th - k*th));
polar(th,r)