Approximate the solutions as a series
Clash 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?
equation-solving series-expansion approximation
add a comment |Â
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?
equation-solving series-expansion approximation
add a comment |Â
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?
equation-solving series-expansion approximation
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
equation-solving series-expansion approximation
asked 3 hours ago
Shadumu
1085
1085
add a comment |Â
add a comment |Â
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
]
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
add a comment |Â
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 *)
add a comment |Â
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
]
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
add a comment |Â
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
]
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
add a comment |Â
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
]
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
]
edited 1 hour 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
add a comment |Â
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
add a comment |Â
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 *)
add a comment |Â
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 *)
add a comment |Â
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 *)
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 *)
answered 32 mins ago
Daniel Lichtblau
45.8k275158
45.8k275158
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password