By Jessica Ravitz, CNN

He's a self-proclaimed prophet who called his bed an altar.

He wore robes, grew his beard long and penned a rambling manifesto.

He said he received revelations and was destined to take 49 wives.

And he is on federal trial for kidnapping Elizabeth Smart, now 23, and moving her across state lines for sex.

The lawyers for Brian David Mitchell do not dispute that he abducted Smart, then 14, and held her captive for nine months. But they say his religious beliefs were delusions, that their client was insane and therefore cannot be held responsible for his actions.

Smart, in her courtroom testimony last week in Utah, countered that he "used religion…to justify everything." And that is the prosecution's case: that Mitchell's religious "revelations" were all self-serving.

Jurors will have to decide: To find Mitchell insane, they must believe that he suffered from mental illness or defect at the time he kidnapped and held Smart captive, and that it kept him from knowing that what he was doing was wrong. Or they may find him guilty; that he used his purported beliefs to justify his crimes.

It is a long-awaited and complicated trial, one likely to focus more on the letter of the law than the veracity of faith. But this is certain: When it comes to determining competency vs. criminality, religious beliefs are sometimes central to the debate.

"One man's vision is another man's delusion. One person's cult is another person's spiritual path," said BJ Gallagher, a sociologist and author who lives in Los Angeles, California. "In cases where God's guidance is invoked, we need to proceed very carefully."

Read Mitchell's "Declaration of Our Faith"

In courtrooms, the responsibility of determining motivation belongs to experts and jurors.

Andrea Yates, the Texas mom who drowned her five children in a bathtub in 2001, believed they "were 'stumbling' into the throes of the devil and were going to burn in the fires of eternity," said Richard Bonnie, a University of Virginia law professor, reading from his criminal law teaching book. "By killing them, she would save them from this fate. … Satan would be vanquished."

Yates was found, in her second trial, to be not guilty of the murders by reason of insanity.

Bonnie also pointed to a 1975 case in which a rural Virginia woman killed her own aunt - the person who had raised and loved her - because she believed her aunt had been possessed by the devil.

"Everyone knew she was severely mentally ill. Her aunt had wanted to help her," Bonnie said. "Her delusion was absolutely rooted in religious beliefs."

Delusions aside, differences in faith can be viewed with tolerance or inspire criticism - and sometimes even criminal charges. Take, for instance, Christian Scientists who've refused medical treatment for their children - opting instead for prayer. Or consider followers of Santeria who practice animal sacrifice. Practitioners of both have faced prosecution.

"Who sets the standard of what’s acceptable?" said Gary Laderman, a professor of religion and American culture at Emory University and director of the online magazine Religion Dispatches. "When you look at the history of religion, those boundaries are not clear and are often contested."

Gallagher agreed, pointing out that what is accepted among the mainstream wasn't always so.

"Jesus was branded as a lunatic by those in political power at the time. Galileo was excommunicated from the church and almost put to death for being a heretic. Great spiritual teachers and visionaries are often branded as 'crazy' by the larger society in which they live," she said. "Is there any way in a pluralistic society like ours to have any measure of consensus on right and wrong, good and bad, mental illness and spiritual vision?"

There may not be. But delusions "quite often" manifest themselves in a religious way, said Bonnie, who in addition to teaching directs his university’s Institute of Law, Psychiatry and Public Policy.

This happens because delusional beliefs are tied to a person's culture and what they know, and we live in a religious society, he explained. "Religion is not the defense. It's a question of untangling the religious motivations of what they're doing from perhaps the pathological features. Is there mental illness there?"

Xavier Amador, a clinical psychologist and professor at Columbia University, has worked to answer the question Bonnie poses in a number of criminal cases. He's evaluated Unabomber Ted Kaczynski, convicted terrorist Zacarias Moussaoui and Wanda Barzee, Mitchell's legal wife at the time of Smart's abduction and captivity.

Like Bonnie, Amador said delusions take the form of the world in which a person operates.

John Nash, the mathematician who was the subject of the film "A Beautiful Mind," is an example, Amador said. Nash's paranoid schizophrenia manifested itself in a flurry of equations, the deciphering of codes and fears that he was being watched.

Mitchell grew up in The Church of Jesus Christ of Latter-day Saints, although he later renounced the mainstream church, turned fanatical and was excommunicated from the LDS Church. But because Mormons believe people can receive revelations from God, it makes sense that Mitchell claimed revelations of his own, Amador said.

Amador is not alone in thinking this. At least one Mormon scholar has agreed.

"Our blessing is that we believe in personal revelation. Our curse is that we believe in personal revelation," Robert Millet, a religion professor and former dean of religious education at Brigham Young University, told the LDS Church-owned newspaper Deseret News in 2003, soon after Mitchell's arrest. "There is a risk associated with the position we take toward God's ability to speak to you and me."

That tension also touches other people of faith.

"Hallucinations or religious delusions are associated with organic brain diseases, like schizophrenia," said Mathew Schmalz, who teaches religious studies at the College of Holy Cross in Worcester, Massachusetts. "But a large number of people think they have personal contact with God."