I'm interested in the class number formula derived from the Dedekind zeta function, but I have no idea how to derive it. From what I've read, turning the Dedekind zeta function into a normal Dirichlet series and analyzing the coefficients can lead to the formula. I know that for a field K (I'm interested in imaginary quadratic fields, so assume K=$\mathbb{Q}(\sqrt{-n}), n \not\equiv 3 mod(4)$), $\zeta _{K}(s)=\sum_{a\in \mathcal{O}_{K}}\frac{1}{N(a)^{s}}$. If my intuition is correct this can be rewritten as $\zeta _{K}(s)= \sum_{m=1}^{\infty}\frac{c_{m}}{m^{s}}$ where $c_{m}=| \{ a : N(a)=m, a\in \mathcal{O}_{K} \}|$, which basically means the number of ideals that have norm $m$ in $\mathcal{O}_{K}$. Now my problem is approximating $c_{m}$. Heres what I think:
So if we look at $C_{m}=\sum_{n=1}^{m}c_{n}$, this equates to finding the amount of lattice points of $\mathcal{O}_{K}$ inside a circle of radius $\sqrt{m}$. Since a circles area grows at the same rate as a square, the ratio of the area of the circle and the "fundamental region" should provide a decent estimate, especially for large m $\frac{\pi m}{\sqrt{|n|}}$. However, in the context of this problem, since $(a)=(ua) \; u\in\mathcal{O}_{K}^{ \times}$ we are "overcounting" these points so if $w=\mathcal{O}_{K}^{ \times}$ the original estimate should be fixed to $\frac{\pi m}{w\sqrt{|n|}}$. So what (I think at least) I have is $\sum_{n=1}^{m}c_{n}$ is reasonably approximated by $\frac{\pi m}{w\sqrt{|n|}}$. From here I have no idea how to continue.
Now I know I'm missing the most fundamental part of the entire thing ($h$) but I have no idea how the ideal class group would play into this, to me it makes no sense. I think this approach should work but I just have no idea how to continue. If someone could explain how the ideal class group affects counting these points inside a circle or how to finish the proof of the class number formula, I'd really appreciate it. I apologize if something is being grossly misunderstood, as a junior in high school using only online resources trying to understand problems like this is terribly difficult. Thanks for any help.
For $K=\Bbb{Q}(\sqrt{-d})$ imaginary quadratic field the class number formula follows from
$$\zeta_K(s) = \sum_{c \in C_K} \sum_{I \subset O_K,I\sim c} N(I)^{-s}=\frac{1}{|O_K^\times|} \sum_{c \in C_K} \sum_{a \in I_{c^{-1}}, a \ne 0} (\frac{N(a I_{c})}{N(I_cI_{c^{-1}})})^{-s}$$ where $C_K$ is the ideal class group, $I \subset O_K $are the ideals of $O_K$, $I_c$ is an ideal in the class of $c$, so $I_cI_{c^{-1}}$ is a principal ideal.
Then
$$|O_K^\times|(2\pi)^{-s}\Gamma(s) \zeta_K(s) = \int_0^\infty x^{s-1}(f(x)-|C_K|)dx$$ where
$$f(x) = \sum_{c \in C_K} \sum_{a \in I_c, a \ne 0} e^{-2\pi |a|^2 x/N(I_{c})}= \sum_{c \in C_K} \sum_{n,m} e^{- 2\pi x |u_cm+v_cn|^2}$$
and $I_c = N(I_c)(u_c \Bbb{Z}+v_c \Bbb{Z})$ is a lattice in $O_K$ and $u_c \Bbb{Z}+v_c \Bbb{Z}$ is a lattice in $K$ whose area of fundamental parallelogram doesn't depend on $c$ thus is of area $D/4$, $D=Disc O_K$.
From there it suffices to show the asymptotic of $\sum_{n,m} e^{- 2\pi x |u_cm+v_cn|^2}$ as $x \to 0$
depends only on the area of the fundamental parallelogram of $u_c \Bbb{Z}+v_c \Bbb{Z}$ so that $\sum_{n,m} e^{- 2\pi x |u_cm+v_cn|^2}\sim x^{-1}D^{-1/2}$, a claim which follows from the asymptotic $\sum_n e^{-\pi n^2 x} \sim x^{-1/2}$.
On the other hand that $f(x) \sim |C_K|D^{-1/2} x^{-1}$ implies $|O_K|^\times(2\pi)^{-s}\Gamma(s) \zeta_K(s) \sim \frac{|C_K|2^{-1}}{s-1}$ as $s \to 1$ ie. from $\zeta_K(s) = \zeta(s) L(s,\chi)$ where $\chi(p) = (\frac{d}{p}) = (\frac{p}{D})$ then $|C_K|D^{-1/2} = |O_K^\times|(2\pi)^{-1}L(1,\chi)$.