Blog > Taylor Polynomials from Orthogonal Projections

Taylor Polynomials from Orthogonal Projections

One of the standard applications of orthogonal projections to function spaces comes in the form of Fourier series, where we use \(B = \{1,\cos(x),\sin(x),\cos(2x),\sin(2x),\ldots\}\) as a mutually orthogonal set of functions with respect to the usual inner product

\(\displaystyle\langle f, g \rangle = \int_{-\pi}^\pi f(x)g(x) \, \mathrm{d}x.\)

In particular, projecting a function onto the span of the first 2n+1 functions in the set \(B\) gives its order-n Fourier approximation:

\(\displaystyle f(x) \approx a_0 + \sum_{k=1}^n a_k \cos(kx) + \sum_{k=1}^n b_k \sin(kx),\)

where the coefficients \(a_0,a_1,a_2,\ldots,a_n\) and \(b_1,b_2,\ldots,b_n\) can be computed via inner products (i.e., integrals) in this space (see many other places on the web, like here and here, for more details).

A natural follow-up question is then whether or not we similarly get Taylor polynomials when we project a function down onto the span of the set of functions \(C = \{1,x,x^2,x^3,\ldots,x^n\}\). More specifically, if we define \(\mathcal{C}[-1,1]\) to be the inner product space consisting of continuous functions on the interval [-1,1] with the standard inner product

\(\displaystyle\langle f, g \rangle = \int_{-1}^1 f(x)g(x) \, \mathrm{d}x,\)

and consider the orthogonal projection \(P : \mathcal{C}[-1,1] \rightarrow \mathcal{C}[-1,1]\) with range equal to \(\mathcal{P}_n[-1,1]\), the subspace of degree-n polynomials, is it the case that \(P(e^x)\) is the degree-n Taylor polynomial of \(e^x\)?

It does not take long to work through an example to see that, no, we do not get Taylor polynomials when we do this. For example, if we choose n = 2 then projecting the function \(e^x\) onto the  \(\mathcal{P}_2[-1,1]\) results in the function \(P(e^x) \approx 0.5367x^2 + 1.1036x + 0.9963\), which is not its degree-2 Taylor polynomial \(p_2(x) = 0.5x^2 + x + 1\). These various functions are plotted below (\(e^x\) is displayed in orange, and the two different approximating polynomials are displayed in blue):

Orthogonal projection versus Taylor polynomial

These plots illustrate why the orthogonal projection of \(e^x\) does not equal its Taylor polynomial: the orthogonal projection is designed to approximate \(e^x\) as well as possible on the whole interval [-1,1], whereas the Taylor polynomial is designed to approximate it as well as possible at x = 0 (while sacrificing precision near the endpoints of the interval, if necessary).

However, something interesting happens if we change the interval that the orthogonal projection acts on. In particular, if we let \(0 < c \in \mathbb{R}\) be a scalar and instead consider the orthogonal projection \(P_c : \mathcal{C}[-c,c] \rightarrow \mathcal{C}[-c,c]\) with range equal to \(\mathcal{P}_2[-c,c]\), then a straightforward (but hideous) calculation shows that the best degree-2 polynomial approximation of \(e^x\) on the interval [-c,c] is

P_c(e^x) formula

While this by itself is an ugly mess, something interesting happens if we take the limit as c approaches 0:

\(\displaystyle\lim_{c\rightarrow 0^+} P_c(e^x) = \frac{1}{2}x^2 + x + 1,\)

which is exactly the Taylor polynomial of \(e^x\). Intuitively, this makes sense and meshes with our earlier observations about Taylor polynomials approximating \(e^x\) at x = 0 as well as possible and orthogonal projections \(P_c(e^x)\) approximating \(e^x\) as well as possible on the interval \([-c,c]\). However, I am not aware of any proof that this happens in general (i.e., no matter what the degree of the polynomial is and no matter what (sufficiently nice) function is used in place of \(e^x\)), and I would love for a kind-hearted commenter to point me to a reference. [Update: user “jam11249” provided a sketch proof of this fact on reddit here.]

Here is an interactive Desmos plot that you can play around with to see the orthogonal projection approach the Taylor polynomial as \(c \rightarrow 0\).

  1. LUCIANO
    April 5th, 2020 at 10:38 | #1

    Good Morning,
    A very interesting example! However, it is not clear to me how you calculated the coefficients [0.9963,1.1036, 0.5367] in your example. Which definition did you use for the calculation?
    Thanks,
    Luciano.

  2. April 6th, 2020 at 18:49 | #2

    @LUCIANO
    It’s a non-trivial calculation. I used the standard inner product on the interval [-1,1] and projected down onto span{1,x,x^2} using that inner product. The calculation is ugly because {1,x,x^2} isn’t an orthonormal basis in this inner product, so you first need to construct an ONB of that span and then compute inner products with those orthonormal basis vectors. See the question and answers at https://math.stackexchange.com/questions/3000704/orthogonal-projection-on-a-polynomial-space for details.

  3. YAN, QIUSHI
    September 7th, 2020 at 04:10 | #3

    Very informative post!

  4. Tamas Kalmar-Nagy
    March 30th, 2021 at 05:40 | #4

    See the paper “TAYLOR SERIES ARE LIMITS OF LEGENDRE EXPANSIONS” by
    Paul E. Fishback

  5. May 19th, 2025 at 09:34 | #5
  6. Jose1289
    May 24th, 2025 at 13:30 | #6
  7. Johnny463
    May 25th, 2025 at 00:36 | #7
  8. Marina2537
    May 25th, 2025 at 13:28 | #8
  9. Martin1603
    May 25th, 2025 at 18:42 | #9
  10. Annabelle1961
    May 29th, 2025 at 17:08 | #10
  11. Meagan2187
    May 30th, 2025 at 03:37 | #11
  12. Jude2738
    May 30th, 2025 at 18:59 | #12
  13. May 31st, 2025 at 21:42 | #13

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://accounts.binance.com/bn/register?ref=UM6SMJM3

  14. Leonel1276
    June 1st, 2025 at 06:41 | #14
  15. June 5th, 2025 at 16:15 | #15

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

  16. July 7th, 2025 at 11:45 | #16

    Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? http://33.cryptostarthome.com

  17. Amira905
    July 11th, 2025 at 02:34 | #17

    Promote our products and earn real money—apply today! https://shorturl.fm/6iIxb

  18. Troy647
    July 12th, 2025 at 13:02 | #18

    Join our affiliate program and start earning today—sign up now! https://shorturl.fm/MvtHW

  19. Emmett3513
    July 15th, 2025 at 13:51 | #19

    Earn recurring commissions with each referral—enroll today! https://shorturl.fm/wUmT9

  20. Asher1531
    July 17th, 2025 at 06:12 | #20

    Boost your income effortlessly—join our affiliate network now! https://shorturl.fm/98H3V

  1. July 16th, 2025 at 18:33 | #1
  2. July 16th, 2025 at 18:37 | #2