<s>[INST] Find the domain and range of $f(x) = \frac{x+2}{x^2+2x+1}$: The domain is: $\forall x \in \mathbb{R}\smallsetminus\{-1\}$
The range is: first we find the inverse of $f$:
$$x=\frac{y+2}{y^2+2y+1} $$
$$x\cdot(y+1)^2-1=y+2$$
$$x\cdot(y+1)^2-y=3 $$
$$y\left(\frac{(y+1)^2}{y}-\frac{1}{x}\right)=\frac{3}{x} $$
I can't find the inverse... my idea is to find the domain of the inverse, and that would then be the range of the function. How to show otherwise what is the range here?
 [/INST] $$\text{You wrote: } x=\frac{y+2}{y^2+2y+1} $$
$$x(y^2+2y+1)=y+2$$
$$
xy^2 + ( 2x-1 )y +(x-2)=0 \tag 1
$$
$$
ay^2 + by + c = 0, \quad\text{where } a=x,\, b=(2x-1), \, c = x-2 \tag 2
$$
$$
y = \frac{-b\pm\sqrt{b^2-4ac}}{2a} = \frac{1-2x\pm \sqrt{(2x-1)^2 -4x(x-2)}}{2x} \tag 3
$$
except that $(2)$ can be a valid solution of $(1)$ only when $a=x\ne 0.$ When $x=0,$ equation $(1)$ becomes
$$
y+2=0, \text{ so } y=-2.
$$
Thus the domain of the function defined on line $(3)$ excludes only those values of $x$ for which the expression under the radical is negative. So we want
$$
(2x-1)^2 - 4x(x-2)\ge0.
$$
$$
-4x + 1+8x\ge0
$$
$$
x \ge \frac {-1} 4.
$$
</s>