Is cognitive science a part of behavioral science or vice versa?
The cognitive sciences are largely an element of the behavioral sciences.
The subject matter of the behavioral sciences is animal or human behavior. It is an interdisciplinary endeavor that involves a diverse set of fields such as psychology, ethology, behavioral genetics, criminology, etc.
The cognitive sciences study how the mind determines behavior via mental processes such as perception, reasoning, emotion, and volition. This also is a multidisciplinary endeavor involving neuroscience, psychology, artificial intelligence, and so on and so forth (see for example Harré, 2002). In the sense that the ultimate goal of (most) of the cognitive sciences is to explain behavior, they can be regarded as behavioral sciences. At the same time, it is clear that not all behavioral sciences focus on the mind as their explaining variable. Therefore it is the broader term.
It is important to note, however, that the cognitive sciences may investigate the mind without observing actual behavior in a given study. For example, there may be brain imaging studies without any behavioral measures. As another example, artificial intelligence research may simulate thought processes as a means to understand human reasoning, but conceptualize and measure behavior only in a very abstract sense.
Sometimes, the term "behavioral science" is used more strictly to connote a focus on behavioral experimentation and observation. This usage would exclude some research within the realm of the cognitive sciences.
Finally, there is research that may be regarded as cognitive science that is not a behavioral science in any sense of the term. A case in point is artificial intelligence research that does not aim at simulating or understanding animal or human thinking.
Harré, R. (2002). Cognitive science: A philosophical introduction. London: SAGE.
The field of cognitive science is sort of a response to behavioral science. Behavioral science focuses on the behavior, or the "output", of an organism. It is based more on observation as a general rule, and attempts to make formulations based on what can be observed. Its methods can be found most often in certain types of therapies and treatments for certain disorders, such as PTSD or phobias. In any case, its primary emphasis is on behavior and behavior change.
Cognitive science, on the other hand, focuses on cognitive processes -- namely, mental states, or the study of the mind. Thus, while behavioral science as a field focuses on animals as well as humans, cognitive science is mostly oriented towards humans. Within cognitive science, we have a bunch of different yet related technological sub-fields: artificial intelligence, computer vision, and robotics, to name a few. To formally study cognitive science, it is helpful to draw from experience in a variety of other subjects (namely formal logic, linear algebra, statistics, computer science, linguistics) that may seem unrelated at first, but actually lend insight into how the mind works as both a biological and computational system.
In the end, behavioral science (for the most part) focuses on the "output" of the organism, and cognitive science (for the most part) focuses on both the "input" and the "output", but it is a bit more curious about the input and what happens in between. If behavioral science emphasizes behavior, then cognitive science emphasizes perception. Cognitive science is also a bit more theoretical than behavioral science, though there are practical applications, and such applications are made apparent in breakthroughs in artificial intelligence, natural language processing, and even psychological counseling. I think that behavioral science lost traction after the "cognitive revolution" in the 1950s...presumably because people realized that cognitive science indeed had practical applications in science and technology, and wasn't all empirical hogwash. :)