What is the second derivative of the absolute function $\left|\frac{x+1}{x+2}\right|$?
This is how I deal with absolute functions:
$$ \begin{align} \left|\frac{x+1}{x+2}\right|&=\sqrt{\left(\frac{x+1}{x+2}\right)^{2}}\\ \\ \frac{d}{dx} \left|\frac{x+1}{x+2}\right|&=\frac{d}{dx} \sqrt{\left(\frac{x+1}{x+2}\right)^{2}}\\ &=\frac{1}{2 \sqrt{\left(\frac{x+1}{x+2}\right)^{2}}}\cdot 2 \left(\frac{x+1}{x+2}\right)\cdot\frac{1}{\left(x+2\right)^{2}}\\ &=\frac{x+1}{\left(x+2\right)^{3}\cdot\left|\frac{x+1}{x+2}\right|} \end{align} $$
Notice the chain rule when I differentiate the square root