2. Each of the two distinct roots of the quadratic trinomial $f(x)=x^{2}+p x+q$ and its value at $x=3$ are natural numbers, and the larger root of the trinomial and $f(3)$ are prime numbers. Find the roots of the trinomial $f(x)$.
2. Answer. $x_{1}=4, x_{2}=5$ or $x_{1}=1, x_{2}=2$.

If $x_{1}$ and $x_{2}$ are the roots of the quadratic trinomial $f(x)$, then the factorization
$f(x)=\left(x-x_{1}\right)\left(x-x_{2}\right)$ holds. Since the roots are distinct, we can assume that $x_{1}<x_{2}$. By the condition, $f(3)=\left(3-x_{1}\right)\left(3-x_{2}\right)$ is a prime number, so $x=3$ is not a root of the quadratic trinomial $f(x)$, that is, $x_{1} \neq 3$ and $x_{2} \neq 3$, and one of the factors in the factorization must be equal to 1.

Consider the cases.

1) If $3<x_{1}<x_{2}$, then $f(3)=\left(3-x_{1}\right)\left(3-x_{2}\right)=\left(x_{1}-3\right)\left(x_{2}-3\right)$ and $x_{1}-3<x_{2}-3$, so $x_{1}-3=1$, that is, $x_{1}=4$. Then $f(3)=x_{2}-3$. Considering that $x_{2}$ is a prime number greater than 3, it is odd. Therefore, the number $f(3)=x_{2}-3$ is even. Since it is a prime number by the condition, it can only be 2, that is, $x_{2}-3=2$, from which $x_{2}=5$.

The sought quadratic trinomial is $f(x)=x^{2}-9 x+20$, with roots $x_{1}=4$, $x_{2}=5$.

2) If $x_{1}<3<x_{2}$, then $f(3)=\left(3-x_{1}\right)\left(3-x_{2}\right)<0$, so this case is impossible.
3) If $x_{1}<x_{2}<3$, then $f(3)=\left(3-x_{1}\right)\left(3-x_{2}\right)$ and $3-x_{2}<3-x_{1}$, so $3-x_{2}=1$, from which $x_{2}=2$. Since $x_{1}$ is a natural number, we get the only possible value $x_{1}=1$. We obtain another solution to the problem: $x_{1}=1, x_{2}=2$ for the trinomial $f(x)=x^{2}-3 x+2$.