Putting rock salt down the toilet or into your sewer line can kill roots on contact by drying the roots out.
I've used rock salt successfully to kill tree roots and other roots in my sewer line and you can also use chloride or copper sulfate in the drain to kill tree and other roots in the sewer line too.
Just don't pour too much rock salt at a time into the sewer line otherwise it could create a blockage but just putting a little bit into the toilet or into a clean out in your yard in the sewer pipe can help to dry the tree roots out and kill them.
However if you have a large tree root penetrating the sewer line and blocking it then you need to dig the sewer line up and replace the section of sewer pipe and cut the tree root away from it.