"It is evident that the primes are randomly distributed but, unfortunately, we don't know what 'random' means."

P(n)≡∣{p prime :2≤p≤n}∣∼nlog⁡n P(n) \equiv |\{ p \text{ prime } : 2 \leq p \leq n \}| \sim \frac{n}{\log n}
f((x+dx)2)==f(x2)−killing of from primes in x=f(x2)−∑p∈[x,x+dx][Prob(p prime)]⋅f(x2)/p=f(x2)−∑p∈[x,x+dx][f(p)]⋅f(x2)/p=(p∼x in [x,x+dx]):=f(x2)−length([x,x+dx])⋅[f(x)]⋅f(x2)/p=f(x2)−(dx)f(x)⋅f(x2)/xf((x+dx)2)=f(x2)−f(x2)f(x)dx/xf((x+dx)2)−f(x2)=−f(x2)f(x)dxx \begin{aligned} &f((x+dx)^2) = \\ &= f(x^2) - \text{killing of from primes in $x$} \\ &= f(x^2) - \sum_{p \in [x, x+dx]} [\texttt{Prob}(p \text{ prime})] \cdot f(x^2)/p \\ &= f(x^2) - \sum_{p \in [x, x+dx]} [f(p)] \cdot f(x^2)/p \\ &= \text{($p \sim x$ in $[x, x+dx]$):} \\ &= f(x^2) - \texttt{length}([x,x+dx]) \cdot [f(x)] \cdot f(x^2)/p \\ &= f(x^2) - (dx) f(x) \cdot f(x^2)/x \\ &f((x+dx)^2) = f(x^2) - f(x^2)f(x)dx/x \\ &f((x+dx)^2) - f(x^2) = -\frac{f(x^2)f(x)dx}{x} \end{aligned}

From this, we now estimate f′(x2)f'(x^2) as:

f((x+dx)2)−f(x2)=−f(x2)f(x)dxxf((x+dx)2)−f(x2)dx=−f(x2)f(x)xf(x2+2dx+dx2)−f(x2)dx=−f(x2)f(x)xIgnore O(dx2):f(x2+2dx)−f(x2)dx=−f(x2)f(x)xf(x2+2dx)−f(x2)dx⋅2x=−f(x2)f(x)x⋅2xf(x2+2dx)−f(x2)2xdx=−f(x2)f(x)2x2Let u=x2f(u+du)−f(u)du=−f(u)f(u)2uf′(u)=−f(u)f(u)2u \begin{aligned} &f((x+dx)^2) - f(x^2) = -\frac{f(x^2)f(x)dx}{x} \\ &\frac{f((x+dx)^2) - f(x^2)}{dx} = -\frac{f(x^2)f(x)}{x} \\ &\frac{f(x^2 + 2dx + dx^2) - f(x^2)}{dx} = -\frac{f(x^2)f(x)}{x} \\ &\text{Ignore $O(dx^2)$:} \\ &\frac{f(x^2 + 2dx) - f(x^2)}{dx} = -\frac{f(x^2)f(x)}{x} \\ &\frac{f(x^2 + 2dx) - f(x^2)}{dx \cdot 2x} = -\frac{f(x^2)f(x)}{x\cdot 2x} \\ &\frac{f(x^2 + 2dx) - f(x^2)}{2xdx} = -\frac{f(x^2)f(x)}{2x^2} \\ & \text{Let $u = x^2$} \\ &\frac{f(u + du) - f(u)}{du} = -\frac{f(u)f(\sqrt u)}{2u} \\ &f'(u) = -\frac{f(u)f(\sqrt u )}{2u} \end{aligned}

§ An immediate consequence

Sice uu is large, we approximate u∼uu \sim \sqrt{u} to get:

f′(u)=−f(u)f(u)2uf′(u)∼−f2(u)2udfdu∼−f2(u)udff2∼−duu∫dff2∼−∫duu−1f(u)∼−ln⁡(u)1f(u)∼ln⁡(u)f(u)∼1ln⁡(u) \begin{aligned} &f'(u) = -\frac{f(u)f(\sqrt u )}{2u} \\ &f'(u) \sim -\frac{f^2(u)}{2u} \\ &\frac{df}{du} \sim -\frac{f^2(u)}{u} \\ &\frac{df}{f^2} \sim -\frac{du}{u} \\ &\int \frac{df}{f^2} \sim - \int \frac{du}{u} \\ &-\frac{1}{f(u)} \sim -\ln(u) \\ &\frac{1}{f(u)} \sim \ln(u) \\ &f(u) \sim \frac{1}{\ln(u)} \end{aligned}

So the density of primes around f(u)f(u) is 1/ln⁡(u)1/\ln(u). So upto nn, the number of primes is ∫0nf(x)dx\int_0^n f(x) dx which is ∫0n1/ln(x)dx\int_0^n 1/ln(x) dx, bounded by n/ln(n)n/ln(n). This "proves" the prime number theorem.