Fourier cosine series for $cos x$












0












$begingroup$


I was trying to find the Fourier cosine series of the function $cos x$ in $[0, pi]$. But I am getting all $a_n$ zero. How to proceed?










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    Can you show your development ?
    $endgroup$
    – Yves Daoust
    Mar 9 '16 at 11:10










  • $begingroup$
    You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
    $endgroup$
    – Oscar Lanzi
    Mar 9 '16 at 11:19






  • 1




    $begingroup$
    @Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
    $endgroup$
    – user3575652
    Mar 10 '16 at 10:51








  • 1




    $begingroup$
    Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
    $endgroup$
    – CyclotomicField
    Jul 5 '18 at 4:03
















0












$begingroup$


I was trying to find the Fourier cosine series of the function $cos x$ in $[0, pi]$. But I am getting all $a_n$ zero. How to proceed?










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    Can you show your development ?
    $endgroup$
    – Yves Daoust
    Mar 9 '16 at 11:10










  • $begingroup$
    You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
    $endgroup$
    – Oscar Lanzi
    Mar 9 '16 at 11:19






  • 1




    $begingroup$
    @Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
    $endgroup$
    – user3575652
    Mar 10 '16 at 10:51








  • 1




    $begingroup$
    Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
    $endgroup$
    – CyclotomicField
    Jul 5 '18 at 4:03














0












0








0





$begingroup$


I was trying to find the Fourier cosine series of the function $cos x$ in $[0, pi]$. But I am getting all $a_n$ zero. How to proceed?










share|cite|improve this question











$endgroup$




I was trying to find the Fourier cosine series of the function $cos x$ in $[0, pi]$. But I am getting all $a_n$ zero. How to proceed?







fourier-series






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 9 '16 at 11:11









H. R.

9,42093262




9,42093262










asked Mar 9 '16 at 11:05









user3575652user3575652

87112




87112








  • 2




    $begingroup$
    Can you show your development ?
    $endgroup$
    – Yves Daoust
    Mar 9 '16 at 11:10










  • $begingroup$
    You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
    $endgroup$
    – Oscar Lanzi
    Mar 9 '16 at 11:19






  • 1




    $begingroup$
    @Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
    $endgroup$
    – user3575652
    Mar 10 '16 at 10:51








  • 1




    $begingroup$
    Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
    $endgroup$
    – CyclotomicField
    Jul 5 '18 at 4:03














  • 2




    $begingroup$
    Can you show your development ?
    $endgroup$
    – Yves Daoust
    Mar 9 '16 at 11:10










  • $begingroup$
    You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
    $endgroup$
    – Oscar Lanzi
    Mar 9 '16 at 11:19






  • 1




    $begingroup$
    @Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
    $endgroup$
    – user3575652
    Mar 10 '16 at 10:51








  • 1




    $begingroup$
    Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
    $endgroup$
    – CyclotomicField
    Jul 5 '18 at 4:03








2




2




$begingroup$
Can you show your development ?
$endgroup$
– Yves Daoust
Mar 9 '16 at 11:10




$begingroup$
Can you show your development ?
$endgroup$
– Yves Daoust
Mar 9 '16 at 11:10












$begingroup$
You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
$endgroup$
– Oscar Lanzi
Mar 9 '16 at 11:19




$begingroup$
You sure the terms are #all# zero? Doesn't the product cos $mx$ cos $nx$ have a different sort of antiderivative when $m=n$ versus otherwise?
$endgroup$
– Oscar Lanzi
Mar 9 '16 at 11:19




1




1




$begingroup$
@Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
$endgroup$
– user3575652
Mar 10 '16 at 10:51






$begingroup$
@Lanzi Sorry, I overlooked the case when $m=n$. Now I got $a_1=1$ and other $a_i$'s are zero.
$endgroup$
– user3575652
Mar 10 '16 at 10:51






1




1




$begingroup$
Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
$endgroup$
– CyclotomicField
Jul 5 '18 at 4:03




$begingroup$
Note that if you approximate $f(x)$ with some collection of functions that includes $f(x)$ then it perfectly approximates itself.
$endgroup$
– CyclotomicField
Jul 5 '18 at 4:03










3 Answers
3






active

oldest

votes


















0












$begingroup$

Don't forget the sine terms:



begin{align*}
f(x+2L) &= f(x) \
f(x) &=frac{a_{0}}{2}+
sum_{n=1}^{infty}
left(
a_{n}cos frac{npi x}{L}+
b_{n}sin frac{npi x}{L}
right) \
a_{n} &= frac{1}{L}int_{0}^{2L} f(t)cos frac{npi t}{L} dt \
&= frac{2}{pi}int_{0}^{pi} cos t cos (2nt) dt \
&= 0 \
b_{n} &= frac{1}{L}int_{0}^{2L} f(t)sin frac{npi t}{L} dt \
&= frac{2}{pi}int_{0}^{pi} cos t sin (2nt) dt \
&= frac{8n}{(4n^{2}-1)pi}
end{align*}






