Based on this and in reference to the question: euthanasia in its two forms described in the question is not permissible. It is considered a grave sin as attested in a mass of Prophetic reports . It is incumbent upon physicians to know that there is no obedience to other people in a matter disobedient to Allah. Whenever a patient asks this of them, they must not accede, nor [are they to] kill another person without right.
"Allah, Sublime is He, is the most merciful of all with His servants. He is even more merciful to one than his own mother, father, and everyone else. He says in His Quran: And your God is one God, no God but Him the most merciful," [2:163]. "And my mercy encompasses everything [7:156]."
The verses in the Noble Quran which revolve around this meaning are numerous, and Prophetic accounts mention this concept with vibrant clarity. The body Allah gives an individual is not a personal possession which one is free to dispose of as he wishes. Rather, it is a trust for which he will be held accountable by the Creator, glory to Him, on the Day of Judgment.
In the Quran, Allah says: "And do not throw yourselves to destruction and be good for Allah loves the good ones" [2:195]. A patient who asks his physician to end his life in one way or another is considered committing suicide (may Allah protect us!).
In their collections of authentic hadiths, al-Bukhari and Muslim related through Abu Hurayrah that the Messenger of Allah said: "Whoever hurls himself off a mountain and kills himself will be [repeatedly] hurled into the flames of Hellfire, where he will abide eternally. Whoever drinks poison and kills himself, will be in the Hellfire eternally; his poison will be in his hand and he will drink from it. Whoever kills himself with an iron blade, the blade will be in his hands and he will stab himself in the stomach in Hellfire eternally. [al-Bukhari]
Muslim and al-Bukhari reported that the Prophet said: A man from those who came before you suffered from a sore. When it caused him intense pain, he pulled an arrow from his quiver and lanced it. The blood did not stop flowing before he died. Your Lord said: I have made Paradise forbidden for him.
As for a physician terminating the life of a patient for a reason he personally deems justifiable: it is the unlawful taking of human life. Our Lord, all praise to Him says: "Whoever kills a believer deliberately, the punishment for him is hell, and there he will remain: God is angry with him, and rejects him, and has prepared a tremendous torment for him[4:93]"
Our master, the Messenger of Allah said: "The blood of a Muslim who testifies that there is no deity other than Allah and that I am the Messenger of Allah is not lawful [to shed] except for one of three reasons: [taking] a life for a life, a fornicator who has the means to be chaste [Ar. Al-thayyib al-zani], and someone who leaves Islam and abandons the majority [of Muslims]."