Find the cosine of a half-angle knowing the tangent of the angle

This post is dedicated to Fazenda: