x - a leg (x > 6);
x - 6 - a leg;
x + 1 - a hypotenuse;
Use the Pythagorean theorem
[tex](x+1)^2=x^2+(x-6)^2[/tex]
Use:[tex](a\pm b)^2=a^2\pm2ab+b^2[/tex]
[tex]x^2+2x+1=x^2+x^2-12x+36\ \ \ |-x^2-2x-1\\\\x^2-14x+35=0\ \ \ |-35\\\\x^2-14x=-35\\\\x^2-2\cdot x\cdot7=-35\ \ \ |+7^2\\\\x^2-2\cdot x\cdot7+7^2=-35+7^2\\\\(x-7)^2=14\iff x-7=\pm\sqrt{14}\ \ \ |+7\\\\x=7-\sqrt{14} < 6;\ x=7+\sqrt{14}[/tex]
[tex]x=7+\sqrt{14}\\x-6=1+\sqrt{14}\\x+1=8+\sqrt{14}[/tex]
The perimeter:
[tex]7+\sqrt{14}+1+\sqrt{14}+8+\sqrt{14}=16+3\sqrt{14}[/tex]