## Change of basis

by Marco Taboga , PhD

The change of basis is a technique that allows us to express vector coordinates with respect to a "new basis" that is different from the "old basis" originally employed to compute coordinates. ## Coordinates

The problem, the change-of-basis matrix, structure of the change-of-basis matrix, inverse of the change-of-basis matrix, linear operators, effect on the matrix of a linear operator, solved exercises. The answer is provided by the following proposition. As demonstrated by the next proposition, the change of basis matrix is invertible.

Let us make an example. What happens to the matrix of the operator when we switch to a new basis? The next proposition provides an answer to this question.

Thus, the change-of-basis matrices allow us to easily switch from the matrix of the linear operator with respect to the old basis to the matrix with respect to the new basis.

Below you can find some exercises with explained solutions. ## How to cite

Taboga, Marco (2021). "Change of basis", Lectures on matrix algebra. https://www.statlect.com/matrix-algebra/change-of-basis.

Most of the learning materials found on this website are now available in a traditional textbook format.

• Point estimation
• Multivariate normal distribution
• Hypothesis testing
• Maximum likelihood
• Gamma function
• Chi-square distribution
• Binomial distribution
• Delta method
• Mathematical tools
• Fundamentals of probability
• Probability distributions
• Asymptotic theory
• Fundamentals of statistics
• Continuous random variable
• Precision matrix
• Probability density function
• Type I error
• we removed the social buttons,
• but don't forget to share .

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Linear algebra

Course: linear algebra   >   unit 3.

• Coordinates with respect to a basis

## Change of basis matrix

• Invertible change of basis matrix
• Transformation matrix with respect to a basis
• Alternate basis transformation matrix example
• Alternate basis transformation matrix example part 2
• Changing coordinate systems to help find a transformation matrix

## Want to join the conversation?

• Upvote Button navigates to signup page
• Downvote Button navigates to signup page
• Flag Button navigates to signup page ## Calculus Tutorials

Change of basis.

Let $V$ be a vector space and let $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ be a set of vectors in $V$. Recall that $S$ forms a basis for $V$ if the following two conditions hold: Let $V$ be a vector space and let $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ be a set of vectors in $V$. Recall that $S$ forms a basis for $V$ if the following two conditions hold:

Let $S = \lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ be a non-empty set of vectors. If $k_1 {\bf v}_1 + k_2 {\bf v}_2 + \dots + k_n {\bf v}_n = 0$ only when $k_1 , k_2 , \dots , k_n = 0$, then $S$ is linearly independent .

