Prove that for \(x \ne \pi n\) (\(n\) is an integer) \(\sin x\) and \(\cos x\) are rational if and only if the number \(\tan x/2\) is rational.