2. Find all pairs of numbers $(a, b)$ for which the function

$$
f(x)=\frac{(a+5 b) x+a+b}{a x+b}
$$

is constant over its entire domain of definition.

(7 points)
Answer: $a= \pm \sqrt{5} b, b \neq 0$.

Solution:

First, note that when $a=b=0$, the function $f(x)$ is not defined for any value of $x$. If $a=0, b \neq 0$, then we get $f(x)=5 x+1$ and $f(x)$ is not a constant, so $a \neq 0$.

Now, suppose that for all $x$ in the domain $D(f)$ of the function $f(x)$, that is, for all $x \neq-\frac{b}{a}$, the equality $f(x)=k$ holds. Then, considering the representation of $f(x)$, we obtain

$$
(a+5 b) x+a+b=k a x+k b, \text { or }(a+5 b-k a) x+(a+b-k b)=0 \text { for all } x \in D(f)
$$

This is possible if and only if the following system of equations is satisfied:

$$
\left\{\begin{array}{l}
a+5 b-k a=0 \\
a+b-k b=0
\end{array}\right.
$$

From which we get $a=(k-1) b$, and then $\left(k^{2}-2 k-4\right) b=0$. If $b=0$, then $a=0$ as well, which is impossible as noted above, therefore,

$$
k^{2}-2 k-4=0, \quad k=1 \pm \sqrt{5}, \quad a=(k-1) b= \pm \sqrt{5} b, \quad \text { where } b \neq 0
$$