}

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part VII of the course APMA0340

Introduction to Linear Algebra with Mathematica

Preface


There are known many orthogonal polynomials, for example, Zernike polynomials, Walsh polynomials, Haar wavelets, Jacobi polynomials, Rational orthogonal functions

Orthogonal polynomials


   
Example 1:    ■
End of Example 1

 

Recurrence relation


Let { pₙ }n≥0 be a linearly independent sequence of polynomials with deg pₙ = n, and let ⟨ · , · ⟩ (also denoted by ⟨ · ∣ · ⟩) be an inner product on polynomials (e.g., span class="math">\( \displaystyle \quad \langle f,g\rangle =\int _a^bf(x)g(x)w(x)\, {\text d}x \) ).

Apply Gram–Schmidt to { pₙ }n≥0 to obtain an orthogonal sequence { ψₙ }. The two‑term recurrence becomes

\[ \begin{split} \psi_0(x) &= p_0(x), \\ \psi_n (x) &= p_n(x)-\frac{\langle p_n,\psi _{n-1}\rangle }{\langle \psi _{n-1},\psi _{n-1}\rangle }\, \psi _{n-1}(x),\quad n\geq 1. \end{split} \]
If we choose pₙ(x) = xⁿ, this is the Gram–Schmidt construction of an orthogonal polynomial system with respect to ⟨ · , · ⟩.

Assume now that { ψₙ(x) } is an orthogonal polynomial system with degree ψₙ(x) = n, and that we have chosen a normalization (e.g., monic or orthonormal). Then multiplication by x maps ψₙ into the span of { ψ₀, ψ₁, … , ψn+1 }. Orthogonality plus degree considerations imply

\[ x\psi_n (x) = \alpha _{n+1}\psi _{n+1}(x)+\beta _n\psi _n(x)+\gamma _n\psi _{n-1}(x),\quad n\geq 1, \]
with suitable αn+1, βₙ, γₙ determined by inner products:
\[ \beta_n =\frac{\langle x\psi_n,\psi _n\rangle }{\langle \psi _n,\psi _n\rangle },\quad \gamma_n =\frac{\langle x\psi _n,\psi _{n-1}\rangle }{\langle \psi _{n-1}, \psi _{n-1}\rangle },\quad \alpha_{n+1}=\frac{\langle x\psi _n,\psi _{n+1}\rangle}{\langle \psi_{n+1},\psi_{n+1}\rangle }. \]
Solving for ψn+1 gives the classical three‑term recurrence
\[ ???? \]
Conceptually: the two‑term recurrence describes how to orthogonalize each new input polynomial pₙ against ψn-1; the three‑term recurrence describes how the multiplication operator x acts on the orthogonal basis { ψₙ }.

TwoTermGS[v_List, ip_, opts : OptionsPattern[]] := Module[{psi}, If[Length[v] == 0, Return[{}]]; psi[0] = v[[1]]; Do[ psi[n] = v[[n + 1]] - (ip[v[[n + 1]], psi[n - 1]]/ip[psi[n - 1], psi[n - 1]]) psi[n - 1], {n, 1, Length[v] - 1} ]; Table[psi[n], {n, 0, Length[v] - 1}] ]; (* Polynomial-specialized front-end *) Clear[TwoTermGSPolynomials]; Options[TwoTermGSPolynomials] = {Assumptions -> True}; TwoTermGSPolynomials[n_Integer?NonNegative, x_Symbol, {a_, b_}, w_, opts : OptionsPattern[]] := Module[ {asm, ip, vList}, asm = OptionValue[Assumptions]; ip[f_, g_] := Assuming[asm, Integrate[f g w, {x, a, b}]]; vList = Table[x^k, {k, 0, n}]; TwoTermGS[vList, ip] ]; End[]; EndPackage[];
(* Example: Legendre-like system on [-1,1] with weight 1 *) psiList = TwoTermGSPolynomials[4, x, {-1, 1}, 1, Assumptions -> True]; (* Check orthogonality *) Table[ Integrate[psiList[[i]] psiList[[j]], {x, -1, 1}], {i, 1, Length[psiList]}, {j, 1, Length[psiList]} ] // Simplify
   
Example 1:
   ■
End of Example 1

 

  1. Agarwal, R.P. and O'Regan, D., Ordinary and Partial Differential Equations with Special Functions, Fourier Series, and Boundary Value Problems, Springer, 2009, NY.
  2. Bayatbabolghani, F. and Parand, K., A Comparison between Laguerre, Hermite, and Sinc orthogonal functions, 2017, 31 pages.
  3. Ismail, M.E.H., Classical and Quantum Orthogonal Polynomials in One Variable, Cambridge University Press, 2003, https://doi.org/10.1017/CBO9781107325982

 

Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 7 Special functions
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions