Soliton solutions with power-law nonlinearity in inhomogeneous media