Let $V$ be a vector space and let $\lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ be a set of elements in $V$. If every vector in $V$ can be expressed as a linear combination of ${\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n$ then $\lbrace {\bf v}_1 , {\bf v}_2 , \dots , {\bf v}_n \rbrace$ spans $V$.

If $S = \{{\bf v_1,v_2, \ldots, v_n}\}$ is a basis for $V$, then every vector ${\bf v} \in V$ can be expressed uniquely as a linear combination of ${\bf v_1,v_2, \ldots, v_n}$: $${\bf v} = c_1{\bf v_1} + c_2{\bf v_2} + \cdots + c_n{\bf v_n}.$$ Think of $\left[\begin{array}{c} c_1\\ c_2\\ \vdots \\ c_n \end{array}\right]$ as the coordinates of ${\bf v}$ relative to the basis $S$. If $V$ has dimension , which is the number of vectors needed to form a basis. $n$, then every set of $n$ linearly independent vectors in $V$ forms a basis for $V$. In every application, we have a choice as to what basis we use. In this tutorial, we will desribe the transformation of coordinates of vectors under a change of basis.

We will focus on vectors in $R^2$, although all of this generalizes to $R^n$. The standard basis in $R^2$ is $\left\{\left[{1 \atop 0} \right],\left[{0 \atop 1}\right]\right\}$. We specify other bases with reference to this rectangular coordinate system.

Let $B=\{{\bf u,w}\}$ and $B’=\{{\bf u’,w’}\}$ be two bases for $R^2$. For a vector ${\bf v} \in V$, given its coordinates $[{\bf v}]_B$ in basis $B$ we would like to be able to express ${\bf v}$ in tems of its coordinates $[{\bf v}]_{B’}$ in basis $B’$, and vice versa.

Suppose the basis vectors ${\bf u’}$ and ${\bf w’}$ for $B’$ have the following coordinates relative to the basis $B$:

\begin{eqnarray*} ~[{\bf u’}]_B & = & \left[\begin{array}{c} a \\ b \end{array}\right] \qquad \\ ~[{\bf w’}]_B & = & \left[\begin{array}{c} c \\ d \end{array}\right]. \qquad \end{eqnarray*}

This means that \begin{eqnarray*} {\bf u’} & = & a{\bf u} + b{\bf w} \\ {\bf w’} & = & c{\bf u} + d{\bf w} \end{eqnarray*}

The change of coordinates matrix from $B’$ to $B$ $$P = \left[\begin{array}{cc} a & c \\ b & d \\ \end{array} \right]$$ governs the change of coordinates of ${\bf v} \in V$ under the change of basis from $B’$ to $B$. $$[{\bf v}]_B = P[{\bf v}]_{B’} = \left[\begin{array}{cc} a & c \\ b & d \\ \end{array} \right][{\bf v}]_{B’}.$$ That is, if we know the coordinates of ${\bf v}$ relative to the basis $B’$, multiplying this vector by the change of coordinates matrix gives us the coordinates of ${\bf v}$ relative to the basis $B$.

Suppose vector ${\bf v}$ has coordinates $\left[{x’ \atop y’}\right]_{B’}$ relative to the basis $B’ = \{ {\bf u’,w’} \}$. This means that $${\bf v} = x'{\bf u’} + y'{\bf w’}.$$ Substituting ${\bf u’} = a{\bf u} + b{\bf w}$ and ${\bf w’} = c{\bf u} + d{\bf w}$ into this, \begin{eqnarray*} {\bf v} & = & x'(a{\bf u} + b{\bf w}) + y'(c{\bf u} + d{\bf w}) \\ & = & (ax’ + cy’){\bf u} + (bx’+dy’){\bf w}. \end{eqnarray*} That is, \begin{eqnarray*} [{\bf v}]_{B} & = & \left[\begin{array}{c} ax’ + cy’ \\ bx’+dy’ \end{array}\right] \\ & = & \left[\begin{array}{cc} a & c \\ b & d \end{array} \right]\left[\begin{array}{c} x’ \\ y’ \end{array}\right] \\ & = & \left[\begin{array}{cc} a & c \\ b & d \end{array} \right][{\bf v}]_{B’}. \end{eqnarray*}

The transition matrix $P$ is invertible .

If a square matrix ${\bf A}$ has an inverse ${\bf A}^{-1}$, it is said to be invertible .

It can be shown that ${\bf A}$ is invertible if and only if $\det{\bf A} \neq {\bf 0}$.

For a $2 \times 2$ matrix ${\bf A} = \left[ \begin{array}{cc} a & b \\ c & d \end{array} \right], \, {\bf A}^{-1} = \frac{1}{ad-bc} \left[ \begin{array}{cc} d & -b \\ -c & a \end{array} \right].$

In fact, if $P$ is the change of coordinates matrix from $B’$ to $B$, the $P^{-1}$ is the change of coordinates matrix from $B$ to $B’$: $$[{\bf v}]_{B’} = P^{-1}[{\bf v}]_B$$

Let $B = \left\{\left[{1 \atop 0} \right],\left[{0 \atop 1}\right]\right\}$ and $B’ = \left\{\left[{3 \atop 1} \right],\left[{-2 \atop 1}\right]\right\}$. The change of basis matrix form $B’$ to $B$ is $$P = \left[\begin{array}{cc} 3 & -2 \\ 1 & 1 \end{array}\right].$$ The vector ${\bf v}$ with coordinates $[{\bf v}]_{B’} = \left[ {2 \atop 1} \right]$ relative to the basis $B’$ has coordinates $$[{\bf v}]_B = \left[ \begin{array}{cc} 3 & -2 \\ 1 & 1 \end{array}\right]\left[\begin{array}{c} 2 \\ 1 \end{array}\right] = \left[\begin{array}{c} 4 \\ 3 \end{array}\right]$$ relative to the basis $B$. Since $$P^{-1} = \left[\begin{array}{cc} \frac{1}{5} & \frac{2}{5} \\ -\frac{1}{5} & \frac{3}{5} \end{array}\right],$$ we can verify that $$[{\bf v}]_{B’} = \left[\begin{array}{cc} \frac{1}{5} & \frac{2}{5} \\ -\frac{1}{5} & \frac{3}{5} \end{array}\right]\left[\begin{array}{c} 4 \\ 3 \end{array}\right] = \left[\begin{array}{c} 2 \\ 1 \end{array}\right]$$ which is what we started with.

In the following example, we introduce a third basis to look at the relationship between two non-standard bases.

Let $B” = \left\{ \left[ {2 \atop 1} \right],\left[ {1 \atop 4} \right]\right\}$. To find the change of coordinates matrix from the basis $B’$ of the previous example to $B”$, we first express the basis vectors $\left[ {3 \atop 1} \right]$ and $\left[ {-2 \atop 1} \right]$ of $B’$ as linear combinations of the basis vectors $\left[ {2 \atop 1} \right]$ and $\left[ {1 \atop 4} \right]$ of $B”$: \begin{eqnarray*} \mbox{Set }\left[ \begin{array}{c} 3 \\ 1 \end{array}\right] & = & a\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + b\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \\ \left[\begin{array}{c} -2 \\ 1 \end{array}\right] & = & c \left[\begin{array}{c} 2 \\ 1 \end{array}\right] + d\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \end{eqnarray*} and solve the resulting systems of r $a,b,c,$ and $d$: \begin{eqnarray*} \left[ \begin{array}{c} 3 \\ 1 \end{array}\right] & = & \frac{11}{7} \left[\begin{array}{c} 2 \\ 1 \end{array}\right] – \frac{1}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \\ \left[\begin{array}{c} -2 \\ 1 \end{array}\right] & = & \frac{-9}{7}\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + \frac{4}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] \end{eqnarray*} Thus, the transition matrix form $B’$ to $B”$ is $$\left[\begin{array}{cc} \frac{11}{7} & \frac{-9}{7} \\ \frac{-1}{7} & \frac{4}{7} \end{array}\right].$$ The vector ${\bf v}$ with coordinates $\left[ {2 \atop 1} \right]$ relative to the basis $B’$ has coordinates $$\left[\begin{array}{cc} \frac{11}{7} & \frac{-9}{7} \\ \frac{-1}{9} & \frac{4}{7} \end{array}\right]\left[\begin{array}{c} 2 \\ 1 \end{array}\right] = \left[\begin{array}{c} \frac{13}{7} \\ \frac{2}{7} \end{array}\right]$$ relative to the basis $B”$. This is, back in the standard basis, $$[ {\bf v} ]_B = \frac{13}{7}\left[\begin{array}{c} 2 \\ 1 \end{array}\right] + \frac{2}{7}\left[\begin{array}{c} 1 \\ 4 \end{array}\right] = \left[\begin{array}{c} 4 \\ 3 \end{array}\right],$$ which agrees with the results of the previous example.

