Prove that for x≠πn (n is an integer) sinx and cosx are rational if and only if the number tanx/2 is rational.