This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] $\sin^{-1}\frac{x+1}{\sqrt{(x+1)^2+1}}=\tan^{-1}(x+1)$ and $\sin^{-1}\frac x{\sqrt{x^2+1}}=\tan^{-1}x$. So $\tan^{-1}(x+1)-\tan^{-1}x=\frac\pi4\Rightarrow\frac{1}{1+x(x+1)}=1\Rightarrow x^2+x=0$, so $x=0$ or $-1$ (both satisfy the equation). For each, $x^2+x+5=5$: $\sin\frac{5\pi}2-\cos5\pi=1-(-1)=2$. Sum over the two elements $=4$. Answer: 4.