## Rotation of the Coordinate Axes

Suppose we obtain a new coordinate system from the standard rectangular coordinate system by rotating the axes counterclockwise by an angle $\theta$. The new basis $B’ = \left\{{\bf u’, v’}\right\}$ of unit vectors along the $x’$- and $y’$-axes, respectively, has coordinates \begin{eqnarray*} ~[{\bf u’}]_B & = & \left[\begin{array}{c} \cos\theta \\ \sin\theta \end{array}\right] \\ ~[{\bf v’}]_B & = & \left[\begin{array}{c} -\sin\theta \\ \cos\theta \end{array} \right] \end{eqnarray*} in the original coordinate system.

Thus, $P = \left[ \begin{array}{cc} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{array}\right]$ and $P^{-1} = \left[ \begin{array}{cc} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{array}\right]$. A vector $\left[ {x \atop y} \right]_B$ in the original coordinate system has coordinates $\left[ {x’ \atop y’} \right]_{B’}$ given by $$\left[\begin{array}{c} x’ \\ y’ \end{array}\right]_{B’} = \left[\begin{array}{cc} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{array}\right]\left[\begin{array}{c} x \\ y \end{array}\right]_{B}$$ in the rotated coordinate system.

The vector $[{\bf v}]_{B}= \left[ {3 \atop 2} \right]$ in the original coordinate system has coordinates $$[{\bf v}]_{B’} = \left[\begin{array}{cc} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{array}\right]\left[\begin{array}{c} 3 \\ 2 \end{array}\right] = \left[\begin{array}{c} \frac{5\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} \end{array}\right]$$ in the coordinate system formed by rotating the axes by $45^{\circ}$.

In the following Exploration, set up your own basis in $R^2$ and compare the coordinates of vectors in your basis to their coordinates in the standard basis.

Exploration

## Key Concepts

Let $B = \{{\bf u,v}\}$ and $B’ = \{ {\bf u’, v’} \}$ be two bases for $R^2$. If $[{\bf u}]_{B}= \left[ {a \atop b} \right]$ and $[{\bf v}]_{B}= \left[ {c \atop d} \right]$, then $P = \left[\begin{array}{cc} a & c \\ b & d \end{array}\right]$ is the

