In new versions of boost (starting in 1.60), you can use boost::filesystem::relative. (See the documentation here.)
#include <boost/filesystem.hpp>
#include <iostream>
namespace fs = boost::filesystem;
int main()
{
fs::path parentPath("/home/user1/");
fs::path childPath("/home/user1/Downloads/Books");
fs::path relativePath = fs::relative(childPath, parentPath);
std::cout << relativePath << std::endl;
}