How does the teaching of Zen compare with that of the two main schools of Mahayana, namely, Yogacara and Madhyamika? [1, 2, 3]
A founder of Yogacarya
and a Ch'an Patriarch
From the Mahayana viewpoint, the only real differences between Zen and conventional Buddhism are the unique techniques applied and the unconventional expressions used by Zen in illustrating the Prajna-truth of the mind-essence. Zen agrees with the basic philosophy of both Yogacara and Madhyamika and embraces the essence of both these teachings. First let us see in what way Zen resembles Yogacara.
Yogacara and Zen
The Mind-only (Vijnaptimatra) philosophy of Yogacara is summarized by Hsuan Chuang  in his translation-composition of Chen Wei Shih Lun  as follows: "No dharmas [Endnote 3-8] found in either Sangsara or Nirvana are apart from consciousness. Some of them can be ascribed to the self-forms of consciousness; others to the counterparts of and the objects transformed by consciousness; and others to the divisions, realms, and essence of consciousness." [Endnote 3-9] The first and the last are the most important points of the Mind-only philosophy. Through them we can clearly see the parallels between Zen and Yogacara.
[4. Hsüan-tsang (c. 602-664) en.wikipedia.org/
[5. "Discourse on the Perfection of Consciousness-only". en.wikipedia.org/
According to Yogacara, each of the Eight Consciousnesses [Endnote 3-10] has three functional divisions: [Endnote 3-11] first, the objective or seen portion (laksana-bhaga), equivalent to what the epistemologists call sense-data; second, the subjective or seeing portion (darsana-bhaga), the cognitive faculty which many philosophers erroneously take as the mind per se; and, third, the self-witnessing portion (saksatkari-bhaga).
This self-witnessing or self-awareness portion is considered by Yogacara as pure consciousness itself, while the other two portions are considered to be merely false imaginings created by consciousness through its habitual patterns. This emphasis on the self-awareness portion is of great importance, and of far-reaching effect, especially from the practical viewpoint. It is also found in Zen.
Zen Master Shen Hui (668-770)  said: "The one word 'knowledge' (chih) is the gateway to all mysteries." [Endnote 3-12] What he meant here by chih was deep self-awareness or Prajna-intuition, as Dr. Suzuki has rightly pointed out in his "Reply to Hu Shih." [Endnote 3-13]
This chih, or self-awareness, is intrinsically nondualistic. It can be aware of itself, and can be aware as such, without any outer object as an indispensable "reliance" or stimulus whereby thoughts within the dualistic pattern are brought into play. Thus the retaining of self-awareness will automatically stop the functioning of the first portion (the objective known) as well as the second portion (the subjective knowing). The cultivation of self-awareness or pure consciousness will thus eventually annihilate all dualistic thoughts and bring one to Buddhahood. This is the core of Yogacara and the reason why both Yogacara and Zen claim the importance of seeing one's mind-essence by warding off the dualistic pattern of thought.
Both Zen and Yogacara claim that no dharmas exist apart from the mind, of which they are manifestations and images. The only difference between Zen and Yogacara is their ways of approaching and expressing the same truth. For instance, Yogacara explains the states of mind through an analytical approach in a pedantic and somewhat wearying manner. With great patience it goes into all details and classifications of every state of mind, whereas Zen expresses them in a more lively and dramatic way. In contrast to Yogacara's detailed descriptions as to how the Alaya (storehouse) consciousness conjures up the outer world, projects its own images, holds the seeds-of-names-and-forms, seeds-of-habitual-thoughts, etc., Zen explains the same truths in a very simple and illuminating way.
This art of elucidating the profound and obscure Truth through simple and lively words is found in many Zen stories. Hui Neng's (638-713) [7a, 7b] remark on the moving flag and wind is a typical example: "Two monks were arguing whether it was the wind or the flag that was moving. For a long time they could not settle the problem. Then Hui Neng arose from the audience and said: 'It is neither the wind, nor the flag, but the mind that moves.' " [Endnote 3-14] In contrast to Yogacara, Zen explains the profoundest truth in the simplest language and the easiest manner.
Another sharp contrast between Yogacara and Zen is that the former takes the gradual approach toward Enlightenment, while the latter goes straight ahead to grasp it directly. The gradual approach of Yogacara is typified by its meditation process, called "Observation on the Mind-only Doctrine in Five Steps," as systematized by K'uei Chi (632-682). The third is the crucial step. It is called "reducing the offshoots to the main consciousness." In this stage the student is taught to strip off the first and second portions and come to self-awareness. The fourth step is called "curtailing the inferior and unfolding the superior consciousness." In this stage the student is taught to absorb himsef in pure consciousness and dissociate himself from the functional activities. The fifth stage is called "discarding the forms and realizing the nature of consciousness," "forms" meaning the "shadow" or the "clinging" of pure consciousness. In other words, one cannot fully realize the nature of ultimate Reality until he has annihilated all the inborn and acquired clingings, including those to the ego and the dharmas. These progressive stages of unfolding pure consciousness remind us of the famous Zen Master Te Shan's remark: "If you do not understand, I'll give you thirty blows, and if you do, I'll give you thirty blows just the same." [Endnote 3-15]
It is easy to understand the justification of being struck if one does not understand the truth. But why does one deserve a blow after his enlightenment? Superficially, it seems to be the Master's intention to test the disciple, but when we think about it, do we not sense that the blow given after one's enlightenment is aimed at bringing the disciple up to a stage of further enlightenment by driving him out of clinging to the shallow experience that he hitherto had attained? Zen Masters seldom explain their intention plainly if they can help it. They love to act rather than explain, to demonstrate rather than expound. Here and here only does Zen sharply differ from Yogacara.
Madhyamika and Zen
The outstanding and unique contribution of Buddhism to philosophy is its vast and profound teaching of Voidness (Sunyata).  Glancing over the history of philosophy, both Eastern and Western, it is difficult to find a school of thought that can equal Buddhism on this subject.
It seems that one of the main interests that has inspired the philosophers and theologians of the West to search after Truth is this: What is existence and how do things exist? We may even go so far as to say that this is the springboard of Western philosophies. In contrast to this "emphasis on the study of existence," Buddhism has put all its stress on the "study of voidness, on non-existence." Present-day Western thinkers may not yet have seen clearly the importance and significance of Sunyata, for it was only recently that this philosophy was introduced to the West, except in fragments through limited translations of Buddhist texts. While the whole field of Sunyata studies remains to be fully explored by Western thinkers, the philosophy of Voidness has been of incalculable influence on both Buddhist and non-Buddhist thinkers throughout Asia, as history has shown.
When Sunyata was practiced and speculated upon in the old days of Buddhist history, the theory of non-ego (anatman)  and the thought of the "Nirvana without residue" (nirupadhisesanirvanam) were formulated, and many Arhats were also produced.
When Sunyata was examined by the analytical-minded Yogacara scholars, the Mind-only philosophy with its theory of the twofold Voidness, together with the elaborate system of Buddhist psychology, was founded. When it conjoined with Tantra,  the Diamond Vehicle (Vajrayana)  emerged.
When thoroughly absorbed into the minds of the faithful and candid Tibetans, it overwhelmed them and finally superseded the ritualistic Tibetan Tantrism, giving birth to the widely practiced teaching called "the Mind-essence Practice" (Tibetan, sems ngo) of the rNyin-ma and bKar-gyud schools. [12, 13]
[13. en.wikipedia.org/wiki/Kagyu ]
When Sunyata is treated not as a game of pure speculation but as the only means by which all serious problems of Buddhism can be solved, one is led to search out the practical, instead of the purely theoretical, teachings of Sunyata that help one to reach Enlightenment. This impulse was so strong and so earnest that, once conjoined with the practical Chinese mind, it could not help but produce Ch'an (Zen). It is therefore impossible to understand any form of Buddhism, especially Zen, without a thorough understanding of the philosophy of Voidness.
There is not space here to discuss in full the relation between Zen and the Prajnaparamita  of Madhyamika philosophy, so only a few Zen stories and some common sayings of Prajnaparamita will be given to illustrate the similarities between the two.
Madhyamika (Middle Way) is also called the Doctrine of Voidness. Its central philosophy is the study of Voidness, but Voidness is difficult to describe or define in its direct and unmistakable sense. The human mind is completely and helplessly bound up with the belief in existence. Forms of human thought – good or bad, shallow or profound, synthetic or analytical – all are produced by "clinging to the dharmas" which makes Voidness inaccessible to the mind. As a consequence, the use of any word or idea to define, or even describe, Voidness is sure to fail.
We can best describe it only through implication. For instance, "void" means containing no-thing, etc. No matter how hard we try, we can describe or define Voidness only through the annulment of existence, although this is obviously an indirect and useless approach. The definition brought out in this way can never be positive and satisfactory in meaning. The very absence of a positive definition of Voidness reflects the truth and the practical value of the Eight Negations of Madhyamika. [Endnote 3-16]
Although Voidness can be reached through both negation and assertion, as many Zen stories show, the best avenue of approach for most people is through negation. Negation is the best antidote for the inherited overbearing tendency toward the ego- and dharma-clingings of the mind. Thus these Eight Negations, given in the Madhyamika Sastra, should be treated not as negative philosophy, but as instructions with practical value for Prajna-meditation. The ultimate Truth is expressed here through absolute negation. This is called "to illustrate through negating," which is a favorite method widely used by Zen Masters. We may even go so far as to say that the majority of Zen koans were based on this approach.
The ingenious Zen masters used colorful phrases and expressions to illustrate the Prajna-truth. Tou-to [w] is a very good example. Tou means "to penetrate or break through," to means "to release or to strip off." To break through the walls of clinging and to strip off dualistic conceptions is the only way to obtain Enlightenment.
[Letters refer to the Appendix of Chinese characters.]
The purpose of preaching the Eight Negations, Eighteen Voidnesses, etc., in sastras and sutras was merely to make us break through and strip off! But note how easy and how simple the Zen expression is: the bulky literature of Prajnaparamita and Madhyamika is explained in two words! In short, the teaching of Madhyamika is in essence identical with that of Zen, the only difference being that Zen expresses it in a more practical and lively manner. The blows and the unexpected answers of Zen that "knock one out" are a more direct and more practical method than the Eight Negations and Eighteen Voidnesses, etc., ever could offer. They carry one right to the heart of Prajna-truth.
The Sixth Patriarch asked Huai Jang (?-775): "Where do you come from?" Huai Jang replied: "I come from Mount Su." The Patriarch said: "What is it and how does it come?" Huai Jang answered: "Anything I could say would miss the point." [Endnote 3-17]
In contrast to the Eight Negations, this remark is surely more explicit and direct in illustrating the undefinable and incomprehensible nature of Prajna.
* * *
A monk asked Chao Chou (778-896)  "All things are reducible to one – to what is the one reducible?"
Chao Chou (778-897)
Does this question not typically reflect the profound aspect of the "Thoroughness of the Void," which transcends all monotheistic principles and characterizes Buddhism as a "super" religion? But Chao Chou replied: "When I was staying at Chin Chou, I made a robe of cloth weighing seven chin." [Endnote 3-18]
How illogical this answer seems to be, and how stupid the idea that one would make a nine-pound robe to wear! This statement, which makes no sense whatsoever to an intellectual, sounds very stupid even to the most ordinary man. But if we think about it carefully, this down-to-earth, seemingly stupid statement demonstrates vividly the limitations of human thought – solidly molded in derivative and sequential patterns. It suggests that we should go beyond conceptualization to get the unanswerable question answered. Chao Chou was indeed a remarkable Master, but sometimes he was too profound to be understood.
Even Huang Po (?–850)  failed to follow him, [Endnote 3-19] while Hsueh Feng (822-908)  called him the ancient Buddha and bowed to him at a distance when he was asked to comment on him. [Endnote 3-20]
[16. Huang Po: en.wikipedia.org/wiki/
[17. Hsüeh-feng I-ts'un: en.wikipedia.org/wiki/
On the other hand, Zen stories and sayings do not shock or puzzle Madhyamika scholars. They merely find the Zen approach interesting, with some good as well as some bad points. They perceive, too, that there is a great danger of falling into nonsensical talk without inner understanding of the subject. This is what has actually happened in Zen, whose Masters called this type of worthless imitation "Zen from the mouth." To Madhyamika scholars, the Zen claim of the Buddha's being a stick of dry dung is neither sacrilegious nor surprising, for they know what the Prajnaparamita-hrdaya Sutra  says so very clearly: "The void nature of all dharmas is not arising or extinction, not pure or impure, not increasing or decreasing ... " If one understands that reality is neither pure nor impure, he finds the Buddha in the dung as well as in Heaven. [Endnote 3-21]
In closing our review of Madhyamika and Zen, we may draw the following conclusion: The study of Zen leads to a better understanding of Madhyamika and the study of Madhyamika will lead to a better understanding of Zen.