from $B’$ to $B$ and $P^{-1}$ is the change of coordinates matrix from $B$ to $B’$. That is, for any ${\bf v} \in V$, \begin{eqnarray*} ~[{\bf v}]_{B} & = & P[{\bf v}]_{B’} \\ ~[{\bf v}]_{B’} & = & P^{-1}[{\bf v}]_{B}. \end{eqnarray*}

[ I’m ready to take the quiz. ] [ I need to review more. ]

## Change of Basis

Any vector space has multiple bases , so the question naturally arises: what are the relationships between bases of a vector space? In the first place, there must be the same number of elements in any basis of a vector space. Then, given two bases of a vector space, there is a way to translate vectors in terms of one basis into terms of the other; this is known as change of basis .

Change of basis is a technique applied to finite-dimensional vector spaces in order to rewrite vectors in terms of a different set of basis elements. It is useful for many types of matrix computations in linear algebra and can be viewed as a type of linear transformation . ## Rewriting a Linear Transformation

Suppose $$v_1, \, v_2, \, \dots, \, v_n$$ is a basis of $$V$$ and $$u_1, \, u_2, \, \dots, \, u_n$$ is another basis of $$V$$. Then, by the definition of basis, there is precisely one way to write each $$v_k$$ in terms of $$u_i$$'s. Specifically, there are scalars $$a_{i,j}$$ $$($$for integers $$1 \le i,j \le n)$$ such that

\begin{align*} v_1 &= a_{1,1} u_1 + a_{1,2} u_2 + \dots + a_{1,n} u_n \\ &\ \ \vdots \hspace{1.3cm} \vdots \hspace{1.7cm} \vdots\\ v_n &= a_{n,1} u_1 + a_{n,2} u_2 + \dots + a_{n,n} u_n. \end{align*}

Then, there is an $$n \times n$$ matrix $$M = (a_{i,j})_{i,j}$$ that is known as the change-of-basis matrix . $$M$$ must be invertible because it must be injective (and it is square), by the definition of basis. Any vector $$v = b_1 v_1 + b_2 v_2 + \dots + b_n v_n$$ could then be represented in terms of the $$u_i$$'s by means of direct substitution:

