Let $D$ be a square-free positive integer which is the fundamental discriminant of a real quadratic field. Consider the following quadratic form $$Q\_{D}(x,y)=x^2+Dy^2.$$ 
 My questions are :


* What is the density of the set $\{\ell \hbox{ prime}| Q\_{D}(x,y)=\ell\quad\hbox{has a solution}\}$ if it is knowen ?
* How can we use modular forms to answer such a question ? ( how to use theta series for example and distribution of eigenvlues of newforms ? )
* Thanks for any comments !



Diophantine equations and modular forms
In general, modular forms are very useful for understanding the number and distribution of representations by an integral quadratic form in three or more variables, but for binary quadratic forms these kinds of problems are usually treated by more classical algebraic number theory.


I recommend you to study Cox's book "Primes of the form $x^2+ny^2$" which addresses your question. In particular, Theorem 9.2 tells us that a prime $\ell\nmid 2D$ is represented by $Q\_D(x,y)$ if and only if $\ell$ splits completely in the ring class field $L$ of the order $\mathbb{Z}[\sqrt{-D}]$. This implies, e.g. by the Chebotarev density theorem, that the relative density of these primes is the reciprocal of $[L:\mathbb{Q}]=2h(-4D)$.


