Hello,

I've been working deriving the orthogonality relation for quadratic Dirichlet characters $\chi_d(n)$ (or real primitive characters). The statement I'm trying to prove is

$$\lim_{X \rightarrow \infty} \frac{1}{D} \sum_{0 < |d| \leq X} \chi_d(n)= \begin{cases} \prod_{p|n} \left(1 + \frac{1}{p}\right)^{-1} \quad &\text{if $m$ is a perfect square,} \newline 0 \quad &\text{otherwise,} \end{cases}$$ where the sum ranges over fundamental discriminants $d$ and $D$ is the number of terms appearing in the sum.

You could recast this as

$$\lim_{X \rightarrow \infty} \frac{1}{D} \sum_{0 < |d| \leq X} \chi_d(n)\chi_d(m)= \begin{cases} \prod_{p|nm} \left(1 + \frac{1}{p}\right)^{-1} \quad &\text{if $mn$ is a perfect square,} \newline 0 \quad &\text{otherwise,} \end{cases}$$

which has the standard form of an orthogonality relation for characters. In the first case, $\chi_d(n) = 1$ unless $\gcd(d,n) > 1$, so essentially i'm trying to count fundamental discriminants. But this still seems a bit tricky to me.

My approach is to try and count fundamental discriminants by using the generating function for squarefree numbers, i.e. $$\frac{\zeta(s)}{\zeta(2s)} = \sum_{n=1}^\infty \frac{|\mu(n)|}{n^s}.$$ I know that Jutila proves this in his paper On the Mean Values of $L(1/2,\chi_d)$ for Real Characters, but I would like to prove this lemma equation using analytic methods. Can anyone help me.