\begin{align*} v &= \begin{pmatrix} v_1 & v_2 & \dots & v_n \end{pmatrix} \begin{pmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{pmatrix} \\ &= \begin{pmatrix} u_1 & u_2 & \dots & u_n \end{pmatrix} M \begin{pmatrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{pmatrix}. \end{align*}

That is, the linear transformation $$T: V \to V$$ defined by $$T(v) = Mv$$ changes the coordinates from $$v_i$$'s to $$u_i$$'s.

Express the vector $$v = 15\hat{i} - 5\hat{j}$$ as a linear combination of the vectors $$\begin{pmatrix} 1 \\ 1 \end{pmatrix}$$ and $$\begin{pmatrix} 3 \\ -2 \end{pmatrix}$$. This comes down to finding the scalars $$a$$ and $$b$$ so that $$\begin{pmatrix} 15 \\ -5 \end{pmatrix} = a\begin{pmatrix} 1 \\ 1 \end{pmatrix} + b\begin{pmatrix} 3 \\ -2 \end{pmatrix},$$ which can be written in matrix form as $$\begin{pmatrix} 1 & 3 \\ 1 & -2 \end{pmatrix}\begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 15 \\ -5 \end{pmatrix}$$. From here, we can use Gauss-Jordan elimination to conclude that $$a = 3$$ and $$b = 4$$. $$_\square$$

When using coordinates (and therefore matrices) for linear transformations, it is sometimes helpful to consider a linear transformation with a different basis.

Suppose $$T: V \to V$$ is a linear transformation with matrix $$N$$ in basis $$\mathcal{B}_1 = \{v_1, \, v_2, \, \dots, \, v_n\}$$ and $$V$$ has another basis $$\mathcal{B}_2 = \{u_1, \, u_2, \, \dots, \, u_n\}$$. Then, if $$M$$ is the change-of-basis matrix for $$\mathcal{B}_1$$ to $$\mathcal{B}_2$$ as above, the linear transformation has a different matrix in basis $$\mathcal{B}_2$$, namely $T(u) = MNM^{-1} u.$

So, some vector $$u \in V$$ has a representation with basis $$\mathcal{B}_2$$. Then, $$M^{-1}u$$ is the same vector whose representation is now with basis $$\mathcal{B}_1$$; $$NM^{-1}u$$ is the application of $$N$$ to a vector expressed in basis $$\mathcal{B}_1$$, yielding the output of $$T$$ expressed in basis $$\mathcal{B}_1$$; and $$MNM^{-1}$$ is the output of $$T$$ expressed in basis $$\mathcal{B}_2$$.

• Linear Algebra ## Change of basis in Linear Algebra

Knowing how to convert a vector to a different basis has many practical applications. Gilbert Strang has a nice quote about the importance of basis changes in his book  (emphasis mine):

The standard basis vectors for and are the columns of I . That choice leads to a standard matrix, and in the normal way. But these spaces also have other bases, so the same T is represented by other matrices. A main theme of linear algebra is to choose the bases that give the best matrix for T .

This should serve as a good motivation, but I'll leave the applications for future posts; in this one, I will focus on the mechanics of basis change, starting from first principles.

## The basis and vector components ## Example: finding a component vector ## Change of basis matrix By our definition of vector components, this equation is equivalent to: Now we're in vector notation again, so we can decompose the column vector on the right hand side to: So we have: And this matrix is: We will soon see that the two change of basis matrices are intimately related; but first, an example.

## Example: changing bases with matrices Checks out again! If you have a keen eye, or have recently spent some time solving linar algebra problems, you'll notice something interesting about the two basis change matrices used in this example. One is an inverse of the other! Is this some sort of coincidence? No - in fact, it's always true, and we can prove it.

## The inverse of a change of basis matrix ## Changing to and from the standard basis The standard basis is so ingrained in our intuition of vectors that we usually neglect to mention it. This is fine, as long as we're only dealing with the standard basis. Once change of basis is required, it's worthwhile to stick to a more consistent notation to avoid confusion. Moreover, it's often useful to change a vector's basis to or from the standard one. Let's see how that works. Recall how we use the change of basis matrix: ## Chaining basis changes This is simply applying the change of basis by matrix multiplication equation, twice: ## Example: standard basis and chaining The other direction can be done similarly.  #### IMAGES

1. Change of basis. Changing basis of a vector, the… 2. Change of Basis 3. ERTH/OCN312: Vector Transformation and Change of Basis 4. Understanding the Change of Basis Matrix 5. Change of basis 6. How to CHANGE BASIS in a VECTOR SPACE // Short Lecture // Linear #### VIDEO

1. Vector Spaces: Basis

2. MATH FOR FINANCE 10 11 2023 part 3

3. Vector Spaces: Basis Example

4. Linear Algebra & Applications Ch5.6 Discrete Dynamical Systems

5. Voice change

6. Basis & Dimension for a Vector Space

1. What Is the Vector Equation of a Line?

The vector equation of a line is r = a + tb. Vectors provide a simple way to write down an equation to determine the position vector of any point on a given straight line. In order to write down the vector equation of any straight line, two...

2. How Are Vectors Used in Everyday Life?

Vectors are used in everyday life to locate individuals and objects. They are also used to describe objects acting under the influence of an external force. A vector is a quantity with a direction and magnitude.

3. How Do You Add Two Vectors That Are Not Perpendicular or Parallel?

For each vector, the angle of the vector to the horizontal must be determined. Using this angle, the vectors can be split into their horizontal and vertical components using the trigonometric functions sine and cosine.

4. Change of basis

A change of basis consists of converting every assertion expressed in terms of coordinates relative to one basis into an assertion expressed in terms of

5. Change of basis

How do you translate back and forth between coordinate systems that use different basis vectors? Help fund future projects:

6. Change of Basis

We learned about how vectors can form a basis for a vector space, and we can express any vector within a vector space as a linear

7. Change of basis

The purpose of the change-of-basis techniques is to transform coordinate vectors. Example Let $S$ be a vector space and [eq5] a basis for

8. Change of basis matrix (video)

C[a]b = a is the equation for a change of basis. A basis, by definition, must span the entire vector space it's a basis of. C is the change of basis matrix, and

9. Essential Math for Data Science: Basis and Change of Basis

Vector spaces (the set of possible vectors) are characterized in reference to a basis. The expression of a geometrical vector as an array of

10. Change of Basis

If S={v1,v2,…,vn} is a basis for V, then every vector v∈V can be expressed uniquely as a linear combination of v1,v2,…,vn: v=c1v1+c2v2+⋯+cnvn. Think of [c1

11. Change of Basis

Change of basis is a technique applied to finite-dimensional vector spaces in order to rewrite vectors in terms of a different set of basis elements. It is

12. Change of basis in Linear Algebra

Chaining basis changes · What happens if we change a vector from one basis to another, and then change the resulting vector to yet another basis?

13. Change of basis

Changing basis of a vector, the vector's length & direction remain the same, but the numbers represent the vector will change, since the

14. Math 217: Summary of Change of Basis and All That...

You should think of the matrix S as a machine that takes the B-coordinate column of each vector x and converts it (by multiplication) into the A-coordinate