The intermediate cosine and tangent lines have an extra leading minus sign before cos(π−C) and tan(π−C). Use cos(A+B)=cos(π−C) and tan(A+B)=tan(π−C); the written final results are correct.
The next written line substitutes cosBcosC for cosA:
cosBcosC=sinBsinC−cosBcosC, hence tanBtanC=2.
Note
This last substitution requires an additional hypothesis from the textbook; it is not recorded on this sheet. A+B+C=π alone does not imply tanBtanC=2. Quotient identities also require nonzero denominators.