On the existence and stability of solutions for Dirichlet problem with p(x)-Laplacian