SageMath syntax for Section 4.6

SageMath is a free open-source mathematics software system. You can use a SageMath cell online by going here.