Start with 0 → F1 → F0 → A → 0 and tensor with B. Write A as the direct sum of quotients of free modules, and expand each module in the aforementioned exact sequence into its direct sum. Remember that tensor product commutes with direct sum. The boundary operators also commute with direct sum. Thus the short sequence F1×B → F0×B → A×B → 0 is the direct sum of component sequences based on Ai. The homology is the direct sum of the component homologies, and tor commutes with direct sum.
Similar reasoning holds when B is a direct sum.
All of the above holds when A or B is a direct product of modules. Tor(A,B) is the direct product over tor(Ai,Bj).
What about ext(A,B)? Does that commute with direct sum or product? Assume A and B are direct products of modules Ai and Bj respectively. Split the chain complex of A into a direct product of chain complexes, as above. Take the dual into B, which is the direct product over Bj. Remember that dual and direct product commute, giving the direct product of each exact sequence Ai mapped into each module Bj. The result is the direct product of all component cohomologies, or the direct product of ext(Ai,Bj).
Since dual and direct sum do not commute, we can't make any claims about ext(A,B) when A or B is an infinite direct sum.
0 → H1 → R → R/H1 → 0
Tensor this with R/H2 and apply the formula for tensoring with a quotient ring.
0 → H1/H4 → R/H2 → R/H3 → 0
If the first module were H3/H2 we would have an exact sequence. Map H3/H4 into H3/H2, and this becomes our kernel, giving the desired homology. Divide this module by gcd(e1,e2) and find a natural isomorphism to R/H5, where H5 is generated by lcm(e1,e2). This is tor(R/H1,R/H2).
Notice that the answer is the same if we swap H1 and H2. This is expected, since tor is commutative.
If either e1 or e2 is 0, the gcd lcm argument breaks down; but in that case tor = 0, since R is a flat module.
To find ext(R/H1,R/H2), start with the aforementioned exact sequence and take the dual into R/H2. The middle dual is determined by the image of 1, and is isomorphic to R/H2. Similarly, the first dual is determined by the image of e1, another variation on R/H2. (Assume e1 ≠ 0, so that e1 may be meaningfully mapped into arbitrary cosets of H2.) A function on H1 is a valid restriction of a function on R iff the image of e1 is divisible by e1. These are the cosets of H2 that have a representative divisible by e1. This is the image of H1 in R/H2. This collection of cosets is spanned by e1 and e2, and the resulting ideal is H3. The functions that are valid restrictions of larger functions map e1 onto H3/H2. The entire dual maps e1 onto R/H2. The quotient becomes R/H3. This is the cohomology, the value of ext(R/H1,R/H2).
If e1 = 0 then ext = 0, as described above. Set e2 = 0, thus taking duals into R. A function on H1 is the restriction of a function on R iff the image of e1 is divisible by e1, iff the image of e1 lies in H1. The cohomology is R/H1. We have found two modules, R and R/H1, that prove ext is not commutative.