How do I find the values of x, y, and z?

Pythagorean theorem:
[tex]\begin{gathered} hypotenuse^2=Leg1^2+Leg2^2 \\ Leg1^2=hypotenuse^2-Leg2^2 \end{gathered}[/tex]Use the pythagorean theorem above to find the values of x, y and z as follow:
1. From the triangle in the right find the value of y^2 (Leg 1)
[tex]y^2=z^2-\left(x+1\right)^2[/tex]2. From the triangle in the left find the value of y^2 (Leg 1):
[tex]y^2=\left(x+2\right)^2-x^2[/tex]3. From the big triangle find the value of z^2 (Leg 1):
[tex]\begin{gathered} z^2=\left(x+\left(x+1\right)\right)^2-\left(x+2\right)^2 \\ \\ z^2=\left(2x+1\right)^2-\left(x+2\right)^2 \end{gathered}[/tex]3. Equal the expressions of y^2 (step 1 and step 2):
[tex]z^2-\left(x+1\right)^2=\left(x+2\right)^2-x^2[/tex]4. Substitute the z^2 in the equation above by the value of z^2 you get in step 3:
[tex]\lparen2x+1)^2-\left(x+2\right)^2-\left(x+1\right)^2=\left(x+2\right)^2-x^2[/tex]5. Solve x in the equation above:
[tex]\begin{gathered} Subtract\text{ \lparen x+2\rparen}^2\text{ in both sides of the equation:} \\ \lparen2x+1)^2-\left(x+2\right)^2-\left(x+2\right)^2-\left(x+1\right)^2=\left(x+2\right)^2-\left(x+2\right)^2-x^2 \\ \lparen2x+1)^2-2\left(x+2\right)^2-\left(x+1\right)^2=-x^2 \\ \\ Add\text{ x}^2\text{ in both sides of the equation:} \\ \lparen2x+1)^2-2\left(x+2\right)^2-\left(x+1\right)^2+x^2=-x^2+x^2 \\ \lparen2x+1)^2-2\left(x+2\right)^2-\left(x+1\right)^2+x^2=0 \\ \\ Simplify: \\ \left(4x^2+4x+1\right)^2-2\lparen x^2+4x+4)-\left(x^2+2x+1\right)+x^2=0 \\ 4x^2+4x+1-2x^2-8x-8-x^2-2x-1+x^2=0 \\ 2x^2-6x-8=0 \end{gathered}[/tex]Use quadratic formula to solve x:
[tex]\begin{gathered} ax^2+bx+c=0 \\ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \\ \\ \\ x=\frac{-\left(-6\right)\pm\sqrt{\left(-6\right)^2-4\left(2\right)\left(-8\right)}}{2\left(2\right)} \\ \\ x=\frac{6\pm\sqrt{36+64}}{4} \\ \\ x=\frac{6\pm\sqrt{100}}{4} \\ \\ x_1=\frac{6-10}{4}=\frac{-4}{4}=-1 \\ \\ x_2=\frac{6+10}{4}=\frac{16}{4}=4 \end{gathered}[/tex]As x cannot be a negative value (a side of a triangle cannot be negative) the value of x is 4
6. Use the value of x to solve y in the equation in step 2:
[tex]\begin{gathered} y^2=(x+2)^2-x^2 \\ \\ y^2=\left(4+2\right?^2-\left(4\right?^2 \\ \\ y^2=6^2-16 \\ y^2=36-16 \\ y^2=20 \\ y=\sqrt{20} \\ y=2\sqrt{5} \end{gathered}[/tex]7. Use the value of x to solve z in the equation in step 3:
[tex]\begin{gathered} z^{2}=(2x+1)^{2}-(x+2)^{2} \\ \\ z^2=\left(2\left(4\right)+1\right)^2-\left(4+2\right)^2 \\ z^2=\left(8+1\right)^2-6^2 \\ z^2=9^2-6^2 \\ z^2=81-36 \\ z^2=45 \\ z=\sqrt{45} \\ z=3\sqrt{5} \end{gathered}[/tex]Then, the values of x, y and z are:
[tex]\begin{gathered} x=4 \\ y=2\sqrt{5} \\ z=3\sqrt{5} \end{gathered}[/tex]