A solid X when heated gives off a brown gas. If X is soluble in…