Mirror formula and lens formula. If x i and f lie on that side, they are positive.