Yinyangshu 陰陽書 "The Book of Yin and Yang" is an ancient book on physics revised during the Tang period 唐 (618-907) by Lü Cai 呂才 (606-665). It is mentioned in the imperial bibliography Jingji zhi 經籍志 in the official dynastic history Jiutangshu 舊唐書 with a length of 50 juan, and in the Xintangshu 新唐書, where a length of 53 juan is indicated. During the Song period 宋 (960-1279) the text was already lost, but in the bibliographic chapter in the Songshi 宋史, it is mentioned as a fragmentary text with the length of one fascicle.
Surviving quotations are to be found in the collection Yuhanshanfang jiyi shu 玉函山房輯佚書 by the Qing-period 清 (1644-1911) scholar Ma Guohan 馬國翰 (1794-1857). Part of these were to be found in the literary collection Quantangwen 全唐文. Additional fragments came to light in manuscript discovered in Dunhuang 敦煌, but it remains unclear whether these belong to Lü Cai's original book. The postface is dated 861 and explains that the text was written by the magicians Fan Ziying 范子盈 and Fan Jingjun 氾景詢. The Dunhuang fragements deal with the daily position of the "human spirit" (renshen 人神) and the prognostication of human life with the help of the "twelve direct auspices" (shi'er zhi jixiong 十二直吉凶) and the "seven stars" (qixing 七星). The basic tenor of the book was to ascertain that there was no fate or destiny, but that luck and fortune all depended on man himself (shi guan zhu ren 事關諸人).
In the Jiutangshu catalogue and the biography of Lü Cai himself, the names of three chapters are mentioned that were called Xu zhaijing 敘宅經, Xu luming 敘祿命 and Xu zangshu 敘葬書 (making his writings just continuations of older texts), while the Xintangshu calls them Buzhai 卜宅經 "On divination for houses", Luming pian 祿命篇 "Chapter on fate and emolument" and Zangpian 葬篇 "Chapter on burials".
The biography of Lü Cai in the Jiutangshu says that Emperor Taizong 唐太宗 (r. 626-649) felt that the transmitted Yinyangshu was full of errors and therefore ordered Lü Cai to revise this text and to adapt it to contemporary circumstances. With a staff of more then ten persons, Lü revised the old version and produced, after fifteen years of work, a 55-juan-long text, 47 of which were from the original text.
From the surviving fragments it can be seen that Lü Cai in many respects modernized the ancient text and made it more scientifical. He contradicted, for instance, the ancient belief that the family name had influence on the luck of a site and on the fortune of its inhabitants and rejected the superstition that the astrological sign of the day on which a person was buried had any impact on the happiness of his/her descendants.