(Already noticed this post)

Given for example the odd function $f(x)=x$ defined in the interval $[-\pi,\pi]$. I would like to expand this function into a cosine series. Is it possible to somehow expand $f$ into a function symmetric with respect to the axis $x=\pi$ (or $x=-\pi$) in order to do that?

EDIT: just to emphasize, this is not a homework question, just a general question I thought of when learning about expanding a function into a cosine series. I know that if we are looking at a function defined on $[0,\pi]$ and want to expand it into a cosine series, we need to first define it as an even function in the interval $[-\pi,\pi]$, and then the coefficients of the sine terms will vanish.

Nevertheless, I am not quite sure how to expand a function defined on $[-\pi,\pi]$ that is not a priori even into a cosine series. As GEdgar suggested, when I say "a cosine series", I don't mean $\sum a_n \cos(nx)$ necessarily (which obviously doesn't work), but also $f(x)=\sum a_n\cos(n(x-\pi))$ might work for me. Is there any book/paper/notes that discuss this case and also include a statement of the convergence theorems for such a case?

  • $\begingroup$ Will someone please explain why do you downvote this post? $\endgroup$
    – Dr. John
    Aug 30, 2022 at 11:30
  • $\begingroup$ you mean a series like $f(x)=\sum a_n\cos(n(x-\pi))$ on $[-\pi,\pi]$? $\endgroup$
    – GEdgar
    Aug 30, 2022 at 12:13
  • $\begingroup$ @GEdgar: yes, exactly $\endgroup$
    – Dr. John
    Aug 30, 2022 at 15:50
  • $\begingroup$ The main point is, a function $f$ on $[0, \pi]$ has a unique even extension to $[-\pi, \pi]$, and a unique "odd extension" to $[-\pi, \pi]$ (the quotes are needed unless $f(0) = 0$). These functions usually differ. A "cosine expansion of $f$ on $[0, \pi]$" is (the restriction of) the Fourier expansion of the even extension, and a "sine expansion for $f$ on $[0, \pi]$" is similarly obtained from the Fourier expansion of the odd extension. $\endgroup$ Aug 30, 2022 at 21:13
  • $\begingroup$ The top of this question links to another question whose answer says, "On [−π,π], only even functions have cosine series". To me, that answers this question, but that's just me. What do you think? As for $\cos(n(x-\pi))$, I mean, that equals $(-1)^n\cos(nx)$... so it wouldn't make a difference. $\endgroup$ Aug 31, 2022 at 3:19

1 Answer 1


Since $\cos x$ is even so is $\cos(nx)$ for any integer $n$. Hence, is $f(x)$ could be "expanded" into sum of cosines on the right side we would have an even and on the left an odd function. Hence, if the "expansion" were convergent in any sensible way, its limit would be both an even and an odd function. This can happen only if $f(x) = 0$ almost everywhere.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .