Let's start by explaining the divisibility rule for 9. Take a number, such as 3465. Any number can be broken down into a place value with coefficient form, like 3465 is 3∗1000+4∗100+6∗10+5. Now watch the steps below:
Substitute the powers of 10 into 1 + multiples of 9: 3465=3(999+1)+4(99+1)+6(9+1)+5
When we expand this, we get: 3465=3∗999+3+4∗99+4+6∗9+6+5
We can collect the multiples of 9, so we have: 3465=x∗9+3+4+6+5.
We have grouped our number. Now we see that if the sum of the digits(i.e., 3,4,6,5) is divisible by 9, in this case it is true, the number is divisible by 9.
This is also the divisibility trick for 3, because whatever multiples we took out in the explanation above that were divisible by 9 are also divisible by 3, and the extra(the sum of the digits) should be divisible by 3.
The divisibility trick for 11 uses the fact that:
(1−1) mod 11 = 0.
(10+1) mod 11 = 0.
(100−1) mod 11 = 0.
(1000+1) mod 11 = 0.
(10000−1) mod 11 = 0.
...................................................................
See the pattern above? We'll use this to check if our new number, 89166, is divisible by 11.
89166=8(a∗11+1)+9(b∗11−1)+1(c∗11+1)+6(d∗11−1)+6(e∗11+1)
Taking out the multiples of 11, we get: 89166=11(8a+9b+1c+6d+6e)+8−9+1−6+6.
Therefore, if our number is divisible by 11, the number obtained by adding alternative digits and subtracting the sums should be divisible by 11.