share|cite|improve this answer









$endgroup$













  • $begingroup$
    "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
    $endgroup$
    – David K
    May 3 '18 at 0:28



















0












$begingroup$

This question seems to have been answered in effect in comments, but here the answer is fleshed out in the "answer" section.



Under what seems to be the usual interpretation of a "Fourier cosine series",
you treat the region of integration $[0,pi]$ as just one half of the period of a periodic function, with the other half defined by the assumption that the function is even.
When you have an even function with period $2pi$ such as $cos x,$ its Fourier cosine series on $[0,pi]$ is identical to the Fourier series of the function on $[-pi,pi],$ which in turn can be computed by integrating over just the interval $[0,pi].$ At least that's how I look at it.



The formula for the coefficients of the series (as shown in Wolfram Mathworld, for example), is
$$
a_n = frac2pi int_0^pi f(x)cos(n x) dx,
$$
and setting $f(x) = cos x,$ this formula gives $a_1 = 1.$






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    $cosleft(xright)$ is itself a basis vector, so without any calculation you already know there is exactly one non-zero coefficient and its value is $1$... You can find that coefficient with a glance at the basis (and its numbering).






    share|cite|improve this answer









    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1689852%2ffourier-cosine-series-for-cos-x%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0












      $begingroup$

      Don't forget the sine terms:



      begin{align*}
      f(x+2L) &= f(x) \
      f(x) &=frac{a_{0}}{2}+
      sum_{n=1}^{infty}
      left(
      a_{n}cos frac{npi x}{L}+
      b_{n}sin frac{npi x}{L}
      right) \
      a_{n} &= frac{1}{L}int_{0}^{2L} f(t)cos frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t cos (2nt) dt \
      &= 0 \
      b_{n} &= frac{1}{L}int_{0}^{2L} f(t)sin frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t sin (2nt) dt \
      &= frac{8n}{(4n^{2}-1)pi}
      end{align*}






      share|cite|improve this answer









      $endgroup$













      • $begingroup$
        "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
        $endgroup$
        – David K
        May 3 '18 at 0:28
















      0












      $begingroup$

      Don't forget the sine terms:



      begin{align*}
      f(x+2L) &= f(x) \
      f(x) &=frac{a_{0}}{2}+
      sum_{n=1}^{infty}
      left(
      a_{n}cos frac{npi x}{L}+
      b_{n}sin frac{npi x}{L}
      right) \
      a_{n} &= frac{1}{L}int_{0}^{2L} f(t)cos frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t cos (2nt) dt \
      &= 0 \
      b_{n} &= frac{1}{L}int_{0}^{2L} f(t)sin frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t sin (2nt) dt \
      &= frac{8n}{(4n^{2}-1)pi}
      end{align*}






      share|cite|improve this answer









      $endgroup$













      • $begingroup$
        "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
        $endgroup$
        – David K
        May 3 '18 at 0:28














      0












      0








      0





      $begingroup$

      Don't forget the sine terms:



      begin{align*}
      f(x+2L) &= f(x) \
      f(x) &=frac{a_{0}}{2}+
      sum_{n=1}^{infty}
      left(
      a_{n}cos frac{npi x}{L}+
      b_{n}sin frac{npi x}{L}
      right) \
      a_{n} &= frac{1}{L}int_{0}^{2L} f(t)cos frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t cos (2nt) dt \
      &= 0 \
      b_{n} &= frac{1}{L}int_{0}^{2L} f(t)sin frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t sin (2nt) dt \
      &= frac{8n}{(4n^{2}-1)pi}
      end{align*}






      share|cite|improve this answer









      $endgroup$



      Don't forget the sine terms:



      begin{align*}
      f(x+2L) &= f(x) \
      f(x) &=frac{a_{0}}{2}+
      sum_{n=1}^{infty}
      left(
      a_{n}cos frac{npi x}{L}+
      b_{n}sin frac{npi x}{L}
      right) \
      a_{n} &= frac{1}{L}int_{0}^{2L} f(t)cos frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t cos (2nt) dt \
      &= 0 \
      b_{n} &= frac{1}{L}int_{0}^{2L} f(t)sin frac{npi t}{L} dt \
      &= frac{2}{pi}int_{0}^{pi} cos t sin (2nt) dt \
      &= frac{8n}{(4n^{2}-1)pi}
      end{align*}







      share|cite|improve this answer












      share|cite|improve this answer



      share|cite|improve this answer










      answered Mar 9 '16 at 12:45









      Ng Chung TakNg Chung Tak

      14.3k31334




      14.3k31334












      • $begingroup$
        "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
        $endgroup$
        – David K
        May 3 '18 at 0:28


















      • $begingroup$
        "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
        $endgroup$
        – David K
        May 3 '18 at 0:28
















      $begingroup$
      "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
      $endgroup$
      – David K
      May 3 '18 at 0:28




      $begingroup$
      "Fourier cosine series" implies a different formula, with $cos(nt)$ instead of $cos(t).$ See mathworld.wolfram.com/FourierCosineSeries.html
      $endgroup$
      – David K
      May 3 '18 at 0:28











      0












      $begingroup$

      This question seems to have been answered in effect in comments, but here the answer is fleshed out in the "answer" section.



      Under what seems to be the usual interpretation of a "Fourier cosine series",
      you treat the region of integration $[0,pi]$ as just one half of the period of a periodic function, with the other half defined by the assumption that the function is even.
      When you have an even function with period $2pi$ such as $cos x,$ its Fourier cosine series on $[0,pi]$ is identical to the Fourier series of the function on $[-pi,pi],$ which in turn can be computed by integrating over just the interval $[0,pi].$ At least that's how I look at it.



      The formula for the coefficients of the series (as shown in Wolfram Mathworld, for example), is
      $$
      a_n = frac2pi int_0^pi f(x)cos(n x) dx,
      $$
      and setting $f(x) = cos x,$ this formula gives $a_1 = 1.$






      share|cite|improve this answer









      $endgroup$


















        0












        $begingroup$

        This question seems to have been answered in effect in comments, but here the answer is fleshed out in the "answer" section.



        Under what seems to be the usual interpretation of a "Fourier cosine series",
        you treat the region of integration $[0,pi]$ as just one half of the period of a periodic function, with the other half defined by the assumption that the function is even.
        When you have an even function with period $2pi$ such as $cos x,$ its Fourier cosine series on $[0,pi]$ is identical to the Fourier series of the function on $[-pi,pi],$ which in turn can be computed by integrating over just the interval $[0,pi].$ At least that's how I look at it.



        The formula for the coefficients of the series (as shown in Wolfram Mathworld, for example), is
        $$
        a_n = frac2pi int_0^pi f(x)cos(n x) dx,
        $$
        and setting $f(x) = cos x,$ this formula gives $a_1 = 1.$






        share|cite|improve this answer









        $endgroup$
















          0












          0








          0





          $begingroup$

          This question seems to have been answered in effect in comments, but here the answer is fleshed out in the "answer" section.



          Under what seems to be the usual interpretation of a "Fourier cosine series",
          you treat the region of integration $[0,pi]$ as just one half of the period of a periodic function, with the other half defined by the assumption that the function is even.
          When you have an even function with period $2pi$ such as $cos x,$ its Fourier cosine series on $[0,pi]$ is identical to the Fourier series of the function on $[-pi,pi],$ which in turn can be computed by integrating over just the interval $[0,pi].$ At least that's how I look at it.



          The formula for the coefficients of the series (as shown in Wolfram Mathworld, for example), is
          $$
          a_n = frac2pi int_0^pi f(x)cos(n x) dx,
          $$
          and setting $f(x) = cos x,$ this formula gives $a_1 = 1.$






          share|cite|improve this answer









          $endgroup$



          This question seems to have been answered in effect in comments, but here the answer is fleshed out in the "answer" section.



          Under what seems to be the usual interpretation of a "Fourier cosine series",
          you treat the region of integration $[0,pi]$ as just one half of the period of a periodic function, with the other half defined by the assumption that the function is even.
          When you have an even function with period $2pi$ such as $cos x,$ its Fourier cosine series on $[0,pi]$ is identical to the Fourier series of the function on $[-pi,pi],$ which in turn can be computed by integrating over just the interval $[0,pi].$ At least that's how I look at it.



          The formula for the coefficients of the series (as shown in Wolfram Mathworld, for example), is
          $$
          a_n = frac2pi int_0^pi f(x)cos(n x) dx,
          $$
          and setting $f(x) = cos x,$ this formula gives $a_1 = 1.$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered May 3 '18 at 1:23









          David KDavid K

          52.9k340115




          52.9k340115























              0












              $begingroup$

              $cosleft(xright)$ is itself a basis vector, so without any calculation you already know there is exactly one non-zero coefficient and its value is $1$... You can find that coefficient with a glance at the basis (and its numbering).






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                $cosleft(xright)$ is itself a basis vector, so without any calculation you already know there is exactly one non-zero coefficient and its value is $1$... You can find that coefficient with a glance at the basis (and its numbering).






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  $cosleft(xright)$ is itself a basis vector, so without any calculation you already know there is exactly one non-zero coefficient and its value is $1$... You can find that coefficient with a glance at the basis (and its numbering).






                  share|cite|improve this answer









                  $endgroup$



                  $cosleft(xright)$ is itself a basis vector, so without any calculation you already know there is exactly one non-zero coefficient and its value is $1$... You can find that coefficient with a glance at the basis (and its numbering).







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered May 3 '18 at 1:35









                  mol3574710n0fN074710nmol3574710n0fN074710n

                  524311




                  524311






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1689852%2ffourier-cosine-series-for-cos-x%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Ellipse (mathématiques)

                      Quarter-circle Tiles

                      Mont Emei