How did Heisenberg come up with matrix mechanics?

I have learnt that matrix mechanics came before Schroedinger's wave mechanics, however introductory quantum mechanics textbooks introduce you to wave mechanics first. The way in which the transition to matrix mechanics is made is by defining the matrix elements:

$$H_{mn} = \int _{-\infty}^{+\infty} \psi_m^* \hat{H} \psi_n ~\mathrm dV$$

but these elements are defined using a wavefunction. How did Heisenberg (and others too) come up with matrix mechanics and what was the motivation?

I have seen the application of matrix mechanics to angular momentum but how would I apply it to a simple system like a particle trapped in an infinite potential well without starting from the wave mechanics point of view?

From the outset, there were three theoretical frameworks for QM: the Wave Mechanics of Schrödinger, the Matrix Mechanics of Heisenberg and the the abstract Bra-Ket formalism of Dirac. It's the formalism of Dirac that's standard, and which Dirac himself called Transformation Theory.

Weinberg, in his text on QM, briefly goes into how Heisenberg discovered matrix mechanics:

Heisenberg's starting point was the philosophical judgement, that a physical theory should not concern itself with things like electron orbits in atoms that can never be observed. This is a risky assumption, but it served Heisenberg well...

Hence he fastened on the energies of atomic states, and the rates at which atoms spontaneously make radiative transitions from one state to another state, as the observables on which to base a physical theory.

According to Weinberg, Heisenberg then focused on modelling a 'particle with charge $\pm e$ that undergoes simple harmonic motion' with position vector x; he then derived a relation (equation 1.4.10) for $(dx/dt)_{nm}, x^2_{nm}$ and $x^3_{nm}$ after positing 'the simplest and most natural assumption'.

Heisenberg wasn't aware of matrices at the time, they weren't part of the tool-kit of physicists in general, and it's only when he showed his work to Max Born that Born recognised these relations as special cases of 'the well-known mathematical procedure known as matrix multiplication'.

• Are you telling me that there was a time when physicists did not know about matrix multiplication?? Now that seems absurd. – Prahar Jul 4 '16 at 16:58
• @prahar: It does doesn't it; but inventions have to be invented at some point, and matrix multiplication as inventions go is pretty recent - though I couldn't tell you when; anyway Max Born did know about them, so they weren't totally obscure to physicists even back then, they just weren't ubiquitous like they are now. – Mozibur Ullah Jul 4 '16 at 17:04
• @prahar: from the linked article in the comments above: "Up until this time, matrices were seldom used by physicists; they were considered to belong to the realm of pure mathematics. Gustav Mie had used them in a paper on electrodynamics in 1912 and Born had used them in his work on the lattices theory of crystals in 1921." Which explains why Born was familiar with them. – Mozibur Ullah Jul 4 '16 at 17:24
• Note that Dirac's notation is also another way of writing linear algebra, and one that has migrated back into the usage of some mathematicians. – dmckee Jul 4 '16 at 20:37
• In Heisenberg's paper $\color{blue}{\text{Quantum-Theoretical Re-Interpretation of Kinematical and Mechanical Relations}}$ (July 29, 1925) there is no reference to the term "matrix" or "matrix analysis". I think that Heisenberg, a 24 years old genius, at that time has no idea about matrix and matrix multiplication (so his achievements look even more spectacular). M. Born and P.Jordan in their joint paper $\color{blue}{\text{On Quantum Mechanics}}$ (September 27, 1925) have written : – Frobenius Jul 5 '16 at 19:34