Approximate the solutions as a series

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I would like to solve the following equation $y^2=x^2+ax^2y^2+by^2x^3+cy^3x^2$ where $a,b,c$ are small, so $yapprox x+O(x^3)$. I would like to have a series approximation of the solution rather than an exact one, i.e. like $y=x+c_1x^3+c_2x^4+...$.



Is there a default function in mathematica that does that?










share|improve this question

























    up vote
    1
    down vote

    favorite












    I would like to solve the following equation $y^2=x^2+ax^2y^2+by^2x^3+cy^3x^2$ where $a,b,c$ are small, so $yapprox x+O(x^3)$. I would like to have a series approximation of the solution rather than an exact one, i.e. like $y=x+c_1x^3+c_2x^4+...$.



    Is there a default function in mathematica that does that?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I would like to solve the following equation $y^2=x^2+ax^2y^2+by^2x^3+cy^3x^2$ where $a,b,c$ are small, so $yapprox x+O(x^3)$. I would like to have a series approximation of the solution rather than an exact one, i.e. like $y=x+c_1x^3+c_2x^4+...$.



      Is there a default function in mathematica that does that?










      share|improve this question













      I would like to solve the following equation $y^2=x^2+ax^2y^2+by^2x^3+cy^3x^2$ where $a,b,c$ are small, so $yapprox x+O(x^3)$. I would like to have a series approximation of the solution rather than an exact one, i.e. like $y=x+c_1x^3+c_2x^4+...$.



      Is there a default function in mathematica that does that?







      equation-solving series-expansion approximation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      Shadumu

      1085




      1085




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Quick-and-dirty solution:



          y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. 
          y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 // FullSimplify
          Solve[% == 0, c1, c2, c3]
          y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 /. % // TeXForm



          $$yto x+fraca x^32+frac12 (b+c) x^4+Oleft(x^5right)$$




          Compare to the exact solution:



          FullSimplify[
          Series[
          Solve[y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) == 0, y][[3, 1, 2]]
          , x, 0, 4],
          c > 0
          ]





          share|improve this answer






















          • thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
            – Shadumu
            1 hour ago

















          up vote
          2
          down vote













          Could use implicit differentiation, solve for all derivatives at x==0.



          ee = y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. y -> y[x];
          dpolys = Table[D[ee, x, j], j, 0, 5] /. x -> 0

          (* y[0]^2, 2*y[0]*Derivative[1][y][0], -2 - 2*a*y[0]^2 - 2*c*y[0]^3 +
          2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0],
          -6*b*y[0]^2 - 12*a*y[0]*Derivative[1][y][0] -
          18*c*y[0]^2*Derivative[1][y][0] +
          6*Derivative[1][y][0]*Derivative[2][y][0] +
          2*y[0]*Derivative[3][y][0],
          -48*b*y[0]*Derivative[1][y][0] + 6*Derivative[2][y][0]^2 -
          12*a*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) -
          12*c*(6*y[0]*Derivative[1][y][0]^2 +
          3*y[0]^2*Derivative[2][y][0]) +
          8*Derivative[1][y][0]*Derivative[3][y][0] +
          2*y[0]*Derivative[4][y][0],
          -60*b*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) +
          20*Derivative[2][y][0]*Derivative[3][y][0] -
          20*a*(6*Derivative[1][y][0]*Derivative[2][y][0] +
          2*y[0]*Derivative[3][y][0]) -
          20*c*(6*Derivative[1][y][0]^3 +
          18*y[0]*Derivative[1][y][0]*Derivative[2][y][0] +
          3*y[0]^2*Derivative[3][y][0]) +
          10*Derivative[1][y][0]*Derivative[4][y][0] +
          2*y[0]*Derivative[5][y][0] *)

          soln = Solve[dpolys == 0]

          (* Out[139]= y[0] -> 0, Derivative[1][y][0] -> -1,
          Derivative[2][y][0] -> 0,
          Derivative[3][y][0] -> -3*a, Derivative[4][y][0] -> 12*(-b + c),
          y[0] -> 0, Derivative[1][y][0] -> 1, Derivative[2][y][0] -> 0,
          Derivative[3][y][0] -> 3*a, Derivative[4][y][0] -> 12*(b + c) *)


          So two solutions, both getting up to the fourth order term. We create a table, then use the solutions to fill in values and recast as a Taylor polynomial for each solution branch.



          derivs = Table[D[y[x], x, j], j, 0, 4] /. x -> 0;
          derivs.(x^Range[0, 4]/Factorial[Range[0, 4]]) /. soln

          (* Out[142]= -x - (a x^3)/2 + 1/2 (-b + c) x^4,
          x + (a x^3)/2 + 1/2 (b + c) x^4 *)





          share|improve this answer




















            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: "387"
            ;
            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',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185295%2fapproximate-the-solutions-as-a-series%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Quick-and-dirty solution:



            y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. 
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 // FullSimplify
            Solve[% == 0, c1, c2, c3]
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 /. % // TeXForm



            $$yto x+fraca x^32+frac12 (b+c) x^4+Oleft(x^5right)$$




            Compare to the exact solution:



            FullSimplify[
            Series[
            Solve[y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) == 0, y][[3, 1, 2]]
            , x, 0, 4],
            c > 0
            ]





            share|improve this answer






















            • thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
              – Shadumu
              1 hour ago














            up vote
            2
            down vote



            accepted










            Quick-and-dirty solution:



            y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. 
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 // FullSimplify
            Solve[% == 0, c1, c2, c3]
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 /. % // TeXForm



            $$yto x+fraca x^32+frac12 (b+c) x^4+Oleft(x^5right)$$




            Compare to the exact solution:



            FullSimplify[
            Series[
            Solve[y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) == 0, y][[3, 1, 2]]
            , x, 0, 4],
            c > 0
            ]





            share|improve this answer






















            • thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
              – Shadumu
              1 hour ago












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            Quick-and-dirty solution:



            y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. 
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 // FullSimplify
            Solve[% == 0, c1, c2, c3]
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 /. % // TeXForm



            $$yto x+fraca x^32+frac12 (b+c) x^4+Oleft(x^5right)$$




            Compare to the exact solution:



            FullSimplify[
            Series[
            Solve[y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) == 0, y][[3, 1, 2]]
            , x, 0, 4],
            c > 0
            ]





            share|improve this answer














            Quick-and-dirty solution:



            y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. 
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 // FullSimplify
            Solve[% == 0, c1, c2, c3]
            y -> x + c1 x^2 + c2 x^3 + c3 x^4 + O[x]^5 /. % // TeXForm



            $$yto x+fraca x^32+frac12 (b+c) x^4+Oleft(x^5right)$$




            Compare to the exact solution:



            FullSimplify[
            Series[
            Solve[y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) == 0, y][[3, 1, 2]]
            , x, 0, 4],
            c > 0
            ]






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 2 hours ago

























            answered 2 hours ago









            AccidentalFourierTransform

            4,8361940




            4,8361940











            • thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
              – Shadumu
              1 hour ago
















            • thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
              – Shadumu
              1 hour ago















            thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
            – Shadumu
            1 hour ago




            thanks a lot! I'm new to mathematica, would you briefly explain to me the difference between your two methods? and what does the [3,1,2] mean?
            – Shadumu
            1 hour ago










            up vote
            2
            down vote













            Could use implicit differentiation, solve for all derivatives at x==0.



            ee = y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. y -> y[x];
            dpolys = Table[D[ee, x, j], j, 0, 5] /. x -> 0

            (* y[0]^2, 2*y[0]*Derivative[1][y][0], -2 - 2*a*y[0]^2 - 2*c*y[0]^3 +
            2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0],
            -6*b*y[0]^2 - 12*a*y[0]*Derivative[1][y][0] -
            18*c*y[0]^2*Derivative[1][y][0] +
            6*Derivative[1][y][0]*Derivative[2][y][0] +
            2*y[0]*Derivative[3][y][0],
            -48*b*y[0]*Derivative[1][y][0] + 6*Derivative[2][y][0]^2 -
            12*a*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) -
            12*c*(6*y[0]*Derivative[1][y][0]^2 +
            3*y[0]^2*Derivative[2][y][0]) +
            8*Derivative[1][y][0]*Derivative[3][y][0] +
            2*y[0]*Derivative[4][y][0],
            -60*b*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) +
            20*Derivative[2][y][0]*Derivative[3][y][0] -
            20*a*(6*Derivative[1][y][0]*Derivative[2][y][0] +
            2*y[0]*Derivative[3][y][0]) -
            20*c*(6*Derivative[1][y][0]^3 +
            18*y[0]*Derivative[1][y][0]*Derivative[2][y][0] +
            3*y[0]^2*Derivative[3][y][0]) +
            10*Derivative[1][y][0]*Derivative[4][y][0] +
            2*y[0]*Derivative[5][y][0] *)

            soln = Solve[dpolys == 0]

            (* Out[139]= y[0] -> 0, Derivative[1][y][0] -> -1,
            Derivative[2][y][0] -> 0,
            Derivative[3][y][0] -> -3*a, Derivative[4][y][0] -> 12*(-b + c),
            y[0] -> 0, Derivative[1][y][0] -> 1, Derivative[2][y][0] -> 0,
            Derivative[3][y][0] -> 3*a, Derivative[4][y][0] -> 12*(b + c) *)


            So two solutions, both getting up to the fourth order term. We create a table, then use the solutions to fill in values and recast as a Taylor polynomial for each solution branch.



            derivs = Table[D[y[x], x, j], j, 0, 4] /. x -> 0;
            derivs.(x^Range[0, 4]/Factorial[Range[0, 4]]) /. soln

            (* Out[142]= -x - (a x^3)/2 + 1/2 (-b + c) x^4,
            x + (a x^3)/2 + 1/2 (b + c) x^4 *)





            share|improve this answer
























              up vote
              2
              down vote













              Could use implicit differentiation, solve for all derivatives at x==0.



              ee = y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. y -> y[x];
              dpolys = Table[D[ee, x, j], j, 0, 5] /. x -> 0

              (* y[0]^2, 2*y[0]*Derivative[1][y][0], -2 - 2*a*y[0]^2 - 2*c*y[0]^3 +
              2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0],
              -6*b*y[0]^2 - 12*a*y[0]*Derivative[1][y][0] -
              18*c*y[0]^2*Derivative[1][y][0] +
              6*Derivative[1][y][0]*Derivative[2][y][0] +
              2*y[0]*Derivative[3][y][0],
              -48*b*y[0]*Derivative[1][y][0] + 6*Derivative[2][y][0]^2 -
              12*a*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) -
              12*c*(6*y[0]*Derivative[1][y][0]^2 +
              3*y[0]^2*Derivative[2][y][0]) +
              8*Derivative[1][y][0]*Derivative[3][y][0] +
              2*y[0]*Derivative[4][y][0],
              -60*b*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) +
              20*Derivative[2][y][0]*Derivative[3][y][0] -
              20*a*(6*Derivative[1][y][0]*Derivative[2][y][0] +
              2*y[0]*Derivative[3][y][0]) -
              20*c*(6*Derivative[1][y][0]^3 +
              18*y[0]*Derivative[1][y][0]*Derivative[2][y][0] +
              3*y[0]^2*Derivative[3][y][0]) +
              10*Derivative[1][y][0]*Derivative[4][y][0] +
              2*y[0]*Derivative[5][y][0] *)

              soln = Solve[dpolys == 0]

              (* Out[139]= y[0] -> 0, Derivative[1][y][0] -> -1,
              Derivative[2][y][0] -> 0,
              Derivative[3][y][0] -> -3*a, Derivative[4][y][0] -> 12*(-b + c),
              y[0] -> 0, Derivative[1][y][0] -> 1, Derivative[2][y][0] -> 0,
              Derivative[3][y][0] -> 3*a, Derivative[4][y][0] -> 12*(b + c) *)


              So two solutions, both getting up to the fourth order term. We create a table, then use the solutions to fill in values and recast as a Taylor polynomial for each solution branch.



              derivs = Table[D[y[x], x, j], j, 0, 4] /. x -> 0;
              derivs.(x^Range[0, 4]/Factorial[Range[0, 4]]) /. soln

              (* Out[142]= -x - (a x^3)/2 + 1/2 (-b + c) x^4,
              x + (a x^3)/2 + 1/2 (b + c) x^4 *)





              share|improve this answer






















                up vote
                2
                down vote










                up vote
                2
                down vote









                Could use implicit differentiation, solve for all derivatives at x==0.



                ee = y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. y -> y[x];
                dpolys = Table[D[ee, x, j], j, 0, 5] /. x -> 0

                (* y[0]^2, 2*y[0]*Derivative[1][y][0], -2 - 2*a*y[0]^2 - 2*c*y[0]^3 +
                2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0],
                -6*b*y[0]^2 - 12*a*y[0]*Derivative[1][y][0] -
                18*c*y[0]^2*Derivative[1][y][0] +
                6*Derivative[1][y][0]*Derivative[2][y][0] +
                2*y[0]*Derivative[3][y][0],
                -48*b*y[0]*Derivative[1][y][0] + 6*Derivative[2][y][0]^2 -
                12*a*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) -
                12*c*(6*y[0]*Derivative[1][y][0]^2 +
                3*y[0]^2*Derivative[2][y][0]) +
                8*Derivative[1][y][0]*Derivative[3][y][0] +
                2*y[0]*Derivative[4][y][0],
                -60*b*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) +
                20*Derivative[2][y][0]*Derivative[3][y][0] -
                20*a*(6*Derivative[1][y][0]*Derivative[2][y][0] +
                2*y[0]*Derivative[3][y][0]) -
                20*c*(6*Derivative[1][y][0]^3 +
                18*y[0]*Derivative[1][y][0]*Derivative[2][y][0] +
                3*y[0]^2*Derivative[3][y][0]) +
                10*Derivative[1][y][0]*Derivative[4][y][0] +
                2*y[0]*Derivative[5][y][0] *)

                soln = Solve[dpolys == 0]

                (* Out[139]= y[0] -> 0, Derivative[1][y][0] -> -1,
                Derivative[2][y][0] -> 0,
                Derivative[3][y][0] -> -3*a, Derivative[4][y][0] -> 12*(-b + c),
                y[0] -> 0, Derivative[1][y][0] -> 1, Derivative[2][y][0] -> 0,
                Derivative[3][y][0] -> 3*a, Derivative[4][y][0] -> 12*(b + c) *)


                So two solutions, both getting up to the fourth order term. We create a table, then use the solutions to fill in values and recast as a Taylor polynomial for each solution branch.



                derivs = Table[D[y[x], x, j], j, 0, 4] /. x -> 0;
                derivs.(x^Range[0, 4]/Factorial[Range[0, 4]]) /. soln

                (* Out[142]= -x - (a x^3)/2 + 1/2 (-b + c) x^4,
                x + (a x^3)/2 + 1/2 (b + c) x^4 *)





                share|improve this answer












                Could use implicit differentiation, solve for all derivatives at x==0.



                ee = y^2 - (x^2 + a x^2 y^2 + b y^2 x^3 + c y^3 x^2) /. y -> y[x];
                dpolys = Table[D[ee, x, j], j, 0, 5] /. x -> 0

                (* y[0]^2, 2*y[0]*Derivative[1][y][0], -2 - 2*a*y[0]^2 - 2*c*y[0]^3 +
                2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0],
                -6*b*y[0]^2 - 12*a*y[0]*Derivative[1][y][0] -
                18*c*y[0]^2*Derivative[1][y][0] +
                6*Derivative[1][y][0]*Derivative[2][y][0] +
                2*y[0]*Derivative[3][y][0],
                -48*b*y[0]*Derivative[1][y][0] + 6*Derivative[2][y][0]^2 -
                12*a*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) -
                12*c*(6*y[0]*Derivative[1][y][0]^2 +
                3*y[0]^2*Derivative[2][y][0]) +
                8*Derivative[1][y][0]*Derivative[3][y][0] +
                2*y[0]*Derivative[4][y][0],
                -60*b*(2*Derivative[1][y][0]^2 + 2*y[0]*Derivative[2][y][0]) +
                20*Derivative[2][y][0]*Derivative[3][y][0] -
                20*a*(6*Derivative[1][y][0]*Derivative[2][y][0] +
                2*y[0]*Derivative[3][y][0]) -
                20*c*(6*Derivative[1][y][0]^3 +
                18*y[0]*Derivative[1][y][0]*Derivative[2][y][0] +
                3*y[0]^2*Derivative[3][y][0]) +
                10*Derivative[1][y][0]*Derivative[4][y][0] +
                2*y[0]*Derivative[5][y][0] *)

                soln = Solve[dpolys == 0]

                (* Out[139]= y[0] -> 0, Derivative[1][y][0] -> -1,
                Derivative[2][y][0] -> 0,
                Derivative[3][y][0] -> -3*a, Derivative[4][y][0] -> 12*(-b + c),
                y[0] -> 0, Derivative[1][y][0] -> 1, Derivative[2][y][0] -> 0,
                Derivative[3][y][0] -> 3*a, Derivative[4][y][0] -> 12*(b + c) *)


                So two solutions, both getting up to the fourth order term. We create a table, then use the solutions to fill in values and recast as a Taylor polynomial for each solution branch.



                derivs = Table[D[y[x], x, j], j, 0, 4] /. x -> 0;
                derivs.(x^Range[0, 4]/Factorial[Range[0, 4]]) /. soln

                (* Out[142]= -x - (a x^3)/2 + 1/2 (-b + c) x^4,
                x + (a x^3)/2 + 1/2 (b + c) x^4 *)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 34 mins ago









                Daniel Lichtblau

                45.8k275158




                45.8k275158



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185295%2fapproximate-the-solutions-as-a-series%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery