Method of Undermined coefficients












0












$begingroup$


The following equation:
$y''+y=cos(x)$



Solving $y''+y=0$ gives me $c_1cos(x)+c_2sin(x)$



Using the particular integral yp form of $acos(x)+bsin(x)$ and substituting this back into the ODE



$y = acos(x)+bsin(x)$, $y'=-asin(x)+bcos(x)$, $y''=-acos(x)-bsin(x)$



Plugging this back into the ODE leaves me with $0=cos(x)$



So how is the particular solution $y=1/2xsin(x)$ with the coefficients value of $c_1=0$ and $c_2=1/2$, and where does the $x$ come from?










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 17:58










  • $begingroup$
    Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
    $endgroup$
    – luffy
    Dec 19 '18 at 18:01








  • 2




    $begingroup$
    You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 18:02


















0












$begingroup$


The following equation:
$y''+y=cos(x)$



Solving $y''+y=0$ gives me $c_1cos(x)+c_2sin(x)$



Using the particular integral yp form of $acos(x)+bsin(x)$ and substituting this back into the ODE



$y = acos(x)+bsin(x)$, $y'=-asin(x)+bcos(x)$, $y''=-acos(x)-bsin(x)$



Plugging this back into the ODE leaves me with $0=cos(x)$



So how is the particular solution $y=1/2xsin(x)$ with the coefficients value of $c_1=0$ and $c_2=1/2$, and where does the $x$ come from?










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 17:58










  • $begingroup$
    Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
    $endgroup$
    – luffy
    Dec 19 '18 at 18:01








  • 2




    $begingroup$
    You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 18:02
















0












0








0





$begingroup$


The following equation:
$y''+y=cos(x)$



Solving $y''+y=0$ gives me $c_1cos(x)+c_2sin(x)$



Using the particular integral yp form of $acos(x)+bsin(x)$ and substituting this back into the ODE



$y = acos(x)+bsin(x)$, $y'=-asin(x)+bcos(x)$, $y''=-acos(x)-bsin(x)$



Plugging this back into the ODE leaves me with $0=cos(x)$



So how is the particular solution $y=1/2xsin(x)$ with the coefficients value of $c_1=0$ and $c_2=1/2$, and where does the $x$ come from?










share|cite|improve this question











$endgroup$




The following equation:
$y''+y=cos(x)$



Solving $y''+y=0$ gives me $c_1cos(x)+c_2sin(x)$



Using the particular integral yp form of $acos(x)+bsin(x)$ and substituting this back into the ODE



$y = acos(x)+bsin(x)$, $y'=-asin(x)+bcos(x)$, $y''=-acos(x)-bsin(x)$



Plugging this back into the ODE leaves me with $0=cos(x)$



So how is the particular solution $y=1/2xsin(x)$ with the coefficients value of $c_1=0$ and $c_2=1/2$, and where does the $x$ come from?







calculus multivariable-calculus numerical-methods






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 19 '18 at 18:09









Andrei

12k21126




12k21126










asked Dec 19 '18 at 17:52









luffyluffy

92




92








  • 2




    $begingroup$
    The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 17:58










  • $begingroup$
    Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
    $endgroup$
    – luffy
    Dec 19 '18 at 18:01








  • 2




    $begingroup$
    You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 18:02
















  • 2




    $begingroup$
    The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 17:58










  • $begingroup$
    Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
    $endgroup$
    – luffy
    Dec 19 '18 at 18:01








  • 2




    $begingroup$
    You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
    $endgroup$
    – Joel Pereira
    Dec 19 '18 at 18:02










2




2




$begingroup$
The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
$endgroup$
– Joel Pereira
Dec 19 '18 at 17:58




$begingroup$
The problem you have is that the particular solution is a form of the homogeneous solution. You need to multiply your particular solution by $x$ so as to avoid a homogenous solution.
$endgroup$
– Joel Pereira
Dec 19 '18 at 17:58












$begingroup$
Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
$endgroup$
– luffy
Dec 19 '18 at 18:01






$begingroup$
Okay, but how is the coefficient c1=0 and c2=1/2 when the $cos(x), sin(x)$ all cancel out which leaves $0=cos(x)$
$endgroup$
– luffy
Dec 19 '18 at 18:01






2




2




$begingroup$
You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
$endgroup$
– Joel Pereira
Dec 19 '18 at 18:02






$begingroup$
You let $y_p = axcos(x)+bxsin(x)$. Now find $y^{,prime}_p$ and $y_p^{,primeprime}$ and plug into your equation. You will be able to find the coefficients. Be careful: the derivatives involve the product rule.
$endgroup$
– Joel Pereira
Dec 19 '18 at 18:02












