Problem
Proof that $x=a$ is solution of polynomial $P(x)=(x-a)Q(x)$ when $Q(x)$ is also polynomial expression. $P(x)$ is product of two polynomials.
Attempt to solve
1. Proof
We can first examine the expression by writing parenthesis open.
$$ P(x)=xQ(x)-aQ(x) $$
Now i try to find when this expression equals zero:
$$ xQ(x)-aQ(x)=0 $$
By dividing both sides with $Q(x)$ we get
$$ x-a=0 $$ $$ x=a $$
$$\tag*{$\square$}$$
2. Proof
We know that $x=a$ is solution for this polynomial so this should satisfy expression $(x-a)Q(x)=0$, when $x=a$.
We can simply test this statement by inserting $x=a$ into the equation.
$$ (a-a)Q(x)=0 $$ $$ 0 \cdot Q(x)=0 $$ $$ 0=0 $$
Which means $x=a$ satisfies the condition $xQ(x)-aQ(x)=0$
$$\tag*{$\square$}$$
My question is that are these two ways equivalent in terms of how much "proof" they are of this. I mean is one of them better than the other or are they equal in terms of coverage of the proof ? Also please let me know if you notice flaw in either one of these.
The first "proof" is simply incorrect. You have given an argument that $P(x)=0$ implies $x=a$, which is the converse of what you want to prove. Moreover, your proof that $P(x)=0$ implies $x=a$ is wrong, since you cannot necessarily divide by $Q(x)$ (it may be $0$).
Your second proof is more or less correct, but again you need to be careful with the logic. If you interpret your sequence of equations as a string of simplifications where each one implies the next, you have the same error as in the first proof, since you are proving the converse of what you want: you show that $P(a)=0$ implies $0=0$, but what you want is that $0=0$ implies $P(a)=0$ (and so $P(a)=0$ is actually true).
The correct way to understand the logic of the second proof is that you are evaluating the left side of your equation to find it is equal to $0$, to prove the equation $P(a)=0$ is actually true. Instead of writing a string of equations as you have done, you could unambiguously communicate what the logic is by writing it as one equation like $$P(a)=(a-a)Q(a)=0\cdot Q(a)=0.$$ (Note that I have also substituted $a$ for all instances of $x$, which is not strictly necessary if you declared that $x=a$ but again clarifies what you are doing.)