Some inequalities associated with semilinear elliptic equations with variable coefficients and applications