Do I have something wrong when solving $y'+2y=6$?












5












$begingroup$


Solve $$y'+2y=6.$$





When I do $$y'=2(3-y)impliesintfrac{mathrm dy}{3-y}=2intmathrm dximplies-ln{|3-y|}=2x+cimplies3-y=ke^{-2x}therefore y=boxed{3-ke^{-2x}},quad c,kinBbb R.$$ It satisfies the ODE because $$2ke^{-2x}+6-2ke^{-2x}=6=6.$$ However, when I try another solution, namely first solve the homogeneous equation: $$y'+2y=0impliesintfrac{mathrm dy}y=-2intmathrm dximpliesln{|y|}=-2x+cimplies y=ke^{-2x},quad c,kinBbb R$$ then $y_P=k(x)e^{-2x}$, so then $$y'_P=k'(x)e^{-2x}-2k(x)e^{-2x}implies k'(x)e^{-2x}-2k(x)e^{-2x}+2k(x)e^{-2x}=6implies k'(x)=6e^{2x}implies k(x)=3e^{2x}implies y_P=3e^{2x}e^{-2x}=3therefore y=y_H+y_P=boxed{3+ke^{-2x}},$$ where this solution also satisfies $y'+2y=6$, because $$-2ke^{-2x}+6+2ke^{-2x}=6=6.$$ My question is, how can we express both solutions with the same expression of $y$? I would like both solutions to be identical, but how?



Thanks!










share|cite|improve this question









