Problem with creating page for the path of page display of a view
I infer: you have created the view for listing the contents of library content type, now you are embedding that view in the page template file for theming the contents listed on the page created by view. If this is the case than you are doing the things in incorrect way.

Possible cases for creating the template file for views page:
1. Theme the contents rendered by views on http://www.yourdomain.com/library page: For this you need to create template file as per the views template suggestion, also its best to create the template for view from the suggestion generated by view at Theme: Information as below:


The suggestions for creating the template in the below image is based upon the "test-contact" page I have created in views:


2. Theming the content created for library content type: If you want to theme the contents that is rendered while creating a nodes of library type than you need to create the node--library.tpl.php. This template will be just for theming the contents of library content type created originally (not for the content listed on library page created from views) and it wont have any impact on your views page.


  Now coming to your issue of page at `library/math' does not show math books: 



Check if the result in your created view displayed correctly (to confirm that the contextual filter is working fine) on passing math as argument to "Preview with contextual filters" (present at bottom of view).
Make sure that the path of page that you are creating from view is
/library, and for testing purpose you can try changing the path
temporarily to /library123 (If changing the path, than test the
result at yourdomain.com/library123/math page)
Remove the template you have created for embedding the view (as it doesn't seems to be needed, at least as of now)
Clear the cache and check again (not needed logically but no problem for testing purpose)