The president was greeted by enthusiastic applause as he entered the House chamber, though it was filled with Democrats who vigorously oppose his policies and many Republicans who never expected him to be elected.