He was trying to find the right way to calculate the intensity of bright lines in the hydrogen lamp spectrum. He had to find a related quantity called "amplitude" and multiply amplitude by amplitude (or in other words he had to square the amplitude) to get the intensity he wanted. He had to figure out how to express amplitude in a way that took account of the fact that hydrogen lamps do not radiate at all frequencies, and do not radiate across a continuous range of frequencies in the part of the spectrum that people can see. Heisenberg found a remarkable new way of calculating amplitude.