# Item I

What is a...

### a) Singular matrix

A square matrix ($n\times n$) $A$ is singular if there doesn't exist a square matrix ($n \times n$) $B$ such that:
$$
BA = I_n \, \wedge \, AB = I_n
$$
where $I_n$ is the $n \times n$ identity matrix. $B$ is denoted as $A^{-1}$.

The following conditions for $A$ are equivalent:
* $A$ is singular.
* Its determinant is 0.
* At least one of its eigenvalues is 0.
* $\text{rank}(A) < n $.
* The equation $A\vec{x} = \vec{0}$ has infinite solutions.

Properties:
* The equation $A\vec{x} = \vec{b}$, with $\vec{b}\neq \vec{0}$, can have zero or infinite solutions.
* $(A^{-1})^{-1} = A$.
* $(kA)^{-1} = k^{-1} A^{-1}$, if $k \neq 0$.
* $(A^T)^{-1} = (A^{-1})^T$
* $\text{det}(A^{-1}) = \text{det}(A)^{-1}$
* $A^{-1} = Q \Lambda^{-1} Q^{-1}$, where $Q$ and $\Lambda$ are matrices obtained from the [eigendecomposition](https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix) of the matrix: $A = Q \Lambda Q^{-1}$.

### b) Vandermonde matrix

Is a $m \times n$ matrix with the following structure:
$$
V = \begin{bmatrix}1&\alpha _{1}&\alpha _{1}^{2}&\dots &\alpha _{1}^{n-1}\\1&\alpha _{2}&\alpha _{2}^{2}&\dots &\alpha _{2}^{n-1}\\1&\alpha _{3}&\alpha _{3}^{2}&\dots &\alpha _{3}^{n-1}\\\vdots &\vdots &\vdots &\ddots &\vdots \\1&\alpha _{m}&\alpha _{m}^{2}&\dots &\alpha _{m}^{n-1}\end{bmatrix}
$$

