A comprehensive spectral analysis of both the solar background magnetic field (SBMF) in cycles 21-23 and the sunspot magnetic field in cycle 23 reported in our recent paper showed the presence of two principal components (PCs) of SBMF having opposite polarity, e.g., originating in the northern and southern hemispheres, respectively. Over a duration of one solar cycle, both waves are found to travel with an increasing phase shift toward the northern hemisphere in odd cycles 21 and 23 and to the southern hemisphere in even cycle 22. These waves were linked to solar dynamo waves assumed to form in different layers of the solar interior. In this paper, for the first time, the PCs of SBMF in cycles 21-23 are analyzed with the symbolic regression technique using Hamiltonian principles, allowing us to uncover the underlying mathematical laws governing these complex waves in the SBMF presented by PCs and to extrapolate these PCs to cycles 24-26. The PCs predicted for cycle 24 very closely fit (with an accuracy better than 98%) the PCs derived from the SBMF observations in this cycle. This approach also predicts a strong reduction of the SBMF in cycles 25 and 26 and, thus, a reduction of the resulting solar activity. This decrease is accompanied by an increasing phase shift between the two predicted PCs (magnetic waves) in cycle 25 leading to their full separation into the opposite hemispheres in cycle 26. The variations of the modulus summary of the two PCs in SBMF reveals a remarkable resemblance to the average number of sunspots in cycles 21-24 and to predictions of reduced sunspot numbers compared to cycle 24: 80% in cycle 25 and 40% in cycle 26.