2 Answers
2






active

oldest

votes


















0












$begingroup$

Observe that $y''+y = 0 Rightarrow y=c_1 cos(x) + c_2 sin(x)$. So your forcing term $f(x) = cos(x)$ is a solution to the homogenous solution, so we need to come up with a new basis for the method of undetermined coefficients. Since equating coefficients will fail for this basis since if $y=c_1 cos(x) + c_2 sin(x)$, the left hand side will always be a $0$ sicne it's a solution to the homogenous equation .The main way is to differentiate the homogenous solution $y_h$ with respect to $r$ where $r$ is the root of the characteristic polynomial. For this case,



$y(x) = c_1e^{rx} + c_2e^{-rx}, r = i$, so $frac{dy}{dr} = xy_h(x) = x(alpha_1cos(x) + alpha_2sin(x))$ after the usual linear combination rearrangement trick for $e^{ix},e^{-ix}$ using Euler's identity. So our new basis for trial solutions $x(alpha_1cos(x) + alpha_2sin(x))$ which after equating coefficients will give you $alpha_1 = 0, alpha_2 = frac{1}{2}$. Remember to add in the homogenous solution at the end.






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    Let's choose a more general particular solution for $y''+y=cos(nx)$ in the form $y_p=(ax+b)sin(nx)+(cx+d)cos(nx)$, with $n>0$. You can easily show
    $$y_p''=−n((anx+bn+2c)sin(nx)+(cnx+dn−2a)cos(nx))$$
    Let's plug these two into the original equation, and you get $$xsin(nx)(-an^2+a)+sin(nx)(-bn^2-2nc+b)+xcos(nx)(-cn^2+c)+cos(nx)(-dn^2+2an+d)=cos(nx)$$



    In case $n=1$, you have $1-n^2=0$, so your equation simplifies to $$-2csin(x)+2acos(x)=cos(x)$$
    The solutions are therefore $c=0$ and $a=1/2$, so your solution is $$y_p=frac 12xsin s$$
    It is interesting to see what happens if $nne 1$. Then if you kook at just the coefficients of $xsin(nx)$ you get $a(1-n^2)=0$. That means $a=0$. Similarly, for $xcos(nx)$ you get $c=0$. You equation reduces to $$b(1-n^2)sin(nx)+d(1-n^2)cos(nx)=cos(nx)$$
    You have therefore $b=0$ and $d=frac1{1-n^2}$. So no terms with $x$ multiplied with a trigonometric function.



    So the conclusion is that if the free term in the ODE is the same type as the homogeneous solution, the particular solution is the form $axsin x+bxcos x$, otherwise it does not contain $x$.






    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%2f3046675%2fmethod-of-undermined-coefficients%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0












      $begingroup$

      Observe that $y''+y = 0 Rightarrow y=c_1 cos(x) + c_2 sin(x)$. So your forcing term $f(x) = cos(x)$ is a solution to the homogenous solution, so we need to come up with a new basis for the method of undetermined coefficients. Since equating coefficients will fail for this basis since if $y=c_1 cos(x) + c_2 sin(x)$, the left hand side will always be a $0$ sicne it's a solution to the homogenous equation .The main way is to differentiate the homogenous solution $y_h$ with respect to $r$ where $r$ is the root of the characteristic polynomial. For this case,



      $y(x) = c_1e^{rx} + c_2e^{-rx}, r = i$, so $frac{dy}{dr} = xy_h(x) = x(alpha_1cos(x) + alpha_2sin(x))$ after the usual linear combination rearrangement trick for $e^{ix},e^{-ix}$ using Euler's identity. So our new basis for trial solutions $x(alpha_1cos(x) + alpha_2sin(x))$ which after equating coefficients will give you $alpha_1 = 0, alpha_2 = frac{1}{2}$. Remember to add in the homogenous solution at the end.






      share|cite|improve this answer









      $endgroup$


















        0












        $begingroup$

        Observe that $y''+y = 0 Rightarrow y=c_1 cos(x) + c_2 sin(x)$. So your forcing term $f(x) = cos(x)$ is a solution to the homogenous solution, so we need to come up with a new basis for the method of undetermined coefficients. Since equating coefficients will fail for this basis since if $y=c_1 cos(x) + c_2 sin(x)$, the left hand side will always be a $0$ sicne it's a solution to the homogenous equation .The main way is to differentiate the homogenous solution $y_h$ with respect to $r$ where $r$ is the root of the characteristic polynomial. For this case,



        $y(x) = c_1e^{rx} + c_2e^{-rx}, r = i$, so $frac{dy}{dr} = xy_h(x) = x(alpha_1cos(x) + alpha_2sin(x))$ after the usual linear combination rearrangement trick for $e^{ix},e^{-ix}$ using Euler's identity. So our new basis for trial solutions $x(alpha_1cos(x) + alpha_2sin(x))$ which after equating coefficients will give you $alpha_1 = 0, alpha_2 = frac{1}{2}$. Remember to add in the homogenous solution at the end.






        share|cite|improve this answer









        $endgroup$
















          0












          0








          0





          $begingroup$

          Observe that $y''+y = 0 Rightarrow y=c_1 cos(x) + c_2 sin(x)$. So your forcing term $f(x) = cos(x)$ is a solution to the homogenous solution, so we need to come up with a new basis for the method of undetermined coefficients. Since equating coefficients will fail for this basis since if $y=c_1 cos(x) + c_2 sin(x)$, the left hand side will always be a $0$ sicne it's a solution to the homogenous equation .The main way is to differentiate the homogenous solution $y_h$ with respect to $r$ where $r$ is the root of the characteristic polynomial. For this case,



          $y(x) = c_1e^{rx} + c_2e^{-rx}, r = i$, so $frac{dy}{dr} = xy_h(x) = x(alpha_1cos(x) + alpha_2sin(x))$ after the usual linear combination rearrangement trick for $e^{ix},e^{-ix}$ using Euler's identity. So our new basis for trial solutions $x(alpha_1cos(x) + alpha_2sin(x))$ which after equating coefficients will give you $alpha_1 = 0, alpha_2 = frac{1}{2}$. Remember to add in the homogenous solution at the end.






          share|cite|improve this answer









          $endgroup$



          Observe that $y''+y = 0 Rightarrow y=c_1 cos(x) + c_2 sin(x)$. So your forcing term $f(x) = cos(x)$ is a solution to the homogenous solution, so we need to come up with a new basis for the method of undetermined coefficients. Since equating coefficients will fail for this basis since if $y=c_1 cos(x) + c_2 sin(x)$, the left hand side will always be a $0$ sicne it's a solution to the homogenous equation .The main way is to differentiate the homogenous solution $y_h$ with respect to $r$ where $r$ is the root of the characteristic polynomial. For this case,



          $y(x) = c_1e^{rx} + c_2e^{-rx}, r = i$, so $frac{dy}{dr} = xy_h(x) = x(alpha_1cos(x) + alpha_2sin(x))$ after the usual linear combination rearrangement trick for $e^{ix},e^{-ix}$ using Euler's identity. So our new basis for trial solutions $x(alpha_1cos(x) + alpha_2sin(x))$ which after equating coefficients will give you $alpha_1 = 0, alpha_2 = frac{1}{2}$. Remember to add in the homogenous solution at the end.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 19 '18 at 18:16









          Story123Story123

          22017




          22017























              0












              $begingroup$

              Let's choose a more general particular solution for $y''+y=cos(nx)$ in the form $y_p=(ax+b)sin(nx)+(cx+d)cos(nx)$, with $n>0$. You can easily show
              $$y_p''=−n((anx+bn+2c)sin(nx)+(cnx+dn−2a)cos(nx))$$
              Let's plug these two into the original equation, and you get $$xsin(nx)(-an^2+a)+sin(nx)(-bn^2-2nc+b)+xcos(nx)(-cn^2+c)+cos(nx)(-dn^2+2an+d)=cos(nx)$$



              In case $n=1$, you have $1-n^2=0$, so your equation simplifies to $$-2csin(x)+2acos(x)=cos(x)$$
              The solutions are therefore $c=0$ and $a=1/2$, so your solution is $$y_p=frac 12xsin s$$
              It is interesting to see what happens if $nne 1$. Then if you kook at just the coefficients of $xsin(nx)$ you get $a(1-n^2)=0$. That means $a=0$. Similarly, for $xcos(nx)$ you get $c=0$. You equation reduces to $$b(1-n^2)sin(nx)+d(1-n^2)cos(nx)=cos(nx)$$
              You have therefore $b=0$ and $d=frac1{1-n^2}$. So no terms with $x$ multiplied with a trigonometric function.



              So the conclusion is that if the free term in the ODE is the same type as the homogeneous solution, the particular solution is the form $axsin x+bxcos x$, otherwise it does not contain $x$.






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                Let's choose a more general particular solution for $y''+y=cos(nx)$ in the form $y_p=(ax+b)sin(nx)+(cx+d)cos(nx)$, with $n>0$. You can easily show
                $$y_p''=−n((anx+bn+2c)sin(nx)+(cnx+dn−2a)cos(nx))$$
                Let's plug these two into the original equation, and you get $$xsin(nx)(-an^2+a)+sin(nx)(-bn^2-2nc+b)+xcos(nx)(-cn^2+c)+cos(nx)(-dn^2+2an+d)=cos(nx)$$



                In case $n=1$, you have $1-n^2=0$, so your equation simplifies to $$-2csin(x)+2acos(x)=cos(x)$$
                The solutions are therefore $c=0$ and $a=1/2$, so your solution is $$y_p=frac 12xsin s$$
                It is interesting to see what happens if $nne 1$. Then if you kook at just the coefficients of $xsin(nx)$ you get $a(1-n^2)=0$. That means $a=0$. Similarly, for $xcos(nx)$ you get $c=0$. You equation reduces to $$b(1-n^2)sin(nx)+d(1-n^2)cos(nx)=cos(nx)$$
                You have therefore $b=0$ and $d=frac1{1-n^2}$. So no terms with $x$ multiplied with a trigonometric function.



                So the conclusion is that if the free term in the ODE is the same type as the homogeneous solution, the particular solution is the form $axsin x+bxcos x$, otherwise it does not contain $x$.






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  Let's choose a more general particular solution for $y''+y=cos(nx)$ in the form $y_p=(ax+b)sin(nx)+(cx+d)cos(nx)$, with $n>0$. You can easily show
                  $$y_p''=−n((anx+bn+2c)sin(nx)+(cnx+dn−2a)cos(nx))$$
                  Let's plug these two into the original equation, and you get $$xsin(nx)(-an^2+a)+sin(nx)(-bn^2-2nc+b)+xcos(nx)(-cn^2+c)+cos(nx)(-dn^2+2an+d)=cos(nx)$$



                  In case $n=1$, you have $1-n^2=0$, so your equation simplifies to $$-2csin(x)+2acos(x)=cos(x)$$
                  The solutions are therefore $c=0$ and $a=1/2$, so your solution is $$y_p=frac 12xsin s$$
                  It is interesting to see what happens if $nne 1$. Then if you kook at just the coefficients of $xsin(nx)$ you get $a(1-n^2)=0$. That means $a=0$. Similarly, for $xcos(nx)$ you get $c=0$. You equation reduces to $$b(1-n^2)sin(nx)+d(1-n^2)cos(nx)=cos(nx)$$
                  You have therefore $b=0$ and $d=frac1{1-n^2}$. So no terms with $x$ multiplied with a trigonometric function.



                  So the conclusion is that if the free term in the ODE is the same type as the homogeneous solution, the particular solution is the form $axsin x+bxcos x$, otherwise it does not contain $x$.






                  share|cite|improve this answer









                  $endgroup$



                  Let's choose a more general particular solution for $y''+y=cos(nx)$ in the form $y_p=(ax+b)sin(nx)+(cx+d)cos(nx)$, with $n>0$. You can easily show
                  $$y_p''=−n((anx+bn+2c)sin(nx)+(cnx+dn−2a)cos(nx))$$
                  Let's plug these two into the original equation, and you get $$xsin(nx)(-an^2+a)+sin(nx)(-bn^2-2nc+b)+xcos(nx)(-cn^2+c)+cos(nx)(-dn^2+2an+d)=cos(nx)$$



                  In case $n=1$, you have $1-n^2=0$, so your equation simplifies to $$-2csin(x)+2acos(x)=cos(x)$$
                  The solutions are therefore $c=0$ and $a=1/2$, so your solution is $$y_p=frac 12xsin s$$
                  It is interesting to see what happens if $nne 1$. Then if you kook at just the coefficients of $xsin(nx)$ you get $a(1-n^2)=0$. That means $a=0$. Similarly, for $xcos(nx)$ you get $c=0$. You equation reduces to $$b(1-n^2)sin(nx)+d(1-n^2)cos(nx)=cos(nx)$$
                  You have therefore $b=0$ and $d=frac1{1-n^2}$. So no terms with $x$ multiplied with a trigonometric function.



                  So the conclusion is that if the free term in the ODE is the same type as the homogeneous solution, the particular solution is the form $axsin x+bxcos x$, otherwise it does not contain $x$.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 19 '18 at 18:50









                  AndreiAndrei

                  12k21126




                  12k21126






























                      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%2f3046675%2fmethod-of-undermined-coefficients%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

                      Quarter-circle Tiles

                      build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                      Mont Emei