You mentioned the substitution model, so apply it to your sumInts method:
Let's start by calling sumInts(3,4) (you used 6 as the second argument, but I chose 4, so I can print less), so replace 3 for a and 4 for b in the definition of sumInts . This gives us:
if(3 > 4) 0 else 3 + sumInts(3 + 1, 4)
So what will be the result of this? Well, 3 > 4 clearly false, so the final result will be equal to the else condition, i.e. 3 plus the result of sumInts(4, 4) (4 - the result of 3+1 ). Now we need to know what the result of sumInts(4, 4) . To do this, we can replace again (this time substituting 4 for a and b ):
if(4 > 4) 0 else 4 + sumInts(4 + 1, 4)
Ok, so the result of sumInts(4,4) will be 4 plus the result of sumInts(5,4) . So what is sumInts(5,4) ? To the substitute!
if(5 > 4) 0 else 5 + sumInts(5 + 1, 4)
This time, the if condition is true, so the result of sumInts(5,4) is 0. So, now we know that the result of sumInts(4,4) must be 4 + 0 , which is 4. And, therefore, the result of sumInts(3,4) should be 3 + 4 , which is equal to 7.