Various sources of sharia are used by Islamic jurisprudence to elucidate the body of Islamic law. The primary source accepted universally by all Muslims is the Qur'an, the majority adhering also to the traditionally reported Sunnah, but rejected by others; Quranism. The Qur'an is the holy scripture of Islam, believed by Muslims to be the direct and unaltered word of God. The Sunnah consists of the alleged religious actions and quotations of the Islamic prophet Muhammad, narrated through his Companions and the Imams (per the beliefs of the Sunni and Shi'ite schools respectively).
As Islamic regulations stated in the primary sources do not explicitly deal with every conceivable eventuality, jurisprudence must refer to resources and authentic documents to find the correct course of action. According to Sunni schools of law, secondary sources of Islamic law are consensus, the exact nature of which bears no consensus itself; analogical reason; pure reason; seeking the public interest; juristic discretion; the rulings of the first generation of Muslims; and local customs.Hanafi school frequently relies on analogical deduction and independent reasoning, and Maliki and Hanbali generally use the Hadith instead. Shafi'i school uses Sunnah more than Hanafi and analogy more than two others. Among Shia, Usuli school of Ja'fari jurisprudence uses four sources, which are Qur'an, Sunnah, consensus and the intellect. They use consensus under special conditions and rely on the intellect to find general principles based on the Qur'an and Sunnah, and use the principles of jurisprudence as a methodology to interpret the Qur'an and Sunnah in different circumstances. Akhbari Ja'faris rely more on tradition and reject ijtihad. According to Momen, despite considerable differences in the principles of jurisprudence between Shia and the four Sunni schools of law, there are fewer differences in the practical application of jurisprudence to ritual observances and social transactions.
The Qur'an is the first and most important source of Islamic law. Believed to be the direct word of God as revealed to Muhammad through angel Gabriel in Mecca and Medina, the scripture specifies the moral, philosophical, social, political and economic basis on which a society should be constructed. The verses revealed in Mecca deal with philosophical and theological issues, whereas those revealed in Medina are concerned with socio-economic laws. The Qur'an was written and preserved during the life of Muhammad, and compiled soon after his death.
The verses of the Qur'an are categorized into three fields: "science of speculative theology", "ethical principles" and "rules of human conduct". The third category is directly concerned with Islamic legal matters which contains about five hundred verses or one thirteenth of it. The task of interpreting the Qur'an has led to various opinions and judgments. The interpretations of the verses by Muhammad's companions for Sunnis and Imams for Shias are considered the most authentic, since they knew why, where and on what occasion each verse was revealed.
The Sunnah is the next important source, and is commonly defined as "the traditions and customs of Muhammad" or "the words, actions and silent assertions of him". It includes the everyday sayings and utterances of Muhammad, his acts, his tacit consent, and acknowledgments of statements and activities. According to Shi'ite jurists, the sunnah also includes the words, deeds and acknowledgments of the twelve Imams and Fatimah, Muhammad's daughter, who are believed to be infallible.
Justification for using the Sunnah as a source of law can be found in the Qur'an. The Qur'an commands Muslims to follow Muhammad. During his lifetime, Muhammad made it clear that his traditions (along with the Qur'an) should be followed after his death. The overwhelming majority of Muslims consider the sunnah to be essential supplements to and clarifications of the Qur'an. In Islamic jurisprudence, the Qur'an contains many rules for the behavior expected of Muslims but there are no specific Qur'anic rules on many religious and practical matters. Muslims believe that they can look at the way of life, or sunnah, of Muhammad and his companions to discover what to imitate and what to avoid.
Much of the sunnah is recorded in the Hadith. Initially, Muhammad had instructed his followers not to write down his acts, so they may not confuse it with the Qur'an. However, he did ask his followers to disseminate his sayings orally. As long as he was alive, any doubtful record could be confirmed as true or false by simply asking him. His death, however, gave rise to confusion over Muhammad's conduct. Thus the Hadith were established. Due to problems of authenticity, the science of Hadith (Arabic: `Ulum al-hadith) is established. It is a method of textual criticism developed by early Muslim scholars in determining the veracity of reports attributed to Muhammad. This is achieved by analyzing the text of the report, the scale of the report's transmission, the routes through which the report was transmitted, and the individual narrators involved in its transmission. On the basis of these criteria, various Hadith classifications developed.
To establish the authenticity of a particular Hadith or report, it had to be checked by following the chain of transmission (isnad). Thus the reporters had to cite their reference, and their reference's reference all the way back to Muhammad. All the references in the chain had to have a reputation for honesty and possessing a good retentive memory. Thus biographical analysis (`ilm al-rij?l, lit. "science of people"), which contains details about the transmitter are scrutinized. This includes analyzing their date and place of birth; familial connections; teachers and students; religiosity; moral behaviour; literary output; their travels; as well as their date of death. Based upon these criteria, the reliability (thiq?t) of the transmitter is assessed. Also determined is whether the individual was actually able to transmit the report, which is deduced from their contemporaneity and geographical proximity with the other transmitters in the chain. Examples of biographical dictionaries include Ibn Hajar al-Asqalani's "Tahdh?b al-Tahdh?b" or al-Dhahabi's "Tadhkirat al-huff?z."
Using this criterion, Hadith are classified into three categories:
in a shariah court a qadi (judge ) hears a case, including witnesses and evidence . then the qadi makes a ruling . sometimes the qadi consults a mufti or scholar of law, for an opinion.
All medieval Muslim jurists rejected arbitrary opinion, and instead developed various secondary sources, also known as juristic principles or doctrines[clarification needed], to follow in case the primary sources (i.e. the Qur'an and Sunnah) are silent on the issue.
The ijma' , or consensus amongst Muslim jurists on a particular legal issue, constitutes the third source of Islamic law. Muslim jurists provide many verses of the Qur'an that legitimize ijma' as a source of legislation. Muhammad himself said:
In history, it has been the most important factor in defining the meaning of the other sources and thus in formulating the doctrine and practice of the Muslim community. This is so because ijma' represents the unanimous agreement of Muslims on a regulation or law at any given time.
There are various views on ijma' among Muslims. Sunni jurists consider ijma' as a source, in matters of legislation, as important as the Qur'an and Sunnah. Shiite jurists, however, consider ijma' as source of secondary importance, and a source that is, unlike the Qur'an and Sunnah, not free from error.Ijma' was always used to refer to agreement reached in the past, either remote or near. Amongst the Sunni jurists there is diversity on who is eligible to participate in ijma' , as shown in the following table:
|School of jurisprudence||Formation of ijma'||Rationale|
|Hanafi||through public agreement of Islamic jurists||the jurists are experts on legal matters|
|Shafi'i||through agreement of the entire community and public at large||the people cannot agree on anything erroneous|
|Maliki||through agreement amongst the residents of Medina, the first Islamic capital||Islamic tradition says "Medina expels bad people like the furnace expels impurities from iron"|
|Hanbali||through agreement and practice of Muhammad's Companions||they were the most knowledgeable on religious matters and rightly guided|
|Usuli||only the consensus of the ulama of the same period as the Prophet or Shia Imams is binding.||consensus is not genuinely binding in its own right, rather it is binding in as much as it is a means of discovering the Sunnah.|
In modern Muslim usage it is no longer associated with traditional authority and appears as democratic institution and an instrument of reform.
Qiyas or analogical reason is the fourth source of the sharia for the majority of Sunni jurisprudence. It aims to draw analogies to a previously accepted decision. Shiites do not accept analogy, but replace it with reason (aql); among Sunnis, the Hanbalites have traditionally been reluctant to accept analogy while the Zahirites don't accept it at all. Analogical reason in Islam is the process of legal deduction according to which the jurist, confronted with an unprecedented case, bases his or her argument on the logic used in the Qur'an and Sunnah. Legally sound analogy must not be based on arbitrary judgment, but rather be firmly rooted in the primary sources.
Supporters of the practice of qiyas will often point to passages in the Qur'an that describe an application of a similar process by past Islamic communities. According to supporters of the practice, Muhammad said: "Where there is no revealed injunction, I will judge amongst you according to reason." Further, supporters claim that he extended the right to reason to others. Finally, supporters of the practice claim that it is sanctioned by the ijma, or consensus, amongst Muhammad's companions. Islamic studies scholar Bernard G. Weiss has pointed out that while analogical reason was accepted as a fourth source of law by later generations, its validity was not a foregone conclusion among earlier Muslim jurists. Thus the issue of analogical reason and its validity was a controversial one early on, though the practice eventually gained acceptance of the majority of Sunni jurists.
The success and expansion of Islam brought it into contact with different cultures, societies and traditions, such as those of Byzantines and Persians. With such contact, new problems emerged for Islamic law to tackle. Moreover, there was a significant distance between Medina, the Islamic capital, and the Muslims on the periphery on the Islamic state. Thus far off jurists had to find novel Islamic solutions without the close supervision of the hub of Islamic law (back in Medina). During the Umayyad dynasty, the concept of qiyas was abused by the rulers. The Abbasids, who succeeded the Umayyads defined it more strictly, in an attempt to apply it more consistently.
The general principle behind the process of qiyas is based on the understanding that every legal injunction guarantees a beneficial and welfare satisfying objective. Thus, if the cause of an injunction can be deduced from the primary sources, then analogical deduction can be applied to cases with similar causes. For example, wine is prohibited in Islam because of its intoxicating property. Thus qiyas leads to the conclusion that all intoxicants are forbidden.
The Hanafi school of thought very strongly supports qiyas. Imam Abu Hanifa, an important practitioner of qiyas, elevated qiyas to a position of great significance in Islamic law. Abu Hanifa extended the rigid principle of basing rulings on the Qur'an and Sunnah to incorporate opinion and exercise of free thought by jurists. In order to respond suitably to emerging problems, he based his judgments, like other jurists, on the explicit meanings of primary texts (the Qur'an and sunnah). But, he also considered the "spirit" of Islamic teachings, as well as whether the ruling would be in the interest of the objectives of Islam. Such rulings were based on public interest and the welfare of the Muslim community.
|"||The knowledge of ours is an opinion, it is the best we have been able to achieve. He who is able to arrive at different conclusions is entitled to his own opinion as we are entitled to our own.||"|
|-- Abu Hanifa|
The Shafi'i school of thought accepts qiyas as a valid source. Imam Shafi'i, however, considered it a weak source, and tried to limit the cases where jurists would need to resort to qiyas. He criticized and rejected analogical deductions that were not firmly rooted in the Qur'an and sunnah. According to Shafi'i, if analogical deductions were not strictly rooted in primary sources, they would have adverse effects. One such consequence could be variety of different rulings in the same subject. Such a situation, he argued, would undermine the predictability and uniformity of a sound legal system. 
Imam Malik accepted qiyas as a valid source of legislation. For him, if a parallel could be established between the effective cause of a law in the primary sources and a new case, then analogical deduction could be viable tool. Malik, however, went beyond his adherence to "strict analogy" and proposed pronouncements on the basis of what jurists considered was "public good".
The source, inspired by the principle of conscience, is a last resort if none of the widely accepted sources are applicable to a problem. It involves giving favor to rulings that dispel hardship and bring ease to people. The doctrine was justified directly by the Qur'anic verse stating: "Allah desires you ease and good, not hardship". Though its main adherents were Abu Hanifa and his pupils (such as Abu Yusuf), Malik and his students made use of it to some degree. The source was subject to extensive discussion and argumentation, and its opponents claimed that it often departs from the primary sources.
This doctrine was useful in the Islamic world outside the Middle East where the Muslims encountered environments and challenges they had been unfamiliar with in Arabia. One example of isthisan is cited as follows: If a well is contaminated it may not be used for ritual purification. Istihsan suggests that withdrawing a certain number of buckets of water from the well will remove the impurities. Analogical reason, however, dictates that despite removing some of the water, a small concentration of contaminants will always remain in the well (or the well walls) rendering the well impure. The application of analogy means the public may not use the well, and therefore causes hardship. Thus the principle of justistic preference is applied, and the public may use the well for ritual purification.
Malik developed a tertiary source called al-maslahah al-mursalah, which means that which is in the best interests of the general public. According to this source of Islamic law, rulings can be pronounced in accordance with the "underlying meaning of the revealed text in the light of public interest". In this case, the jurist uses his wisdom to pursue public interest. This source is rejected by the Shafi'ites, Hanbalites and Zahirites from Sunni jurisprudence.
Shafi'i accepted cases in which he had to be more flexible with the application of Qisas. Similar to Abu Hanifa and Malik, he developed a tertiary source of legislation. The Shafi'i school adopted istidlal or inference, a process of seeking guidance from the source. Inference allowed the jurists to avoid strict analogy in a case where no clear precedent could be found. In this case, public interest was distinguished as a basis for legislation.
Muslim scholars divided inference into three types. The first is the expression of the connection existing between one proposition and another without any specific effective cause. Next, inference could mean presumption that a state of things, which is not proved to have ceased, still continues. The final type of inference is the authority as to the revealed laws previous to Islam.
Shi'ite jurists maintain that if a solution to a problem can not be found from the primary sources, then aql or reason should be given free rein to deduce a proper response from the primary sources. The process, whereby rational efforts are made by the jurist to arrive at an appropriate ruling, when applied is called ijtihad (literally meaning "exerting oneself"). Shi'ite jurists maintain that qiyas is a specific type of ijtihad. The Sunni Shafi' school of thought, however, holds that both qiyas and ijtihad are the same.
Sunni jurists accepted ijtihad as a mechanism for deducing rulings. They, however, announced an end to its practice during the thirteenth century. The reason for this was that centers of Islamic learning (such as Baghdad, Nishapur, and Bukhara) had fallen into the hands of the Mongols. Thus, the "doors to ijtihad", were closed. In Sunni Islam, thus, ijtihad was replaced by taqlid or the acceptance of doctrines developed previously. Later in Sunni history, however, there were notable instances of jurists using reason to re-derive law from the first principles. One was Ibn Taymiyya (d. 728/1328), another was Ibn Rus?h?d (Averroes d. 595/1198).
There are many justifications, found in the Qur'an and sunnah, for the use of ijtihad. For example, during a conversation with Mu'?dh ibn Jabal, Muhammad asked the former how he would give judgments. Mu'?dh replied that he would refer first to the Qur'an, then to the Sunnah and finally commit to ijtihad to make his own judgment. Muhammad approved of this.
A lawyer who is qualified to use this source is called a mujtahid. The founders of the Sunni madhabs (schools of law) were considered such lawyers. All mujtahid exercise at the same time the powers of a mufti and can give fatwa. Some mujtahid have claimed to be muj?addid, or "renewer of religion." Such persons are thought to appear in every century. In Shi'ite Islam they are regarded as the spokespersons of the hidden Imam.
The term urf, meaning "to know", refers to the customs and practices of a given society. Although this was not formally included in Islamic law, the sharia recognizes customs that prevailed at the time of Muhammad but were not abrogated by the Qur'an or the tradition (called "Divine silence"). Practices later innovated are also justified, since Islamic tradition says what the people, in general, consider good is also considered as such by God. According to some sources, urf holds as much authority as ijma (consensus), and more than qiyas (analogical deduction). Urf is the Islamic equivalent of "common law".
Local custom was first recognized by Ab? Y?suf (d. 182/798), an early leader of the ?anaf? school. However, it was considered part of the Sunnah, and not as formal source. Later, al-Sarak?h?s? (d. 483/1090) opposed it, holding that custom cannot prevail over a written text.
According to Sunni jurisprudence, in the application of local custom, custom that is accepted into law should be commonly prevalent in the region, not merely in an isolated locality. If it is in absolute opposition to Islamic texts, custom is disregarded. However, if it is in opposition to analogical reason, custom is given preference. Jurists also tend to, with caution, give precedence to custom over doctoral opinions of highly esteemed scholars. Shi'ite scholars do not consider custom as a source of jurisprudence, nor do the Hanbalite or Zahirite schools of Sunni jurisprudence.