Not sure about the first, but for the second:
We can apply the pythagorean theorem to this. The hypotenuse must be 6a+1, and the two legs a+1 and 6a.
\(a^2+b^2=c^2\\ (a+1)^2+(6a)^2=(6a+1)^2\\ a^2+2a+1+36a^2=36a^2+12a+1\\ a^2+2a+1=12a+1\\ a^2-10a=0\\ a=0, 10\)
We find that a can be 0 or 10. However, the only correct value is 10 because if we plug in the value 0 into the given sides, one of them will have a side length of 0.