The primary focus of Democracy in America is an analysis of why republican representative democracy has succeeded in the United States while failing in so many other places. Tocqueville seeks to apply the functional aspects of democracy in the United States to what he sees as the failings of democracy in his native France.
Tocqueville speculates on the future of democracy in the United States, discussing possible threats to democracy and possible dangers of democracy. These include his belief that democracy has a tendency to degenerate into "soft despotism" as well as the risk of developing a tyranny of the majority. He observes that the strong role religion played in the United States was due to its separation from the government, a separation all parties found agreeable. He contrasts this to France where there was what he perceived to be an unhealthy antagonism between democrats and the religious, which he relates to the connection between church and state. Tocqueville also outlines the possible excesses of passion for equality among men, foreshadowing the totalitarian states of the twentieth century.
Insightful analysis of political society was supplemented in the second volume by description of civil society as a sphere of private and civilian affairs.
Tocqueville observed that social mechanisms have paradoxes, like in what later became known as the Tocqueville effect: "social frustration increases as social conditions improve". He wrote that this growing hatred of social privilege, as social conditions improve, leads to the state concentrating more power to itself.
Tocqueville's views on the United States took a darker turn after 1840, however, as made evident in Aurelian Craiutu's Tocqueville on America after 1840: Letters and Other Writings.

Question: By studying the United States Democracy, Tocqueville was trying to understand the failings of what country? 
Answer: France
Alternative answer: France.