# Finding how to decompose a polynomial with respect to a polynomials' basis

This is the question from my textbook: Represent the vector with respect to the basis $$x^2+x^3,\; \mathbf{B} = \langle 1, 1+x, 1+x+x^2, 1+x+x^2+x^3 \rangle$$

The explanation from the solution is that it is "easily solved by eye to give $$c_{4}=1, c_{3}=0, c_{2}=-1 \;and \;c_{1}=0$$"

I don't understand how they solved it by looking at it. My attempt was to set up a linear combination: $$c_{1}(1)+c_{2}(1+x)+c_{3}(1+x+x^2)+c_{4}(1+x+x^2+x^3)=x^2+x^3$$ Can someone clarify if this would be the correct first step if I were to solve it by systems of equations? I got stuck on not knowing what I would set the equations equal to.

• "I got stuck on not knowing what I would set the equations equal to." Given two polynomials $f(x)$ and $g(x)$, do you know how to tell when they are equal? May 27 at 14:30
• You have $1+x+x^2+x^3$ and $1+x$ in your basis. May 27 at 14:31
• There is only one basis vector with $x^3$, so you will definitely need that one. Next, you get $x^2$ for free in that vector. Next you want to get rid everything except $x^2+x^3$, so you look for other vectors to do that. May 27 at 14:33
• Now... to be fair, there can and will be times where it is not so easy to tell what coefficients are needed. $x^2+x^3$ happened to be an easy example, but what would you do if it were $24+7x-32x^2+8x^3$? I wouldn't be able to quickly spit out the numbers without putting in at least some thought. For that, yes you do set up an equation and you use the techniques you should have been studying in class to solve. Matrices in particular are a powerful tool to describe these sorts of problems and find solutions. May 27 at 14:33
• "they can be set to zero so it's independent" I don't understand that sentence and it doesn't sound like you understand independence correctly. To be clear, $v_1,v_2,v_3,\dots,v_k$ are independent if and only if the only solution to $c_1v_1+c_2v_2+\dots+c_kv_k=0$ is when $c_1=c_2=c_3=\dots=0$. To emphasize, $c_1=c_2=\dots=0$ is always a solution regardless of if the vectors are independent or not. The question is if that is the only solution and no other solution exists. May 27 at 14:47

I think you just have been caught by tunnel vision and you are not being able to see why it can be solved by just looking at it.

However since you have doubts regarding how to solve in a general scenario , I will provide an explanation.

$$c_{1}(1)+c_{2}(1+x)+c_{3}(1+x+x^2)+c_{4}(1+x+x^2+x^3)=x^2+x^3$$

Then you procede to isolate the coefficients in order of the degree of monomial, which is just a fancy way speaking about the following step.

$$(c_{1}+c_{2}+c_{3}+c_{4})\cdot 1 + (c_{2}+c_{3}+c_{4})x+ (c_{3}+c_{4})x^{2}+c_{4}x^{4}=x^{2}+x^{3}$$.

Two polynomials written in the form $$\sum_{i=0}^{n}a_{i}x^{i}$$ and $$\sum_{i=0}^{m}b_{i}x^{i}$$ are equal precisely when $$n=m$$ and $$a_{i}=b_{i}\,,\forall i\in\{1,2,..,n\}$$

So now you can compare the coefficients and conclude $$c_1+c_2+c_3+c_4=0, \,c_2+c_3+c_4=0, \,c_3+c_4=1, \,c_4=1\;\tag{2}$$

And you solve this system of equations in $$4$$ variables .

Or you can solve using matrices by considering matrix equation

$$\begin{bmatrix} 1& 1 & 1&1 \\ 0 &1 &1 &1 \\ 0&0&1&1 \\ 0 & 0& 0& 1\end{bmatrix}\cdot \begin{bmatrix} c_{1} \\c_{2} \\ c_{3} \\ c_{4}\end{bmatrix} =\begin{bmatrix} 0 \\ 0 \\ 1 \\ 1 \end{bmatrix}$$

Which you can do by Gaussian Elimination or Row echelon form or whatever method you like.

So in general given a harder polynomial, to express in terms of a particular basis you can apply the above steps .

$$x^2+x^3,\; \mathbf{B} = \langle \,\underbrace{1}_{p_1}\,, \,\underbrace{1+x}_{p_2}\,, \,\underbrace{1+x+x^2}_{p_3}\,, \,\underbrace{1+x+x^2+x^3}_{p4}\, \rangle$$

This one is "easily solved by eye", as they say, since you can "see" that $$\,x^2+x^3 = p_4 - p_2\,$$.

Even if it weren't, though, it's still easy to convert any polynomial to this base, if you "see" that:

$$1 = p_1\,,\; x = p_2 - p_1\,,\; x^2 = p_3-p_2\,,\; x^3 = p_4 - p_3$$

Then:

\begin{align} a + b\,x + c\,x^2 + d\,x^3 &\;=\; a\,p_1 + b\,(p_2-p_1)+c\,(p_3-p_2)+d\,(p_4-p_3) \\ &\;=\; a\, p_1 + (b-c)\,p_2 + (c-d)\,p_3 + d\,p_4 \end{align}

I don't understand how they solved it by looking at it.

"By looking at it" literally just means "looking at it"...

First of all, you must have $$c_4=1$$ since you need the $$x^3$$ term. Then by subtraction, you see that $$x^2+x^3=(1+x+x^2+x^3)-(1+x)$$ which immediately gives you the answer.

If you want to do it systematically, you already have the correct first step.

Two polynomials $$f(x)$$ and $$g(x)$$ are equal if and only if all of their coefficients are the same. You already have $$c_{1}(1)+c_{2}(1+x)+c_{3}(1+x+x^2)+c_{4}(1+x+x^2+x^3)=x^2+x^3\;.\tag{1}$$

This is equivalent to $$c_1+c_2+c_3+c_4=0, c_2+c_3+c_4=0, c_3+c_4=1, c_4=1\;\tag{2}$$ which is a system of linear equations in the unknowns $$c_1,c_2,c_3,c_4$$. It can be solved easily by starting from $$c_4=1$$ and working backward.

If you wish, you can also write (2) in terms of matrices.

• I believe you have a typo. Did you mean to subtract $1+x$? May 27 at 16:02
• @JohnDouma: Thanks for that! Edited. May 27 at 16:03