2. Given two linear functions $f(x)$ and $g(x)$ such that the graphs $y=f(x)$ and $y=g(x)$ are parallel lines, not parallel to the coordinate axes. Find the minimum value of the function $(g(x))^{2}+$ $2 f(x)$, if the minimum value of the function $(f(x))^{2}+2 g(x)$ is 5.
Answer: -7.

Solution. Let $f(x)=a x+b, g(x)=a x+c$, where $a \neq 0$. Consider $h(x)=(f(x))^{2}+2 g(x)$. Expanding the brackets, we get $h(x)=(a x+b)^{2}+2(a x+c)=a^{2} x^{2}+2 a(b+1) x+b^{2}+2 c$. The graph of $y=$ $h(x)$ is a parabola opening upwards, and the minimum value is attained at the vertex. The x-coordinate of the vertex is $x_{\mathrm{v}}=-\frac{b+1}{a}$; the y-coordinate of the vertex is $h\left(x_{\text {v }}\right)=-2 b-1+2 c$.

Similarly, we obtain that the minimum value of the expression $(g(x))^{2}+2 f(x)$ is $-2 c-1+2 b$. Note that the sum of these two minimum values is -2, therefore, if one of these minimum values is 5, then the other is $-2-5=-7$.