Although early madaris were founded primarily to gain "knowledge of God" they also taught subjects such as mathematics and poetry