Some widely used medications may have significant cognitive effects, both positive and negative, according to a new study.