Those are mathematics textbooks. The upper one is 改正洋算例題答式 巻一[Kaisei Yōsan Reidai Tōshiki Kan Ichi] Revised Example Questions and Answers of Western Mathematics Volume 1 written by 賀屋洋介 Kaya(family name) Yōsuke(male given name). It was published by 柳河梅治良 Yanagawa Umejirō in a publishing company 中外堂 Chūgaidō on March 25, 1876.
The lower one is 洋算例題答射[Yōsan Reidai Tōsha] Answers to the Example Questions of Western Mathematics compiled by 神代兼次 Kōjiro Kanetsugu and 横畠武二 Yokohata Takeji, checked by 弘鴻 Hiro Hiroshi.