Electromagnetic interaction of colliding beams along with
other nonlinear fields often limits the beams' lifetimes and
luminosities. Nonlinearities result in the spread of betatron
frequencies (footprint) and, thus, may enhance dynamic diffusion of
particles due to high order resonances. One of the possible ways to
eliminate nonlinearities and overcome the corresponding difficulties
is compensation of nonlinear forces, but, in practice, it is hardly
possible to obtain exact linearity of the system. The compensation
with a single nonlinear lens cannot cope with distributed
nonlinearities, nonlinearities due to parasitic crossings, etc. In
the article, we present a method to compute parameters of nonlinear
element (lens) that eliminates both the footprint and resonance
strength without achieving full compensation.