The one-body density-matrix elements obtained from the USDA Hamiltonian are used to calculate the electronnucleus scattering form factors for the 25 Mg nucleus. The longitudinal form factor calculations produce good agreements for all states in the first sequence whereas the shell-model predictions show a variation in results for the excitation states in the second sequence. The wave functions of radial single-particle matrix elements have been calculated with the Woods-Saxon, harmonic-oscillator, and Skyrme (Sk42) potentials. The results of the inelastic transverse form factors are in good agreement with the experimental data when using the Sk42 potential whereas the elastic magnetic scattering results show a significant difference in values compared with the experimental data. However the overall shape and other features of the form factors are satisfactory when using the harmonic-oscillator potential. The effective g factors were used as adjustable parameters in the OXBASH code to describe the core-polarization effects in the transverse form factor calculations with the use of a harmonic-oscillator size parameter in the elastic magnetic scattering.