Number of integral values of $x\in (\frac{\pi}{2},5\frac{\pi}{2})$ such that $\max(x^2+\cos x-1,1-x^2-\cos x)=\max(\cos x+x^2-1,x^2-1-\cos x)$ The number of integral values of $x\in(\frac{\pi}{2},5\frac{\pi}{2})$ such that
$$\max(x^2+\cos x-1,1-x^2-\cos x)=\max(\cos x+x^2-1,x^2-1-\cos x)$$ is satisfied is... ?
I understand that $\max(x,-x)=|x|$ but I could not simplify the right hand side of the equation.Please help me in this regard. Thanks.

two possibilities. if the first part of LHS is greater then, the values of $x$ for which $cos(x)\,> -cos(x)$ are solutions. that is $5\,,\,6$.
 second possibility is second part of LHS and RHS are equal and greater than first part. there are two values for which second parts of max functions are equal and none of them are in the interval. hence there are only two values of x in the given interval which satisfy the equation namely, $5\,,\,6$. by  first part and second part I mean first  and second inputs to max function respectively.
