$g(x)=|\sin{x}-1|+|3-\cos{x}-\sin{x}|+2\sin{x}$
Answer: Above equality is simplified to $$1-\sin{x}+3-\cos{x}-\sin{x}+2\sin{x}=4-\cos{x}$$
$$-1 \le\sin{x}\le1$$
So , I know that $f(x)=|\sin{x}-1|$ will be equal to $1-\sin{x}$ when $-1 \le\sin{x}\lt1$.
But what if $\sin{x}$ is exactly $1$, then wouldn't the expression be $\sin{x}-1$?
I always considered $|x|=x$, whenever $x$ is equal to or greater than $0$.