We study a system consisting of a superconducting flux qubit strongly coupled to a microwave cavity. The fundamental cavity mode is externally driven and the response is investigated in the weak nonlinear regime. We find that near the crossing point, at which the resonance frequencies of the cavity mode and qubit coincide, the sign of the Kerr coefficient changes, and consequently the type of
... [Show full abstract] nonlinear response changes from softening to hardening. Furthermore, the cavity response exhibits superharmonic resonances when the ratio between the qubit frequency and the cavity fundamental mode frequency is tuned close to an integer value. The nonlinear response is characterized by the method of intermodulation and both signal and idler gains are measured. The experimental results are compared with theoretical predictions and good qualitative agreement is obtained. The superharmonic resonances have potential for applications in quantum amplification and generation of entangled states of light.