In academic writing, a topic sentence can be compared with a thesis statement, which is a short statement that encapsulates the ideas contained within an essay or piece of discursive writing. The topic sentence lays out for the reader the ideas that are going to be discussed in that paragraph, which explains why it is often the first sentence in a paragraph.
In the following short paragraph, the topic sentence is the first sentence: "Yesterday I took a trip to the country. The weather was warm and clear. I went for a walk by the lake and took off my shoes to paddle in the water. The birds were singing in the trees."
The sentence, "Yesterday I took a trip to the country," explains what the paragraph is about: a trip to the country. The subsequent sentences are called supporting sentences -- they provide detail to support the idea outlined in the topic sentence.
There are occasions when topic sentences need not come first in a paragraph, such as when the paragraph requires an opening sentence that links it to the previous paragraph or in a piece of creative writing. Paragraphs may not need topic sentences if they are illustrating a set of events or continuing an idea introduced in the previous paragraph.
It's important to consider the topic sentence in the context of a paragraph. A well-structured paragraph contains a beginning, a middle and an end -- introduction, body of descriptive text and concluding sentence or sentences -- and the topic sentence is key to setting the tone and grabbing the attention of the reader. Without a comprehensive topic sentence, the reader may struggle to establish the direction of the paragraph. Consider the following paragraph: "It was beautiful and green and smelled of fresh rain. I sat down on a bench and watched the people stroll by with their dogs." Without a topic sentence such as "I went for a walk in the park," the meaning is vague.