<s>[INST] Count the integer solutions of $x_1+x_2-x_3+x_4-x_5=3$ I am asking for help with solving this exercise:
Find the count of possible integer solutions for equation:
$$x_1+x_2-x_3+x_4-x_5=3$$
There are restrictions for possible values of $x$:
$$
\begin{aligned}
&0 < x_1 \le 6\\
-&8 \le x_2 < -2\\
&x_3 \le 1\\
&3 < x_4\\
&2 \le x_5 \le 8
\end{aligned}
$$
Note: We should be able to find the count of solutions by using permutations and Inclusion-Exclusion principle.
 [/INST] By translations $x\to x+c$ and symmetries $x\to-x$ you can reformulate your problem as

Find all $x_1,x_2,x_3,x_4,x_5$ integers that satisfy 
  $$
1+x_3+x_4 = x_1+x_2+x_5$$
  with bounds
  $$0\le x_1\le 5\qquad 0\le x_2\le 5\qquad 0\le x_5\le 6$$
  $$0\le x_3\qquad 0\le x_4$$

Now, call $p(n)$ the number of triples $(x_1,x_2,x_5)$ such that $x_1+x_2+x_5=n$ and such that
$$0\le x_1\le 5\qquad 0\le x_2\le 5\qquad 0\le x_5\le 6$$
hold. In the same way, let  $q(n)$ the number of couples $(x_3,x_4)$ such that $x_3+x_4=n$ and such that
$$0\le x_3\qquad 0\le x_4$$
hold. Your solution is
$$
p(1)q(0) + p(2)q(1) + p(3)q(2) + \dots + p(16)q(15).
$$
We know that $q(n)=n+1$, but $p(n)$ is much harder to compute, and I think must be done by a computer.  

Let's do it with permutations/inclusion-exclusion.
First of all, a Toy Problem

Find all $x_1,x_2,x_3,x_4,x_5$ positive integers that satisfy 
  $$c+x_3+x_4 = x_1+x_2+x_5$$
  where $c$ is an integer (may be negative) and with bound
  $$c + x_3+x_4\le n$$
  where $n$ is a positive integer.

Like before, let $p(m)$ the number of triples $(x_1,x_2,x_5)$ such that $x_1+x_2+x_5=m$ and let  $q(m)$ the number of couples $(x_3,x_4)$ such that $x_3+x_4=m$. We know that
$$
p(m) = \frac{(m+2)(m+1)}2 = \binom{m+2}2 \qquad q(m) = m+1 = \binom{m+1}1
$$ 
The solution is 
$$TP(c,n) = q(-c)p(0) + q(1-c)p(1) + \dots +q(n-c)p(n) $$
$$ = \binom {1-c}1\binom 22 + \binom {2-c}1\binom 32 + \dots + \binom {n-c+1}1\binom {n+2}2 $$

If we return to our first problem, we can operate an inclusion-exclusion method. 


*

*First of all, we notice that $x_1+x_2+x_5\le 16$, so we can consider the Toy Problem with $c=1$ and $n=16$, so we get $TP(1,16)$.

*We have to respect the bounds, though, so we have to subtract the wrong solutions. How many solution are there with $x_5>6$? If we substitute $x_5 = 7 +z_5$ we get again the Toy Problem with
$$-6+x_3 + x_4 = x_1+x_2+z_5$$
so $c=-6$ and $n=16 -7=9$, so $TP(-6,9)$. If we do the same for $x_1,x_2$ we get $TP(-5,10)$ twice.

*Now we subtracted too much. For example we subtracted twice the (wrong) solutions with $x_1>5,x_2>5$ and we have to add them again. With the same substitutions as before, we get $TP(-11,4)$. Doing the same for the other couples, we get  $TP(-12,3)$ twice.


The final answer is thus 
$$TP(1,16) - TP(-6,9) - 2\cdot TP(-5,10) + TP(-11,4) + 2\cdot TP(-12,3) $$
</s>