Problem 9.2.6 (a)
We'll work through this as a close analogue of the assigned Problem 9.2.6 (b). We are asked whether the set $$ \{x+1,\ x^2+2,\ x^2-x-3\} $$ of polynomials is linearly independent and, if not, to express one of the polynomial as a linear combination of the others. I'll begin by encoding polynomials $$ a_nx^n+a_{n-1}x^{n-1}+\cdots + a_1x + a_0 $$ as vectors $$ \left[ \begin{array}{c} a_0\\ a_1\\ \vdots\\ a_{n-1}\\ a_n \end{array} \right]. $$ This means that our vectors are $$ \left[ \begin{array}{r} 1\\ 1\\ 0 \end{array} \right] ,\quad \left[ \begin{array}{r} 2\\ 0\\ 1 \end{array} \right] \quad\text{and}\quad \left[ \begin{array}{r} 3\\ -1\\ 1 \end{array} \right]. $$ To determine whether they're linearly dependent, follow the procedure in Example 9.18: collect those vectors together as the columns of a matrix $$ A= \left[ \begin{array}{rrr} 1&2&3\\ 1&0&-1\\ 0&1&1 \end{array} \right], $$ and solve the homogeneous system $Ax=0$; if you get a unique solution, you're linearly independent; if not, then dependent. We've seen repeatedly how to solve linear systems in SymPy:
from sympy import *
from sympy.solvers.solveset import linsolve
init_printing(use_latex='mathjax')
x1, x2, x3 = symbols('x1, x2, x3')
linsolve(Matrix(([1, 2, 3, 0], [1, 0, -1, 0], [0, 1, 1, 0])), (x1, x2, x3))
That matrix I entered is the extended matrix of the homogeneous system: $A$ above, with an extra all-$0$ column on the right. The unique solution returned by SymPy tells me that we're linearly independent, so we're set.