Minimize integral using orthogonal basis

  • Thread starter Thread starter psie
  • Start date Start date
  • Tags Tags
    Least squares
Click For Summary
SUMMARY

The discussion focuses on the process of finding the least squares approximation using orthogonal polynomials in the context of the L2 norm. The user applies the Gram-Schmidt process to the polynomials v1=1 and v2=x, resulting in the orthogonal basis u1=1 and u2=x-1. The orthogonal projection of the function u=ex onto the subspace spanned by u1 and u2 is calculated, leading to the expression P(u)=3x+1/2(e2-1). A discrepancy arises with the answer provided in the book, which states P(u)=3x+1/2(e2-7), prompting the user to verify their calculations.

PREREQUISITES
  • Understanding of L2 norm and inner products
  • Familiarity with the Gram-Schmidt orthogonalization process
  • Basic knowledge of polynomial functions and their properties
  • Ability to compute definite integrals
NEXT STEPS
  • Review the Gram-Schmidt process for orthogonal polynomials
  • Learn about least squares approximation techniques
  • Study the properties of the L2 norm in functional analysis
  • Explore error checking methods in numerical integration
USEFUL FOR

Mathematicians, students studying numerical methods, and anyone interested in functional analysis and approximation theory will benefit from this discussion.

psie
Messages
315
Reaction score
40
Homework Statement
Determine the polynomial ##p## of degree at most ##1## that minimizes ##\int_0^2|e^x-p(x)|^2 dx##. (Hint: first find an orthogonal basis for a suitably chosen space of polynomials of degree ##1##.)
Relevant Equations
##L^2## norm, inner product, least squares approximation.
I'm posting to inquire about a possible typo in the given answer in the back of the book, or if maybe I did something wrong, because my answer does not agree with the one stated.

So the exercise is about finding the least squares approximation. The norm is the ##L^2## norm and the corresponding inner product is $$\langle f, g\rangle=\int_0^2 f(x)g(x)dx.$$ I choose the polynomials ##v_1=1## and ##v_2=x## as a basis and make them orthogonal according to Gram-Schmidt, i.e. I find that ##u_1=1## and ##u_2=x-1## are orthogonal to each other under the inner product above. Put ##u=e^x##, then the orthogonal projection of ##u## on the subspace spanned by ##u_1,u_2## is given by $$P(u)=\frac{\langle u, u_1\rangle}{\langle u_1,u_1\rangle}u_1+\frac{\langle u, u_2\rangle}{\langle u_2,u_2\rangle}u_2.$$ Now, \begin{align}\langle u_1,u_1\rangle&=\int_0^2 dx=2 \nonumber \\ \langle u_2,u_2\rangle&=\int_0^2(x-1)^2dx=\int_0^2(x^2-2x+1)dx=\frac23, \nonumber\end{align}and\begin{align}
\langle u,u_1\rangle&=\int_0^2 e^xdx=e^2-1 \nonumber \\
\langle u,u_2\rangle&=\int_0^2(x-1)e^x dx=2. \nonumber
\end{align}
Plugging these into the equation for ##P(u)##, gives $$P(u)=3x+\frac12(e^2-1),$$but the answer given is ##3x+\frac12(e^2-7)##. Is there a way to check one's answer to know if you got the right one?
 
  • Like
Likes   Reactions: WWGD and Delta2
Physics news on Phys.org
Sorry, I just realized now I forgot to use ##u_2=x-1## instead of ##v_1=x##.:doh:
 
  • Like
Likes   Reactions: Delta2
psie said:
Sorry, I just realized now I forgot to use ##u_2=x-1## instead of ##v_1=x##.:doh:
... and you tell me this now that I have literally checked every single integral and step and was right about to answer where your typo was ... :devil: :biggrin:
 
  • Like
Likes   Reactions: psie

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
9
Views
2K