Sleep expert Matthew Walker breaks down what happens in your brain when you dream. Following is a transcript of the video.

Matthew Walker: My name is Matthew Walker, I am a professor of neuroscience and psychology at the University of California, Berkeley and I am the author of the book "Why We Sleep."

What is dreaming and what happens and are there any real benefits to dreaming? Well, to take a step back I think it's important to note that dreaming essentially is a time when we all become flagrantly psychotic. And before you perhaps dismiss that diagnosis, I'll give you five good reasons, because last night when you were dreaming, first you started to see things which were not there, so you were hallucinating.

Second, you believe things that couldn't possibly be true, so you were delusional. Third, you became confused about time, place, and person, so you're suffering from disorientation. Fourth, you had wildly fluctuating emotions like a pendulum, something that we call being affectively labile. And then, how wonderful? You woke up this morning and you forgot most if not all of that dream experience, so you're suffering from amnesia.

And if you were to experience any one of those five symptoms while you were awake, you would be seeking psychological or psychiatric treatment, yet during sleep and dreaming it seems to be both a normal biological and psychological process.

What are the functions, then, or the benefits of dreaming? Well we know that dream sleep, which principally comes from a stage that we call rapid eye movement sleep or REM sleep, dream sleep actually provides at least two benefits for the brain.

The first is actually creativity, because it's during REM sleep and dreaming specifically when the brain starts to collide all of the information that you've recently learned together with all of this back catalog of autobiographical information that you've got stored up in the brain. And it starts to build novel connections, it's almost like group therapy for memories. And through this pattern of informational alchemy at night, we create a revised mind wide web of associations. And you can start to divine new novel insights into previously unsolved problems, so that you wake up the next morning with new solutions, and it's probably the reason that no one has ever told you that you should stay awake on a problem. Instead, people tell you to sleep on a problem. And we now have good evidence that it's dream sleep that gifts you that type of informational wisdom rather than simply knowledge.

The second benefit of dream sleep is essentially a form of overnight therapy. It's during dream sleep where we start to actually take the sting out of difficult, even traumatic, emotional experiences that we've been having. And sleep almost divorces that emotional, bitter rind from the memory experiences that we've had during the day. And so that we wake up the next morning feeling better about those experiences. So you can think of dream sleep as emotional first aid and it sort of offers this nocturnal soothing balm that smoothes those painful stinging edges of difficult experiences. So it's not time that heals all wounds, but it's time during dream sleep that provides you with emotional convalescence.