I get two different results depending on when I apply the concrete parameter values for Integrate. First consider the following code:
Clear["Global`*"];
v = (1 - r) y + r x;
FullSimplify[Integrate[(d - (v - c))/(d s^2), {x, d (1 + i), (d (1 + i))/(1 - r)}, {y, (d (1 + i))/r - (1 - r)/r x, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c))/(d s^2), {x, (d (1 + i))/(1 - r), (d (1 + i))/r}, {y,
0, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c q))/(d s^2), {x, 0, d (1 + i)}, {y, 0, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c q))/(d s^2), {x, d (1 + i), (d (1 + i))/(1 - r)}, {y, 0, (d (1 + i))/r - (1 - r)/r x}]]
When run the code, the output is:
-((d (1 + i)^2 (d - 2 d i + c (3 + 6 (-1 + q) r)))/(6 (-1 + r) r s^2))
To see what it would become under specific parameter values, I did
c = 0.5; d = 0.8; q = 1.5; s = 4;-((d (1 + i)^2 (d - 2 d i + c (3 + 6 (-1 + q) r)))/(6 (-1 + r) r s^2))
which yielded
-((0.00833333 (1 + i)^2 (0.8 - 1.6 i + 0.5 (3 + 3. r)))/((-1 + r) r))
Now, if I apply the same parameter values at the start I get a different result! Here is my code for this:
Clear["Global`*"];
c = 0.5; d = 0.8; q = 1.5; s = 4;
v = (1 - r) y + r x; FullSimplify[
Integrate[(d - (v - c))/(d s^2), {x, d (1 + i), (d (1 + i))/(1 - r)}, {y, (d (1 + i))/r - (1 - r)/r x, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c))/(d s^2), {x, (d (1 + i))/(1 - r), (d (1 + i))/r}, {y, 0, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c q))/(d s^2), {x, 0, d (1 + i)}, {y, 0, (d (1 + i))/(1 - r) - r/(1 - r) x}] + Integrate[(d - (v - c q))/(d s^2), {x, d (1 + i), (d (1 + i))/(1 - r)}, {y, 0, (d (1 + i))/r - (1 - r)/r x}]]
The output is:
which is different from the first. Why? Please help.

10^-17and10^-18are decimal approximation "floating point noise." Try usingChop[..yourresult..]which will make most things less than10^-10equal to zero and they disappear. That makes the second result somewhat closer to the first. OR you can use exact rationals for c,d,q,s and sometimes avoid the problem. – Bill Jan 16 '24 at 16:49