The free-ion energy levels of Nd(IV) and Er(IV) in Y2O3 are expanded in a Taylor series, taking the effects of both linear and nonlinear configurational interactions into account. Numerical values of the partial derivatives of the energy levels with respect to F2, F4, F6, ξ, α, β, Y(22,1), and Y(22,3) are tabulated. The r.m.s. deviation in the case of Nd(IV) is improved from 90 cm−1 to 48 cm−1 and, in the case of Er(IV), the r.m.s. deviation is improved from 61.5 cm−1 to 43 cm−1. The improvements are the result of the inclusion of the extra parameters.