Check the picture below.
[tex]\textit{using the pythagorean theorem} \\\\ c^2=a^2+b^2 \qquad \begin{cases} c=hypotenuse\\ a=adjacent\\ b=opposite\\ \end{cases}\implies 15^2=x^2+(x+3)^2 \\\\\\ 225=x^2+(x^2+6x+9)\implies \implies 225=2x^2+6x+9 \\\\\\ 0=2x^2+6x-216\implies 0=2(x^2+3x-108) \\\\\\ 0= x^2+3x-108\implies 0=(x-9)(x+12)\implies x= \begin{cases} 9 ~~ \checkmark\\\\ -12 \end{cases}[/tex]
let's notice that "x" does have two valid values, however for this scenario 'x" cannot be negative, so we don't use that one.