His first appointment, as Education Officer in the Royal Air Force, turned his thoughts to the problems with which his life-work was concerned. His duties consisted mainly in teaching mathematics of a fairly elementary nature; but this was not enough to satisfy his powerful and inquiring mind. He saw that aerial warfare raised many problems most important from the military, and most interesting from the scientific, points of view. A mathematical theory of combat was not a completely new idea. A start had been made by Lanchester and similar ideas had been used by Volterra and others in connection with the survival of biological species. In these theories the contending parties are assumed to vary continuously. This assumption clearly does not apply to aerial combat, which takes place between a small number of discrete units. Cunningham worked at a very general theory of combat, in which allowance could be made for a great variety of offensive and defensive factors. The application of this theory had a very real effect on R.A.F. armament policy. The R.A.F. officers who had ultimately to make the decisions were in continuous contact with Cunningham and respected his judgment, even when their training did not equip them to follow the details of his reasoning. A two-year Advanced Armament Course was started under his technical direction in 1931.

His influence on the technique of bombing was no less profound. The trajectory of a falling bomb was the subject of his Edinburgh Ph.D. thesis. The problem does not admit of exact solution in an atmosphere of variable density, and the practice had been to divide the atmosphere into layers of constant density and carry the solution forward from layer to layer. Cunningham noticed that an exact solution can be found if the density varies as (1 + ky)^{-1,}where y is the height. This law is a fair approximation to the truth, and enables the true trajectory to be calculated with much greater accuracy than the old method had permitted. Cunningham was also greatly interested in bomb- and gun-sights, and was the first patentee of the gyro-gun-sight used both by the British and the American Air Forces during the war. He was responsible for putting forward the idea of using a gyroscope in gun-sighting problems and for the eddy-current method of control.

During the war Cunningham was in charge of the Air Warfare Analysis Section, under the Ministry of Aircraft Production. His main duty was to analyse the results of the British air effort against Germany and the German air effort against Britain; but in fact the activities of his Section, which included several first-rate mathematicians, were much wider, and many other problems, particularly those concerned with navigation, came his way.

Dr Cunningham was elected a Fellow of the Society in 1945, and died on August 31, 1946, in his fifty-second year.