Recall that
cos(A + B) = cos(A) cos(B) - sin(A) sin(B)
sin(A + B) = sin(A) cos(B) + cos(A) sin(B)
By definition of cotangent,
cot(A + B) = 1 / tan(A + B) = cos(A + B) / sin(A + B)
and by applying the identities above,
cot(A + B) = (cos(A) cos(B) - sin(A) sin(B)) / (sin(A) cos(B) + cos(A) sin(B))
Now, multiply the expression on the right by 1/(sin(A) sin(B)) to get
cot(A + B) = (cot(A) cot(B) - 1) / (cot(B) + cot(A))
Given tan(A) = 1/4 and tan(B) = 1/5, we have cot(A) = 4 and cot(B) = 5, so that
cot(A + B) = (4×5 - 1) / (5 + 4) = 19/9