Determine the maximum and minimum of the function

$$
y=\frac{2 x^{2}+6 x+6}{x^{2}+4 x+5}
$$
I. solution: Express $x$ in terms of $y$ from the given relationship. This way, we can specify which $y$ values allow for the calculation of $x$, in other words, which $y$ numbers have an $x$ value for which our function takes the value $y$, i.e., what is the range of our function. From this, we can select the desired maximum or minimum - if there is a largest or smallest number in the range.

The denominator is never 0 because $x^{2}+4 x+5=(x+2)^{2}+1 \geq 1$, so the relationship obtained by cross-multiplication and rearrangement

$$
(y-2) x^{2}+(4 y-6) x+(5 y-6)=0
$$

is equivalent to the original. From this,

$$
x=\frac{-4 y+6 \pm \sqrt{-4 y^{2}+16 y-12}}{2(y-2)}
$$

provided $y \neq 2$, and $x=-2$ if $y=2$.

$x$ is given by the quadratic formula only if the discriminant is non-negative, i.e., if - immediately factoring the quadratic expression -

$$
-4(y-1)(y-3) \geq 0
$$

This is clearly true if and only if

$$
1 \leq y \leq 3
$$

This double inequality describes the entire range of our function, as the $y=2$ value obtained by a different route also satisfies it. According to this, our function has both a maximum and a minimum, namely

$$
y_{\max }=3, \quad \text { or } \quad y_{\min }=1
$$

values. These are taken by the function at

$$
x_{\max }=-3, \quad \text { or } \quad x_{\min }=-1
$$

points.

Remark. Some solutions arrived at the correct result with the following erroneous reasoning: "The maximum and minimum values are those which the function takes only once, these are where the discriminant is 0." According to this, every value of a linear function would be both a maximum and a minimum; furthermore, the value $y=1$ would not be a maximum of the $y=\sin x$ function, nor would $y=-1$ be its minimum, because each value is taken infinitely many times. This shows that the concept of extreme values is based solely on quadratic functions.

II. solution. By division and completing the square in the denominator, the given expression can be transformed as follows:

$$
y=2-\frac{2 x+4}{x^{2}+4 x+5}=2-\frac{2(x+2)}{(x+2)^{2}+1}
$$

and by substituting $x+2$ with a new variable $z$

$$
y=2-\frac{2 z}{z^{2}+1}=2-2 y_{1}, \quad \text { where } \quad y_{1}=\frac{z}{z^{2}+1}
$$

According to this, $y$ has a maximum where the function $y_{1}$ takes its minimum value, and a minimum where $y_{1}$ is maximal. $y_{1}$ can be positive, negative, and 0, because it has the same sign as the numerator $z$, since its denominator is positive, and $y_{1}=0$ when $z=0$; therefore, the maximum value of $y_{1}$ can only be positive, and its minimum value can only be negative. It is sufficient to examine $y_{1}$ for positive $z$ values, because the values it takes for $z$ and $-z$ differ only in sign, so the negative of the maximum value to be determined, and the location of the minimum value, will give the minimum value and location.

Further transformation gives

$$
y_{1}=\frac{z}{z^{2}+1}=\frac{1}{z+\frac{1}{z}}=\frac{1}{y_{2}}, \quad \text { where } \quad y_{2}=z+\frac{1}{z}
$$

so the maximum of $y_{1}$ is equal to the minimum of the function $y_{2}$. Note that for positive $z$, the geometric mean of the two terms of $y_{2}$ is 1, a constant. It is also known that the arithmetic mean of positive numbers is never less than their geometric mean, and is equal to it when the numbers are equal. Therefore, the minimum of $y_{2}$ is 1, so $y_{2, \min }=2$, and this occurs when $z$ is the positive number for which $z=1 / z$, i.e., $z=1$.

Now the maximum of $y_{1}$ is $1 / 2$, and according to the above, the minimum is $y_{1, \min }=-1 / 2$ at $z=-1$; finally, according to (2), the minimum of $y$ is 1, the maximum is 3, and these extreme values are taken at $x=z-2$ considering the above, at $x=-1$, and $x=-3$.

III. solution: $y$ can also be transformed as follows:

$$
\begin{aligned}
& y=1+\frac{x^{2}+2 x+1}{x^{2}+4 x+5}=1+\frac{(x+1)^{2}}{(x+2)^{2}+1} \\
& y=3-\frac{x^{2}+6 x+9}{x_{2}+4 x+5}=3-\frac{(x+3)^{2}}{(x+2)^{2}+1}
\end{aligned}
$$

The second term of the first form is never negative, because its numerator is a perfect square and its denominator is positive. Therefore, $y$ takes its minimum value at $x+1=0$, i.e., at $x=-1$; here the second term is 0, and the value of $y$ is 1. Similarly, the subtrahend of the second form is smallest when $x+3=0$, i.e., $x=-3$, and here its value is 0, so the maximum of $y$ is 3.