$endgroup$

















    5












    $begingroup$


    Solve $$y'+2y=6.$$





    When I do $$y'=2(3-y)impliesintfrac{mathrm dy}{3-y}=2intmathrm dximplies-ln{|3-y|}=2x+cimplies3-y=ke^{-2x}therefore y=boxed{3-ke^{-2x}},quad c,kinBbb R.$$ It satisfies the ODE because $$2ke^{-2x}+6-2ke^{-2x}=6=6.$$ However, when I try another solution, namely first solve the homogeneous equation: $$y'+2y=0impliesintfrac{mathrm dy}y=-2intmathrm dximpliesln{|y|}=-2x+cimplies y=ke^{-2x},quad c,kinBbb R$$ then $y_P=k(x)e^{-2x}$, so then $$y'_P=k'(x)e^{-2x}-2k(x)e^{-2x}implies k'(x)e^{-2x}-2k(x)e^{-2x}+2k(x)e^{-2x}=6implies k'(x)=6e^{2x}implies k(x)=3e^{2x}implies y_P=3e^{2x}e^{-2x}=3therefore y=y_H+y_P=boxed{3+ke^{-2x}},$$ where this solution also satisfies $y'+2y=6$, because $$-2ke^{-2x}+6+2ke^{-2x}=6=6.$$ My question is, how can we express both solutions with the same expression of $y$? I would like both solutions to be identical, but how?



    Thanks!










    share|cite|improve this question









    $endgroup$















      5












      5








      5


      1



      $begingroup$


      Solve $$y'+2y=6.$$





      When I do $$y'=2(3-y)impliesintfrac{mathrm dy}{3-y}=2intmathrm dximplies-ln{|3-y|}=2x+cimplies3-y=ke^{-2x}therefore y=boxed{3-ke^{-2x}},quad c,kinBbb R.$$ It satisfies the ODE because $$2ke^{-2x}+6-2ke^{-2x}=6=6.$$ However, when I try another solution, namely first solve the homogeneous equation: $$y'+2y=0impliesintfrac{mathrm dy}y=-2intmathrm dximpliesln{|y|}=-2x+cimplies y=ke^{-2x},quad c,kinBbb R$$ then $y_P=k(x)e^{-2x}$, so then $$y'_P=k'(x)e^{-2x}-2k(x)e^{-2x}implies k'(x)e^{-2x}-2k(x)e^{-2x}+2k(x)e^{-2x}=6implies k'(x)=6e^{2x}implies k(x)=3e^{2x}implies y_P=3e^{2x}e^{-2x}=3therefore y=y_H+y_P=boxed{3+ke^{-2x}},$$ where this solution also satisfies $y'+2y=6$, because $$-2ke^{-2x}+6+2ke^{-2x}=6=6.$$ My question is, how can we express both solutions with the same expression of $y$? I would like both solutions to be identical, but how?



      Thanks!










      share|cite|improve this question









      $endgroup$




      Solve $$y'+2y=6.$$





      When I do $$y'=2(3-y)impliesintfrac{mathrm dy}{3-y}=2intmathrm dximplies-ln{|3-y|}=2x+cimplies3-y=ke^{-2x}therefore y=boxed{3-ke^{-2x}},quad c,kinBbb R.$$ It satisfies the ODE because $$2ke^{-2x}+6-2ke^{-2x}=6=6.$$ However, when I try another solution, namely first solve the homogeneous equation: $$y'+2y=0impliesintfrac{mathrm dy}y=-2intmathrm dximpliesln{|y|}=-2x+cimplies y=ke^{-2x},quad c,kinBbb R$$ then $y_P=k(x)e^{-2x}$, so then $$y'_P=k'(x)e^{-2x}-2k(x)e^{-2x}implies k'(x)e^{-2x}-2k(x)e^{-2x}+2k(x)e^{-2x}=6implies k'(x)=6e^{2x}implies k(x)=3e^{2x}implies y_P=3e^{2x}e^{-2x}=3therefore y=y_H+y_P=boxed{3+ke^{-2x}},$$ where this solution also satisfies $y'+2y=6$, because $$-2ke^{-2x}+6+2ke^{-2x}=6=6.$$ My question is, how can we express both solutions with the same expression of $y$? I would like both solutions to be identical, but how?



      Thanks!







      ordinary-differential-equations






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 15 at 0:26









      manoooohmanooooh

      6651518




      6651518






















          3 Answers
          3






          active

          oldest

          votes


















          4












          $begingroup$

          Both solutions are the same, $k$ is a real number, you can write $3+(-k)e^{-2x}$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Oh I forgot that, thank you!!
            $endgroup$
            – manooooh
            Jan 15 at 0:32



















          2












          $begingroup$

          They are identical. You have no reason to expect $k $ from one method to be exactly the same from the other method. If you include an initial condition, you'll get the same solution in both cases.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
            $endgroup$
            – manooooh
            Jan 15 at 0:34



















          1












          $begingroup$

          To see both are the same:
          $$-ln|3-y|=2x+A Rightarrow ln|3-y|=-2x-A Rightarrow |3-y|=e^{-2x-A} Rightarrow |3-y|=e^{-A}e^{-2x} Rightarrow 3-y=-Ce^{-2x} Rightarrow y=3+Ce^{-2x}.$$
          Alternatively (instead of variations):
          $$y=y_h+y_p=Ce^{-2x}+A;\
          [Ce^{-2x}+A]'+2[Ce^{-2x}+A]=6 Rightarrow \
          2A=6 Rightarrow A=3 Rightarrow \
          y=Ce^{-2x}+3.$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
            $endgroup$
            – manooooh
            Jan 15 at 1:15














          Your Answer








          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%2f3073929%2fdo-i-have-something-wrong-when-solving-y2y-6%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









          4












          $begingroup$

          Both solutions are the same, $k$ is a real number, you can write $3+(-k)e^{-2x}$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Oh I forgot that, thank you!!
            $endgroup$
            – manooooh
            Jan 15 at 0:32
















          4












          $begingroup$

          Both solutions are the same, $k$ is a real number, you can write $3+(-k)e^{-2x}$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Oh I forgot that, thank you!!
            $endgroup$
            – manooooh
            Jan 15 at 0:32














          4












          4








          4





          $begingroup$

          Both solutions are the same, $k$ is a real number, you can write $3+(-k)e^{-2x}$.






          share|cite|improve this answer











          $endgroup$



          Both solutions are the same, $k$ is a real number, you can write $3+(-k)e^{-2x}$.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Jan 15 at 4:41









          Moo

          5,68531020




          5,68531020










          answered Jan 15 at 0:31









          Tsemo AristideTsemo Aristide

          60.9k11446




          60.9k11446












          • $begingroup$
            Oh I forgot that, thank you!!
            $endgroup$
            – manooooh
            Jan 15 at 0:32


















          • $begingroup$
            Oh I forgot that, thank you!!
            $endgroup$
            – manooooh
            Jan 15 at 0:32
















          $begingroup$
          Oh I forgot that, thank you!!
          $endgroup$
          – manooooh
          Jan 15 at 0:32




          $begingroup$
          Oh I forgot that, thank you!!
          $endgroup$
          – manooooh
          Jan 15 at 0:32











          2












          $begingroup$

          They are identical. You have no reason to expect $k $ from one method to be exactly the same from the other method. If you include an initial condition, you'll get the same solution in both cases.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
            $endgroup$
            – manooooh
            Jan 15 at 0:34
















          2












          $begingroup$

          They are identical. You have no reason to expect $k $ from one method to be exactly the same from the other method. If you include an initial condition, you'll get the same solution in both cases.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
            $endgroup$
            – manooooh
            Jan 15 at 0:34














          2












          2








          2





          $begingroup$

          They are identical. You have no reason to expect $k $ from one method to be exactly the same from the other method. If you include an initial condition, you'll get the same solution in both cases.






          share|cite|improve this answer









          $endgroup$



          They are identical. You have no reason to expect $k $ from one method to be exactly the same from the other method. If you include an initial condition, you'll get the same solution in both cases.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 15 at 0:32









          Martin ArgeramiMartin Argerami

          130k1184185




          130k1184185












          • $begingroup$
            There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
            $endgroup$
            – manooooh
            Jan 15 at 0:34


















          • $begingroup$
            There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
            $endgroup$
            – manooooh
            Jan 15 at 0:34
















          $begingroup$
          There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
          $endgroup$
          – manooooh
          Jan 15 at 0:34




          $begingroup$
          There is indeed an initial condition, but I wanted to know why I end up with two "different" solutions. Thanks!
          $endgroup$
          – manooooh
          Jan 15 at 0:34











          1












          $begingroup$

          To see both are the same:
          $$-ln|3-y|=2x+A Rightarrow ln|3-y|=-2x-A Rightarrow |3-y|=e^{-2x-A} Rightarrow |3-y|=e^{-A}e^{-2x} Rightarrow 3-y=-Ce^{-2x} Rightarrow y=3+Ce^{-2x}.$$
          Alternatively (instead of variations):
          $$y=y_h+y_p=Ce^{-2x}+A;\
          [Ce^{-2x}+A]'+2[Ce^{-2x}+A]=6 Rightarrow \
          2A=6 Rightarrow A=3 Rightarrow \
          y=Ce^{-2x}+3.$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
            $endgroup$
            – manooooh
            Jan 15 at 1:15


















          1












          $begingroup$

          To see both are the same:
          $$-ln|3-y|=2x+A Rightarrow ln|3-y|=-2x-A Rightarrow |3-y|=e^{-2x-A} Rightarrow |3-y|=e^{-A}e^{-2x} Rightarrow 3-y=-Ce^{-2x} Rightarrow y=3+Ce^{-2x}.$$
          Alternatively (instead of variations):
          $$y=y_h+y_p=Ce^{-2x}+A;\
          [Ce^{-2x}+A]'+2[Ce^{-2x}+A]=6 Rightarrow \
          2A=6 Rightarrow A=3 Rightarrow \
          y=Ce^{-2x}+3.$$






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
            $endgroup$
            – manooooh
            Jan 15 at 1:15
















          1












          1








          1





          $begingroup$

          To see both are the same:
          $$-ln|3-y|=2x+A Rightarrow ln|3-y|=-2x-A Rightarrow |3-y|=e^{-2x-A} Rightarrow |3-y|=e^{-A}e^{-2x} Rightarrow 3-y=-Ce^{-2x} Rightarrow y=3+Ce^{-2x}.$$
          Alternatively (instead of variations):
          $$y=y_h+y_p=Ce^{-2x}+A;\
          [Ce^{-2x}+A]'+2[Ce^{-2x}+A]=6 Rightarrow \
          2A=6 Rightarrow A=3 Rightarrow \
          y=Ce^{-2x}+3.$$






          share|cite|improve this answer









          $endgroup$



          To see both are the same:
          $$-ln|3-y|=2x+A Rightarrow ln|3-y|=-2x-A Rightarrow |3-y|=e^{-2x-A} Rightarrow |3-y|=e^{-A}e^{-2x} Rightarrow 3-y=-Ce^{-2x} Rightarrow y=3+Ce^{-2x}.$$
          Alternatively (instead of variations):
          $$y=y_h+y_p=Ce^{-2x}+A;\
          [Ce^{-2x}+A]'+2[Ce^{-2x}+A]=6 Rightarrow \
          2A=6 Rightarrow A=3 Rightarrow \
          y=Ce^{-2x}+3.$$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 15 at 1:08









          farruhotafarruhota

          22.5k2942




          22.5k2942












          • $begingroup$
            Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
            $endgroup$
            – manooooh
            Jan 15 at 1:15




















          • $begingroup$
            Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
            $endgroup$
            – manooooh
            Jan 15 at 1:15


















          $begingroup$
          Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
          $endgroup$
          – manooooh
          Jan 15 at 1:15






          $begingroup$
          Oh, you did $e^{-A}to-C$ when $|3-y|to(3-y)$ instead of $e^{-A}to C$, that is nice! Also I like your approach $ddotsmile$.
          $endgroup$
          – manooooh
          Jan 15 at 1:15




















          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%2f3073929%2fdo-i-have-something-wrong-when-solving-y2y-6%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

          Bressuire

          Cabo Verde

          Gyllenstierna