SPECIAL RELATIVITY 1905GENERAL RELATIVITY 1915

Einstein's Relativity: Physics, Mathematics, and Proofs

A complete, interactive guide to Special and General Relativity — from the two postulates to the Einstein field equations, with full derivations, visualizations, and working code.

1. Introduction — The Two Postulates

Einstein's 1905 Special Theory of Relativity rests on just two principles:

Postulate 1 — Principle of Relativity: The laws of physics are identical in all inertial (non-accelerating) frames. No experiment can distinguish absolute rest.
Postulate 2 — Constancy of Light: The speed of light in vacuum, $c = 299,792,458 \,\text{m/s}$, is the same for all observers, independent of the motion of source or observer.

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:

$x' = \gamma (x - vt), \quad t' = \gamma (t - kx)$

Apply Postulate 2: a light pulse $x = ct$ must satisfy $x' = ct'$.

Full derivation (click)
  1. Set $ct' = \gamma(ct - vt) = \gamma(c-v)t$ and $x'= \gamma(ct - vt)$ from above gives consistency.
  2. Also require inverse: $x = \gamma(x' + vt')$. Substitute $x'$ and $t'$.
  3. Solving yields $k = v/c^2$ and $\gamma^2(1 - v^2/c^2)=1$.
$\displaystyle \gamma = \frac{1}{\sqrt{1-\beta^2}},\quad \beta = v/c$
$x' = \gamma(x - vt)$
$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$ →

$\Delta t = \gamma \Delta t_0 = \frac{\Delta t_0}{\sqrt{1-v^2/c^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)$:

$L = L_0/\gamma = L_0\sqrt{1-v^2/c^2}$

Relativistic Velocity Addition

Differentiate Lorentz transforms: $u' = dx'/dt'$:

$u' = \frac{u - v}{1 - uv/c^2} \quad\text{(collinear)}\,$

Minkowski Spacetime Interval

Define invariant interval (signature $-,+,+,+$):

$s^2 = -c^2\Delta t^2 + \Delta x^2 + \Delta y^2 + \Delta z^2$

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$.

$E = \gamma mc^2, \quad \mathbf{p} = \gamma m\mathbf{v}$

Eliminating $v$:

$E^2 = (pc)^2 + (mc^2)^2$

For massless particles: $E = pc$.

3. Interactive SR Demos

Time Dilation

0.800
γ = 1.667
Stationary: 0.00 s
Moving: 0.00 s

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

0.60

$L = L_0/\gamma = $8.00 m (barn = 10 m)

Minkowski Diagram & Light Cone

0.40

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

0.70
0.50

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:

$\dfrac{d^2x^\mu}{d\tau^2} + \Gamma^\mu_{\alpha\beta}\dfrac{dx^\alpha}{d\tau}\dfrac{dx^\beta}{d\tau}=0$, where $\Gamma^\mu_{\alpha\beta} = \tfrac12 g^{\mu\sigma}(\partial_\alpha g_{\sigma\beta}+\partial_\beta g_{\sigma\alpha}-\partial_\sigma g_{\alpha\beta})$

Einstein Field Equations

$G_{\mu\nu} + \Lambda g_{\mu\nu} = \dfrac{8\pi G}{c^4} T_{\mu\nu}$
TermMeaning
$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$):

$ds^2 = -\left(1-\frac{r_s}{r}\right)c^2dt^2 + \left(1-\frac{r_s}{r}\right)^{-1}dr^2 + r^2 d\Omega^2$, $r_s = 2GM/c^2$

Proper time at rest: $d\tau = \sqrt{1-r_s/r}\, dt$

$\Delta t_{\text{far}} = \dfrac{\Delta \tau}{\sqrt{1 - 2GM/(rc^2)}}$

Clocks deeper in gravity (smaller $r$) run slower.

5. Interactive GR Demos

Gravitational Time Dilation: Earth vs GPS

20200 km
EffectRate differencePer day
GR (gravity)--
SR (speed)--
Net (GPS gains)--

GPS satellites must correct ~+38.6 µs/day, else positions drift ~10 km/day.

Light Bending

1.0
1.0

Deflection: $\theta \approx 4GM/(c^2 b) =$ 1.75" (Einstein 1919: 1.75" at Sun's limb)

Orbit Precession

1.5

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)