I had someone ask me if dogs really wag their tail because they are happy.
This person was in a situation where a dog was wagging his tail and then it attacked someone. This led the person to wonder if dogs wag their tails other times besides when they are happy.
A dog's tail is a part of a dog's body language. It allows dogs to communicate.
The answer is yes; dogs wag their tails when they are happy but also when they are feeling "alert" or "agitated".
A dog's tail is part of a complex system of body language that the domestic canine uses (along with "verbal" cues such as barking, growling or whining) to communicate. A wagging tail indicates excitement or agitation - but whether he means it as an invitation to play, or to warn another dog or person to stay back, depends on other body language.
A wagging tail that curves down and backs up into a "U" usually indicates a relaxed, playful dog. If his ears are erect and pointing forward, and he is in the classic "play bow" position, he's inviting you to play.
A tail that is held higher, whether wagging or not, indicates dominance and/or increased interest in something. If the end of the tail is arched over the back, and is twitching back and forth, you may be faced with an aggressive dog.
The tail is a purely social indicator for other living things. A dog doesn't usually wag his tail when alone. For instance, say you pour your dog a bowl of food. He may wag his tail excitedly at the prospect of eating. But if he comes upon the bowl already filled - without anyone being around - he most likely will not wag his tail. He may still be happy to eat, but there's no one around to whom he can communicate his state of mind.
A dog's body language is very interesting. Learn more about your dog and read this article - What Is Your Dog Saying? A Key to Canine Body Language
I think you will find this article interesting and will help you to get to know your dog better.
Another thing to consider is what YOUR body language says to your dog. Yes, your body language does communicate different meanings to your dog. Find out what you are saying to your dog. Go to: What Does Your Body Language Say to Your Dog?