Whitman saw Lincoln often and regarded him as a great leader of the country.  Lincoln’s assassination plunged the poet, like the rest of the nation, into a numbing grief, and Whitman’s elegies to Lincoln are among his best-known work.
O Captain, My Captain, is uncharacteristically conventional in form.  Whitman said later that he was sorry that he wrote it, since it was a popular favorite and not at all characteristic of his verse.
“When lilacs last in the dooryard bloom’d”  is one of his great poems.  It uses  images of sight--the evening star--of sound,--the mournful thrush--and of smell--the lilacs--to memorialize the Western leader and mourn his passing.