* It evaluates a polynomial at a set of points. It maps the coefficients of a polynomial to the value it acquires at the $\alpha_i$'s.
* $\det(V) = \prod_{1\leq i < j \leq n} (\alpha_j-\alpha_i)$.
* A $m \times n$ rectangular Vandermonde matrix such that $m \leq n$ has maximum rank $m$ iff all $x_i$ are distinct.
* A $m \times n$ rectangular Vandermonde matrix such that $n \leq m$ has maximum rank $n$ iff there are $n$ of the $\alpha_i$ that are distinct.
* A $n \times n$ Vandermonde matrix is invertible iff the $\alpha_i$ are distinct. [A direct formula to compute it is known](https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19660023042.pdf).
* The discrete Fourier transform is defined by the [DFT matrix](https://en.wikipedia.org/wiki/DFT_matrix), which is a specific Vandermonde matrix where the numbers $\alpha_i$ are chosen to be roots of unity.

### c) Symmetric matrix

A square matrix $A$ so that $A = A^T$.

* Every square diagonal matrix is symmetric.
* With $A,B$ symmetric, $A+B$ is symmetric.
* With $A,B$ symmetric, iff $AB=BA$, then $AB$ is symmetric.
* Given $n$ integer, $A^n$ is symmetric.
* If $A^{-1}$ exists, it is symmetric.
* If $A \in \mathbb{R}^{n\times n}$, then $\langle A\vec{x}, \vec{y} \rangle = \langle \vec{x}, A\vec{y} \rangle \quad \forall \vec{x},\vec{y}, \in \mathbb{R}^n$
* If $A$ is congruent with $R$, i.e. there exists an invertible matrix $P$ so that $P^T AP = B$, then $B$ is also symmetric.
* Every squared real matrix can be docmposed into two real symmetric matrices.
* If $A \in \mathbb{R}$, it is also hermitian (and has their properties!).

### d) Hermitian matrix

A square matrix $A$ so that $A = A^*$, where $A^* = \overline{A^T}$.
* $a_{ij} = \overline{a_{ji}}$
* All the eigenvalues $A$ are real.
* $A$ is normal, i.e. $A^*A = AA^*$.
* $\langle \vec{v}, A\vec{v} \rangle \in \mathbb{R}$
* If $A$ is also positive-definite (i.e. $\vec{z}^* A \vec{z} > 0, \forall z \neq \vec{0}$), then $A=LL^*$ where $L$ is a lower-triangular matrix.
    * This is the [Cholesky decomposition](https://en.wikipedia.org/wiki/Cholesky_decomposition), more efficient than $LU$ decomposition for solving systems of linear equations.
* $\langle \vec{v}, A \vec{w} \rangle = \langle A\vec{v}, \vec{w} \rangle$
* With $A,B$ hermitian, $A+B$ is hermitian.
* With $A,B$ hermitian, if $AB=BA$, then $AB$ is hermitian.
* Given $n$ integer, $A^n$ is hermitian.
* $A$ can be diagonalized: $A= Q\Lambda Q^T$, where $Q$ is a unitary matrix.
    * $Q$ is composed of orthonormal eigenvectors of $A$ and $\Lambda$ is diagonal, having the eigenvalues of $A$.
    * It holds that $$
    A = \sum_j \lambda_j u_j u_j^* \,,
    $$ where the $u_j$'s are the orthonormal eigenvectors and the $\lambda_j$'s are the eigenvalues.
    * This is the [eigendecomposition](https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix) of $A$.
* $B + B^*$ is Hermitian, for a square matrix $B$.

### e) Skew-hermitian matrix

A square matrix $A$ so that $A^* = -A$, where $A^* = \overline{A^T}$.

The following conditions are equivalent:
* The real part $\mathfrak{R}(A)$ is skew-symmetric and the imaginary part $\mathfrak{I}(A)$ is symmetric.
* $iA$ is Hermitian.
* $-iA$ is Hermitian.
* $x^*Ay=-y^*Ax$ for all vectors $x,y$.

Properties:
* $a_{ij} = -\overline{a_{ji}}$
* All the eigenvalues of a $A$ are purely imaginary (possibly zero).
* It is normal (i.e. $A^*A = AA^*$).
  * $\Rightarrow$ it is diagonalizable ($A = VDV^*$ with $V$ unitary and $D$ diagonal).
  * Its eigenvectors for distinct eigenvalues are orthogonal.
* All $a_{ii}$ (values in the diagonal) have to be purely imaginary (possibly zero).
* With $A,B$ skew-Hermitian, $A+B$ is skew-hermitian.
* $A^k$ is Hermitian if $k$ is even and skew-Hermitian if $k$ is odd.
* $B - B^*$ is skew-Hermitian, for a square matrix $B$.
* An arbitrary square matrix $X$ can be writeen as the sum of a Hermitian matrix $H$ and a skew-Hermitian matrix $S$:
$$
X = H + S \quad \text{with} \quad H = \tfrac{1}{2}(X+X^*) \quad \text{and} \quad S = \tfrac{1}{2}(X-X^*)
$$

### f) Unitary matrix

A square matrix $U$ is unitary if $U^*$ is also its inverse $U^{-1}$:
$$
U^* U = U U^* = I
$$

The following conditions for $U$ are equivalent:
* $U^*$ is unitary.
* $U^{-1} = U^*$
* $U$ is normal and their eigenvalues are in the unit circle.
* The columns of $U$ form an orthonormal basis of $\mathbb{C}^n$.
* The rows of $U$ form an orthonormal basis of $\mathbb{C}^n$.

Properties:
* By definition, it is normal (i.e. $U^*U = UU^*$).
  * $\Rightarrow$ it is diagonalizable ($A = VDV^*$ with $V$ unitary and $D$ diagonal).
  * Its eigenvectors for distinct eigenvalues are orthogonal (orthonormal in this case).
* $|\text{det}(U)| = 1$
* Vector norms are preserved on multiplication.

### g) Jacobian matrix

A matrix $J$ that contains all the first-order partial derivates of a vector-valued function $\mathbf{f}:\mathbb{R}^n \rightarrow \mathbb{R}^m$ :

$$
J(x_1,\dots,x_n) = \left[
\begin{matrix}
\frac{\partial \mathbf{f}}{\partial x_1}
& \cdots
& \frac{\partial \mathbf{f}}{\partial x_n}
\end{matrix} \right]
= \left[
\begin{matrix}
\frac{\partial f_1}{\partial x_1} & \cdots & \frac{\partial f_1}{\partial x_n}
\\ \vdots & \ddots & \vdots
\\ \frac{\partial f_m}{\partial x_1} & \cdots & \frac{\partial f_m}{\partial x_n}
\end{matrix} \right]
$$

* The best linear approximation of $\mathbf{f}$ near a point $\mathbf{p}$ is:
$$
\mathbf{f}(\mathbf{x})-\mathbf{f}(\mathbf{p}) = J(\mathbf{p})(\mathbf{x}-\mathbf{p})
$$
* If $J(\mathbf{x})$ is non-singular, $\mathbf{f}$ is locally invertible near $\mathbf{x}$.
* The inverse of the Jacobian matrix $J$ of $\mathbf{f}$ is the Jacobian matrix of $\mathbf{f}^{-1}$.
* It satiesfies the chain rule:
$$
J_{\mathbf{g} \circ \mathbf{f}}(\mathbf{x}) = J_{\mathbf{g}}(\mathbf{f}(\mathbf{x})) J_{\mathbf{f}}(\mathbf{x}) 
$$

### h) Projection matrix

A matrix $P$ such that $P^2 = P$ (idempotent), that defines a transformation between the vector space $W$ to itself.

* Its eigenvalues are $0$ or $1$.
* Being $U = \text{Rank}(P)$ and $V = \text{Kern}(P)$:
  * $\forall x \in U : Px = x$, i.e. $P$ is equivalent to the identity on the subspace $U$.
  * Every vector $x \in W$ may be decomposed uniquely as $x = u + v$, with $u = Px$ and $v = x - Px = (I-P) x$, where $u \in U, v \in V$.
* If two projections commute, their product is a projection.
* If $P$ projects onto a line with unit vector $u$, then $P=uu^T$.
* If $P$ projects onto a subspace $U$ with $u_1,\dots,u_k$ an arthonormal basis, then
  $P = AA^T$, where $A$ is the $n \times k$ matrix whose columns are $u_1,\dots,u_k$.

### i) Companion matrix

A square matrix defined for the polinomial:
$$
p(t) = c_0 + c_1 t + \cdots + c_{n-1} t^{n-1} + t^n
$$
as
$$
C(p) = \left[
\begin{matrix}
0 & 0 & \cdots & 0 & -c_0 \\
1 & 0 & \cdots & 0 & -c_1 \\
0 & 1 & \cdots & 0 & -c_2 \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & \cdots & 1 & -c_{n-1}
\end{matrix}
\right]
$$

* A matrix $A$ is similar to the companion matrix $C$ of its characteristic polynomial (i.e. $\exists P: C=P^{-1}AP$).
  * Similar matrices share several properties, in that sense, analyzing $C$ could be more easy that analyzing $B$.
  * Rank
  * Characteristic polynomial
    * Determinant
    * Trace
    * Eigenvalues

### j) Jacobi matrix

A square tridiagonal matrix:
$$
A = \left[\begin{matrix}
a_1 & b_1 & 0 & \cdots & 0 & 0 \\
c_1 & a_2 & b_2 & \cdots & 0 & 0 \\
0 & c_2 & a_3 & \cdots & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\
0 & 0 & 0 & \cdots & c_{n-1} & a_{n} 
\end{matrix}\right]
$$
so that $a_i \neq 0 , \forall i$.

* The determinant can be computed from a three-term recurrence relation:
  \begin{align}
  f_m &= a_m f_{m-1} - c_{m-1}b_{m-1}f_{m-2} \\
  f_{-1} &= 0 \\
  f_{0} &= 1
  \end{align}
  where each $f_m$ is the determinant of the top-left $m\times m$ submatrix and, thus, $\text{det}(A) = f_n$.
* The inverse can be obtained by a [known recurrence](https://en.wikipedia.org/w/index.php?title=Tridiagonal_matrix&oldid=905913546#Inversion).
* If it is also Toeplitz (i.e. all values in the same diagonal are equal), which means $a_i =a \, \forall i$ ; $b_i =b \, \forall i$ ; $c_i =c \, \forall i$; the eigenvalues are:
$$
\lambda_k = a+2\sqrt{bc} \cos\left(\frac{k\pi}{n+1}\right), \quad k=1,\dots,n
$$
* If $A$ is real and symmetric, then its eigenvalues are real. If all offdiagonal elements are nonzero, then they also are distinct.
* [Numerous methods](https://www.sciencedirect.com/science/article/pii/S1063520312001042?via%3Dihub) exist for the numerical computation of the eigenvalues of a real symmetric tridiagonal matrix.
* With [Lanczos algorithm](https://en.wikipedia.org/wiki/Lanczos_algorithm) it is possible to transform a Hermitian matrix to tridiagonal (and compute its eigenvalues).

### k) Defective matrix

A $n \times n$ matrix $A$ that doesn't have $n$ linearly independent eigenvectors.

* $A$ has fewer than $n$ distinct eigenvalues. Repeated eigenvalues are called *defective*.
* $A$ cannot be diagonalized.
* Normal matrices are never defective.

### l) Toeplitz matrix

A matrix $A$ of size $n \times n$ in which each descending diagonal from left to right is constant.
$$
A = \left[ \begin{matrix}
a_0 & a_{-1} & a_{-2} & \cdots & a_{-(n-1)} \\
a_{1} & a_0 & a_{-1} & \ddots & \vdots \\
a_{2} & a_{1} & a_0 & \ddots & a_{-2} \\
\vdots & \ddots & \ddots & \ddots & a_{-1} \\
a_{n-1} & \cdots & a_2 & a_1 & a_0
\end{matrix}\right]
$$
i.e. it is determined by the constants $c_{-(n{-}1)},\dots,c_{n-1}$, so that
$$
a_{i,j} = c_{i-j}
$$

* The system $Ax = b$ (called Toeplitz system) can be solved using the [Levinson algorithm](https://en.wikipedia.org/wiki/Levinson_recursion) on $\Theta(n^2)$ time.
* $A$ can be decomposed ($LU$) in $O(n^2)$ time.
* If $A$ is symmetric, it can be decomposed as:
$$
\tfrac{1}{a_0} A = G G^T - (G-I) (G-I)^T
$$
where $G$ is the lower triangular part of $\tfrac{1}{a_0}A$.
* If $A$ is nonsingular and symmetric, we have that:
$$
A^{-1} = \tfrac{1}{a_0}(B B^T - C C^T)
$$
where $B$ and $C$ are lower triangular Toeplitz matrices and $C$ is strictly lower.
* It can be used to express a [discrete convolution](https://en.wikipedia.org/wiki/Toeplitz_matrix#Discrete_convolution) as matrix multiplication.

Note: The definition sometimes is extended to include $n \times m$ matrices but most properties don't apply.

### m) Circulant matrix

A Toeplitz matrix with the aditional condition that $a_i = a_{i+m}$.

$$
A = \left[ \begin{matrix}
a_0 & a_{n-1} & a_{n-2} & \cdots & a_{1} \\
a_1 & a_0 & a_{n-1} & \ddots & \vdots \\
a_2 & a_{1} & a_0 & \ddots & a_{n-2} \\
\vdots & \ddots & \ddots & \ddots & a_{n-1} \\
a_{n-1} & \cdots & a_2 & a_1 & a_0
\end{matrix}\right]
$$

The polynomial $f(x) = a_0 + a_1 x + a_2 x^2 + \dots + a_{n-1}x^{n-1}$ is called the *asociated polynomial* of $A$.

* It is fully specified by a vector $\mathbf{a} = a_0,\dots,a_{n-1}$.
* They are diagonalized by a discrete Fourier transform.
  * Equations that contain them may be quickly solved useing a FFT.
  * The following matrix $U_n$ is composed of the eigenvectors of $A$:
  $$
  U_n^* = \tfrac{1}{\sqrt{n}}F_n \quad \text{and} \quad U_n = \sqrt{n}F_n^{-1} \,,
  $$
  where $F_n = [f_{jk}]$ with $f_{jk} = e^{-2jk\pi i/n},\quad 0\leq j,k < n$.
  * $A = U_n \text{diag}(F_n \mathbf{a}) U_n^* = F_n^{-1} \text{diag}(F_n \mathbf{a})F_n.$
  The eigenvalues of $A$ are given by $F_n \mathbf{a}$ which can be calculated using a FFT.
* The normalized eigenvectors are given by:
$$
v_j = \tfrac{1}{\sqrt{n}}(1,\omega_j,\omega_j^2,\dots,\omega_j^{n-1}), \qquad \forall j \in [0,n{-}1] \,,
$$
where $\omega_j = \text{exp}\left( i \tfrac{2 \pi j}{n} \right)$ (the $n$-th roots of unity).
* The eigenvalues are given by:
$$
\lambda_j = f(w_j), \qquad \forall j \in [0,n{-}1] \,.
$$
* $\text{Rank}(A) = n-d$, where $d$ is the degree of the $\text{gcd}(f(x),x^n-1)$.
* If $A$ and $B$ are circulant, $A+B$ is circulant, $AB=BA$ is also circulant.
* Given an equation $A\mathbf{x} = \mathbf{b}$, it can be written as a circular convolution:
  $$
  \mathbf{a} \star \mathbf{x} = \mathbf{b}
  $$
  Then $F_n(\mathbf{a} \star \mathbf{x}) = F_n(\mathbf{a})F_n(\mathbf{x}) = F_n(\mathbf{b})$ and then
  $$
  \mathbf{x} = F_n^{-1}\left[ \left(\frac{(F_n(\mathbf{b}))_v}{(F_n(\mathbf{a}))_v} \right)_{v \in Z} \right]^T
  $$

### n) Hankel matrix

A matrix $A$ of size $n \times n$ in which each **ascending** diagonal from left to right is constant.
$$
A = \left[ \begin{matrix}
a_0 & a_1 & a_2 & \cdots & a_{n-1} \\
a_1 & a_2 & a_3 & \cdots & a_n  \\
a_2 & a_3 & a_4 & \cdots & a_{n+1} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
a_{n-1} & a_{n} & a_{n+1} & \cdots & a_{2n-2}
\end{matrix}\right]
$$
in other words
$$
A = [A_{ij} = a_{i+j-2}]
$$

* It is symmetric.
* The determinant of the particular Hankel matrix:
$$
H_n = \left[h_{ij} = \begin{cases}
0 & \text{ if } i+j-1 > n \\
i+j-1 & \text{otherwise}
\end{cases}\right] = \left[
\begin{matrix}
1 & 2 & 3 & \cdots &  n{-}2 & n{-}1 & n \\
2 & 3 & 4 & \cdots &  n{-}1 & n & 0 \\
3 & 4 & 5 & \cdots &  n  & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
n{-}2 & n{-}1 & n & \cdots & 0 & 0 & 0\\
n{-}1 & n & 0  & \cdots & 0 & 0 & 0 \\
n  & 0 & 0  & \cdots & 0 & 0 & 0 \\
\end{matrix}
\right]
$$
is given by $\text{det}(H_n) = (-1)^{\lfloor n/2 \rfloor} n^n$.

### o) Hilbert matrix

The Hilbert matrix is an specific $n \times n$ matrix with the following form:
$$
H = \left[h_{ij} = \frac{1}{i+j-1}\right] = \left[\begin{matrix}
1 & \tfrac{1}{2} & \tfrac{1}{3} & \cdots & \tfrac{1}{n} \\
\tfrac{1}{2} & \tfrac{1}{3} & \tfrac{1}{4} & \cdots & \tfrac{1}{n{+}1} \\
\tfrac{1}{3} & \tfrac{1}{4} & \tfrac{1}{5} & \cdots & \tfrac{1}{n{+}2} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
\tfrac{1}{n} & \tfrac{1}{n{+}1} & \tfrac{1}{n{+}2} & \cdots & \tfrac{1}{2n{-}1}
\end{matrix}\right]
$$

* They are canonical examples of ill-conditioned matrices.
* It is a Hankel matrix.
  * It is symmetric.
* The determinant is:
$$
\text{det}(H) = \frac{c_n^4}{c_{2n}} \,,
$$
where
$$
c_n = \prod_{i=1}^{n-1} i^{n-i} = \prod_{i=1}^{n-1} i! \, . 
$$
* The inverse is given by:
$$
H^{-1} = \left[h'_{ij} = (-1)^{i+j}(i+j-1)\binom{n+i-1}{n-j} \binom{n+j-1}{n-i} \binom{i+j-2}{i-1}^2 \right]
$$
  * All entries are integers.
  * The signs form a checkerboard matrix, with the principal diagonal positive.
* The condition number grows as $O\left((1+\sqrt{2})^{4n}\middle/\sqrt{n}\right)$.

### p) Markov matrix

A matrix that describes the transitions of a Markov chain, where each entry represents a probability (non-negative), there are 3 kinds:
* **right stochastic matrix**: each rows sums 1.
* **left stochastic matrix**: each column sums 1.
* **doubly stochastic matrix**: the whole matrix sums 1.

For the first one we have that
$$
P = [p_{ij}] \, ,
$$
with the condition that $\sum_{j=1}^{n} p_{ij} = 1$, which is equivalent to:
$$
P \mathbf{1} = \mathbf{1}
$$

* The entry $p_{ij}$ represents the probability of transitioning from state $i$ to state $j$, where there are $n$ possible states. State probabilities should be multiplied by the left in order to advance the system.
* The product of two right stochastic matrices is also stochastic: $P' P'' \mathbf{1} = \mathbf{1}$.
* A probability vector $\mathbf{\pi}$  that's also a row eigenvector asociated to the eigenvalue $1$ represents a stationary distribution (that doesn't change under the application of the transition matrix):
$$
\mathbf{\pi} P = \mathbf{\pi} \,.
$$
  * The system evolves over time to a static state:
  $$
  \lim_{k \rightarrow \infty} P^k = \Pi,
  $$
  where al $\Pi$ rows are equal, and coincide with the vector $\mathbf{\pi}$. 
* The vector $\mathbf{1}$ is a column eigenvector of $P$.
* The spectral radius is at most $1$, moreover:
$$
|\lambda - \omega| \leq 1-\omega, \quad \text{where } \omega = \min_{1\leq i \leq n} p_{ii}.
$$

### q) Differentiation matrices

Its a matrix that when multiplied with a discrete approximation for a function $y(x)$, at some fixed points $x_j, j \in 0,\dots,n$ retrieves a numerical discrete approximation a derivate of $y$.

These matrices are equivalent to fiting a function $p$ to the data, differentiating this approximation and evaluating this differentiation.

For instance:
$$
D = \frac{1}{h^2}\left[\begin{matrix}
1 & -1 \\
-1 & 2 & -1 \\
& -1 & 2 & -1 \\
& & \ddots & \ddots & \ddots \\
& & & -1 & 2 & -1 \\
& & & & -1 & 2 & -1 \\
& & & & & -1 & 1 \\
\end{matrix}\right]
$$
performs an approximation of $y''(x)$ using second-order central difference.

The approximation is performed:
$$
D \mathbf{y} = \mathbf{y''}
$$
where $\mathbf{y} = [y(x_j)]$ and $\mathbf{y''}$ is the approximation of $[y''(x_j)]$.

* Spectral methods use basis functions that are nonzero over the whole domain (they are **global**), for instance, $p(x)$ being a polynomial of degree $n$. Differentiation matrices are dense.
* Finite element methods use basis functions that are nonzero only on small subdomains (they are **local**), for instance, using $p(x)$ as splines. Differentiation matrices are sparse.
* The spectral element method chooses high degree piecewise polynomials as basis functions, also achieving a very high order of accuracy. Such polynomials are usually orthogonal Chebyshev polynomials or very high order Legendre polynomials over non-uniformly spaced nodes.

These matrices are used to represent the differentiation operator in order to solve differential equations.

Powers $D^n$ can be used to represent the $(n)$ derivate of a function discretization.

### r) Spectral differentiation matrices

Differentiation matrices that get better global approximations for derivates. These approximations have "*spectral accuracy*", i.e. error diminises exponentially with $n$.

On multiplication, retrieves a vector of points $p'(x_j)$ (or a higher order derivate) where $p$ is a single function so that $p(x_j)=y_j$ and this function $p$ is (generally) nonzero over the domain.

* For periodic grids: Fourier methods can be used, $p$ is chosen to be a sum of trigonometric functions.
* For non periodic grids: Chebyshev methods can be used, $p$ is chosen to be a polynomial.

### s) Chebyshev differentiation matrices

A $(n{+}1) \times (n{+}1)$ spectral differentiation matrix that evaluates the function at the Chebyshev points:
$$
x_j = \cos(j\pi/N),\quad j = 0,\dots,N
$$

On multiplication, retrieves a vector of the points $p'(x_j)$ where $p(x)$ is the unique polynomial of degree $N$ that interpolates the input points.

For instance, for $n=2$:
$$
D = \left[
\begin{matrix}
\tfrac{3}{2} & -2 & \tfrac{1}{2} \\
\tfrac{1}{2} & 0 & -\tfrac{1}{2} \\
-\tfrac{1}{2} & 2 & -\tfrac{3}{2}
\end{matrix}
\right]
$$


```python

```

9fae6ef4a3d0e9c2bd42c8c25873c2323a7f2220
ipynb
Jupyter Notebook
t1_questions/item_01.ipynb
autopawn/cc5-works
63775574c82da85ed0e750a4d6978a071096f6e7
MIT
t1_questions/item_01.ipynb
autopawn/cc5-works
63775574c82da85ed0e750a4d6978a071096f6e7
MIT
t1_questions/item_01.ipynb
autopawn/cc5-works
63775574c82da85ed0e750a4d6978a071096f6e7
MIT
Qwen/Qwen-72B
1. YES
2. YES