This is program of solving recursive equation of second order using sagemath+latex
First create a tex file and write program like this
then write the commands or script like this-:
where filename is name of tex file and sagemath is directory containing your sagemath package
then execute this script in terminal using sh script.sh
where script.sh is script name
and you will get output pdf filename.pdf like this