Assalamualaikum ustaz. Is it permissible for a wife to ask for a divorce if her husband is mentally ill?
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
Indeed, Allah SWT created humans naturally to be in pairs. Hence, the shariah encourages people to get married with the purpose of celebrating this natural human part. Allah SWT states:
وَمِنْ آيَاتِهِ أَنْ خَلَقَ لَكُمْ مِنْ أَنْفُسِكُمْ أَزْوَاجًا لِتَسْكُنُوا إِلَيْهَا وَجَعَلَ بَيْنَكُمْ مَوَدَّةً وَرَحْمَةً ۚ إِنَّ فِي ذَٰلِكَ لَآيَاتٍ لِقَوْمٍ يَتَفَكَّرُونَ
“And of His signs is that He created for you from yourselves mates that you may find tranquillity in them, and He placed between you affection and mercy. Indeed, in that are signs for a people who give thought.” 
Imam al-Qurthubi in his commentary stated: What is meant with the word al-mawaddah and al-rahmah is the feeling that connects between two people (husband and wife). Ibn Abbas R.Anhuma interpreted al-mawaddah as the feeling of love of a husband for his wife. While al-rahmah is the feeling of empathy from a man from ever hurting or harming his wife. 
Originally, it is impermissible for a wife to ask for a divorce from her husband without reasons permitted by syarak. From Thauban RA, Rasullullah PBUH said:
أَيُّمَا امْرَأَةٍ سَأَلَتْ زَوْجَهَا طَلَاقًا مِنْ غَيْرِ بَأْسٍ فَحَرَامٌ عَلَيْهَا رَائِحَةُ الجَنَّةِ
“If any woman asks her husband for divorce without some strong reason the fragrance of paradise will be forbidden to her.” 
Syeikh Muhammad Hasan Abd al-Ghaffar in his book al-Qawaid al-Fiqhiyah  stated: If a woman asked for divorce without valid reasons, then it could harm her husband while the Islamic legal maxim stated:
لاَ ضَرَرَ وَلاَ ضِرَارَ
“There is no injury nor return of injury.”
It is the obligation of every couple to understand the needs of each other, for the value of marriage especially the ones that are built on the foundation of love and care should be based on the basis of responsibility and to attain the great rewards from Allah SWT, for their immense patience and understanding. Allah SWT states:
وَعَاشِرُوهُنَّ بِالْمَعْرُوفِ فَإِنْ كَرِهْتُمُوهُنَّ فَعَسَى أَنْ تَكْرَهُوا شَيْئًا وَيَجْعَلَ اللَّهُ فِيهِ خَيْرًا كَثِيرًا.
“And live with them in kindness. For if you dislike them – perhaps you dislike a thing and Allah makes therein much good.” 
Syeikh al-Maraghi in his commentary said: “In the word ‘mu’asyarah’ there is the meaning of interaction and fairness, which means you (the men) should treat them with ma’ruf (kindness) and they should also be kind. And it is obligatory for every couple to be the happiness and ease in the hearts of their spouse and makes him/herself the reason of softness and happiness in their lives and home together.”
We should know that the original ruling for divorce (talaq) is permissible in Islam but makruh (disliked by syarak). This is based on a hadith from Ibn Umar R.Anhuma, where Rasullullah PBUH said:
أَبغَضُ الحَلاَلِ إلى اللهِ عزَّ وجلَّ الطَّلاَقُ
“The lawful thing which God hates most is divorce.” 
- This is when a man committed al-Ila’ (الْإِيْلَاءْ)  and the duration of it has ended.
- There are three situations for this ruling:
- If the wife can no longer commit to serving her husband and her character becomes bad.
- The husband neglects to provide and fulfilling the rights of his wife because of hatred or others.
- The wife failed to maintain her honour and dignity from other men (cheated and others).
- If the wife is still committed to her tasks as a wife. Or wanting a divorce due to trivial matters. Then husband and wife should bear patience and stay married. They should continue to do good and be kind towards their spouse to attain the rewards from Allah.
- If there is a reason accepted by syarak but it is prioritized if the husband defends his marriage and continue to do good and be kind, respond to the bad behaviour of his wife with empathy and care, protecting the family and marriage’s harmony, maintain the welfare of their children and relationship with the in-laws.
- To divorce one’s wife when she is menstruating when they had had intercourse, or when she is pure but has just had intercourse with, for there is a possibility that the wife is pregnant.
Likewise, syarak set the rights of a wife to ask for fasakh when the husband suffered a debility. Among the debilities is insanity due to brain damage. If the husband is insane, then she can get divorced through fasakh to save herself from the dangers of an insane man, without needing istihkam (diagnosis or examination), for the danger is always present. 
According to the above question, in our opinion, it is best to discuss with medical experts regarding the mental illness or condition of your husband. If it is treatable and doesn’t pose any danger to the family, then it is prioritized for the wife to continue living with her husband. Remember the story of the wife of the Prophet Ayyub AS who was very loyal in taking care of her husband when Prophet Ayyub AS was sick and poor. This is the source of good and rewards from Allah SWT.
Consequently, if the sickness is untreatable, hard to manage and even pose a threat to the wife and children, then it is not an offence for the woman to ask for a divorce or fasakh for the reason of protecting her life which is sabit according to syarak. In this situation, the husband should be placed in the appropriate Mental Health Hospital to protect the maslahat of herself and prevent mafsadah for her family. Wallahu a’lam.
May Allah SWT ease all our affairs and grant us goodness on every test that we face. Amin.