How to solve for a, b,

It looks like the length of a and b should be the same. You can use the Pythagorean theorem (only works with right triangles):
a² + b² = c² (c is the hypotenuse or the longest side of the triangle, a and b are the other side lengths of the triangle)
a² + (4)² = (5)²
a² + 16 = 25
a² = 9
a = 3
a and b have a length of 3