We derived the equation of the density operator for generalized entropy and generalized expectation value with quantum analysis when conserved quantities exist. The derived equation is simplified when the conventional expectation value is employed. The derived equation is also simplified when the commutation relations, [ρ, Ĥ] and [ρ, Q[a] ], are the functions of the density operator ρ, where Ĥ is the Hamiltonian, and Q[a] is the conserved quantity. We derived the density operators for the von Neumann entropy, the Tsallis entropy, and the Rényi entropy in the case of the conventional expectation value. We also derived the density operators for the Tsallis entropy and the Rényi entropy in the case of the escort average (the normalized q-expectation value), when the density operator commutes with the Hamiltonian and the conserved quantities. We found that the argument of the density operator for the canonical ensemble is simply extended to the argument for the generalized Gibbs ensemble in the case of the conventional expectation value, even when conserved quantities do not commute. The simple extension of the argument is also shown in the case of the escort average, when the density operator ρ commutes with the Hamiltonian Ĥ and the conserved quantity Q[a] : [ρ, Ĥ] = [ρ, Q[a] ] = 0. These findings imply that the argument of the density operator for the canonical ensemble is simply extended to the argument for the generalized Gibbs ensemble in some systems.