Assuming $P(x)$ is true. The statement: "There are exactly two values of $x$ for which $P(x)$ is true" can be rewritten using logical symbols as follows:
$$\exists x \exists y[(P(x) \wedge P(y) \wedge x\neq y)\wedge \forall w(P(w) \Rightarrow (w=x)\vee (w=y))]$$
Is this reasoning true, or there is any mistake.
Thanks.
You're close. First, try to say there are two distinct elements that satisfy $P$. Your approach is pretty close but not right, it should be something like
This phrase is easier to turn into a formula.
For the "uniqueness" part, you're right, but as @Git Gud notices, the existential quantifiers for $x$ and $y$ should take that part too.