Count the number of integer solutions to $x_1+x_2+\cdots+x_5=36$ How to count the number of integer solutions to  $x_1+x_2+\cdots+x_5=36$ such that $x_1\ge 4,x_3 = 11,x_4\ge 7$ 
And how about $x_1\ge 4, x_3=11,x_4\ge 7,x_5\le 5$
In both cases, $x_1,x_2,x_3,x_4,x_5$ must be nonnegative integers. 
Is there a general formula to calculate things like this?

$\infty$, if you have no constraint on $x_2$ and $x_5$ other than that they are integers:  note that you can always add $1$ to one of these and subtract $1$ from the other.  Or did you mean nonnegative (or positive) integers?
