$$\sum_{x=1}^{N} \sum_{y=1}^{M(x)} (1 + a\cdot f\left(x\right))(1 + b \cdot f\left(y\right)) \tag{1}$$
where $N$, $a$, and $b$ are integer constants. $M$ is also an integer but changes for every value of x, which makes the index of the second summation dependent on the first. The problem is the relationship $M(x)$ is analytically difficult to define. Is there a way to simplify this expression?