Task B-2.6. Determine all quadratic equations of the form $x^{2}+p x+q=0$ if for the coefficients $p, q \in \mathbb{R}$ it holds that $|p-q|=2012$, and the sum of the squares of its solutions is $2012^{2}$.
Another solution. From $x_{1}^{2}+x_{2}^{2}=2012^{2}$ and Vieta's formulas, we have

\[
\begin{aligned}
\left(x_{1}+x_{2}\right)^{2}-2 x_{1} x_{2} & =2012^{2} \\
p^{2}-2 q & =2012^{2}
\end{aligned}
\]

By squaring the equation $|p-q|=2012$, we get

\[
p^{2}-2 p q+q^{2}=2012^{2}
\]

Subtracting the equations $p^{2}-2 q=2012^{2}$ and $p^{2}-2 p q+q^{2}=2012^{2}$, we obtain $q^{2}-2 p q+2 q=0$, or

\[
q(q-2 p+2)=0
\]

From this, we have $q=0$ or $q-2 p+2=0$.

In the case $q=0$, from $\left.{ }^{*}\right)$ we get $p= \pm 2012$.

In the second case $q=2 p-2$, from $(*)$ we get

\[
p^{2}-4 p+4=2012^{2}, \quad(p-2)^{2}=2012^{2}
\]

The solutions are $p_{1}=2014, q_{1}=4026$ and $p_{2}=-2010, q_{2}=-4022$.

The quadratic equations are

\[
\begin{aligned}
x^{2}+2012 x & =0 \\
x^{2}-2012 x & =0 \\
x^{2}+2014 x+4026 & =0 \\
x^{2}-2010 x-4022 & =0
\end{aligned}
\]