Different layouts for different post types in wordpress?

You can add the custom post type term to the single.php

In your case, create new files single-mathematics.php and single-mechanical.php

Copy the single.php code, paste in these files and edit it for full-width/no-sidebar. WordPress will automatically search for these files when the custom post type page is loaded.