5
$\begingroup$

Please,

I need to solve iteratively by Mathematica this equation in order to get the solution $x^2$ at order $K^6$ :

$$x^2=\frac{a_1}{3}+\frac{a_2 K^2}{5x^2}+\frac{a_3 K^4}{7 x^4}+\frac{a_4 K^6}{9 x^6}$$ $(a_1, a_2, a_3, a_4)$ : arbitrary coefficients

 x^2=(Subscript[a, 4] K^6)/(9 x^6)+(Subscript[a, 3] K^4)/(7x^4)+(Subscript[a, 2] K^2)/(5 x^2)+Subscript[a, 1]/3

Is there a way to do it ?

$\endgroup$
5
  • 1
    $\begingroup$ Normally, iterative solutions are evaluated using numerical values of the parameters. Although it is possible in principle (e.g. formally using Newton's method and NestList), still it doesn't make much sense to calculate successive iterations symbolically. What are you actually trying to do? $\endgroup$
    – MarcoB
    Commented Feb 6, 2017 at 19:47
  • $\begingroup$ Yes, but the solution may be written as a function of the arbitrary parameters a1, a2, a3 and a4 too. I want to keep these parameters. $\endgroup$
    – Betatron
    Commented Feb 6, 2017 at 19:56
  • $\begingroup$ The equation is fourth order in x^2. Just use Solve $\endgroup$
    – george2079
    Commented Feb 6, 2017 at 20:00
  • $\begingroup$ Sure, but then you will want to solve the equation symbolically, not iteratively. Try Solve[x^2 == (a[4] k^6)/(9 x^6) + (a[3] k^4)/(7 x^4) + (a[2] k^2)/(5 x^2) + a[1]/3, x] and gaze at the horror that are the symbolic solutions... Also, stay away from Subscript at the beginning; use indexed variables, i.e. a[1] instead of Subscript[a, 1]. Also stay away from uppercase variables; for instance, your K has a conflict with a built in symbol. $\endgroup$
    – MarcoB
    Commented Feb 6, 2017 at 20:01
  • $\begingroup$ Sorry, this is not what I want. I would like to obtain x^2 in the form: x^2=A+B K^2+C K^4+D K^6 $\endgroup$
    – Betatron
    Commented Feb 6, 2017 at 20:10

3 Answers 3

3
$\begingroup$

You can also use the new in M12 function AsymptoticSolve. First, it will be simpler to use a new variable x2 = x^2:

eqn = x2 == (Subscript[a, 4] K^6)/(9 x2^3) + (Subscript[a, 3] K^4)/(7x2^2) +
    (Subscript[a, 2] K^2)/(5 x2) + Subscript[a, 1]/3;
eqn //TeXForm

$\text{x2}=\frac{a_4 K^6}{9 \text{x2}^3}+\frac{a_3 K^4}{7 \text{x2}^2}+\frac{a_2 K^2}{5 \text{x2}}+\frac{a_1}{3}$

At K=0, x^2 is given by $a_1/3$, so the call to AsymptoticSolve is:

x2 /. First @ AsymptoticSolve[eqn, {x2, Subscript[a,1]/3}, {K, 0, 6}] //TeXForm

$\frac{3 \left(1134 a_2^3-2025 a_1 a_3 a_2+875 a_1^2 a_4\right) K^6}{875 a_1^5}+\frac{9 \left(25 a_1 a_3-21 a_2^2\right) K^4}{175 a_1^3}+\frac{3 a_2 K^2}{5 a_1}+\frac{a_1}{3}$

in agreement with my other answer.

Before you have access to M12, you can use CloudEvaluate:

$VersionNumber
x2 /. CloudEvaluate @ First @ System`AsymptoticSolve[
    eqn,
    {x2, Subscript[a,1]/3},
    {K, 0, 6}
] //TeXForm

11.3

$\frac{3 \left(1134 a_2^3-2025 a_1 a_3 a_2+875 a_1^2 a_4\right) K^6}{875 a_1^5}+\frac{9 \left(25 a_1 a_3-21 a_2^2\right) K^4}{175 a_1^3}+\frac{3 a_2 K^2}{5 a_1}+\frac{a_1}{3}$

$\endgroup$
5
$\begingroup$

Something like the following? Here is your equation:

eqn =  x^2 == (Subscript[a, 4] K^6)/(9 x^6)+(Subscript[a, 3] K^4)/(7x^4) +
    (Subscript[a, 2] K^2)/(5 x^2)+Subscript[a, 1]/3;
eqn //TeXForm

$x^2=\frac{a_4 K^6}{9 x^6}+\frac{a_3 K^4}{7 x^4}+\frac{a_2 K^2}{5 x^2}+\frac{a_1}{3}$

Construct a rule converting x to a series in K (still including x):

rule = x -> Sqrt[Series[eqn[[2]], {K, 0, 8}]];
rule //TeXForm

$x\to \frac{\sqrt{a_1}}{\sqrt{3}}+\frac{\sqrt{3} a_2 K^2}{10 x^2 \sqrt{a_1}}+\frac{\sqrt{a_1} \left(\frac{6 a_3}{7 x^4 a_1}-\frac{9 a_2^2}{50 x^4 a_1^2}\right) K^4}{4 \sqrt{3}}+\frac{\sqrt{a_1} \left(\frac{a_4}{x^6 a_1}-\frac{9 a_2 \left(\frac{6 a_3}{7 x^4 a_1}-\frac{9 a_2^2}{50 x^4 a_1^2}\right)}{20 x^2 a_1}\right) K^6}{6 \sqrt{3}}+\frac{\sqrt{a_1} \left(-\frac{3 a_3 \left(\frac{6 a_3}{7 x^4 a_1}-\frac{9 a_2^2}{50 x^4 a_1^2}\right)}{14 x^4 a_1}+\frac{a_2 a_4}{10 x^8 a_1^2}-\frac{a_2 \left(\frac{a_4}{x^6 a_1}-\frac{9 a_2 \left(\frac{6 a_3}{7 x^4 a_1}-\frac{9 a_2^2}{50 x^4 a_1^2}\right)}{20 x^2 a_1}\right)}{2 x^2 a_1}\right) K^8}{8 \sqrt{3}}+O\left(K^9\right)$

Use this rule repeatedly until you get the result at the desired order (and free of x):

x^2 //. rule //TeXForm

$\frac{a_1}{3}+\frac{3 a_2 K^2}{5 a_1}+\frac{9 \left(25 a_1 a_3-21 a_2^2\right) K^4}{175 a_1^3}+\frac{3 \left(1134 a_2^3-2025 a_1 a_3 a_2+875 a_1^2 a_4\right) K^6}{875 a_1^5}-\frac{27 \left(3969 a_2^4-9450 a_1 a_3 a_2^2+4900 a_1^2 a_4 a_2+2250 a_1^2 a_3^2\right) K^8}{6125 a_1^7}+O\left(K^9\right)$

$\endgroup$
3
  • $\begingroup$ thank you. But if I want x^2 and not x? $\endgroup$
    – Betatron
    Commented Feb 6, 2017 at 20:27
  • $\begingroup$ I modified my answer to return x^2 instead. $\endgroup$
    – Carl Woll
    Commented Feb 6, 2017 at 20:31
  • $\begingroup$ It's what I am looking for. Thank you very well. $\endgroup$
    – Betatron
    Commented Feb 6, 2017 at 20:48
3
$\begingroup$

Here is a little different approach that yields the same result:

eqn = x^2 == (Subscript[a, 4] K^6)/(9 x^6) + (Subscript[a, 
        3] K^4)/(7 x^4) + (Subscript[a, 2] K^2)/(5 x^2) + 
    Subscript[a, 1]/3 /. x -> Sqrt[x2]

First sub a series expression for x2 (=x^2) on both sides of the equation, then take Series to the whole thing , finally require all the K coefficients to be zero..

vars = Table[b[i], {i, 0, 8}]
sol = Solve[
  CoefficientList[
    Normal@Series[ 
      eqn[[1]] - eqn[[2]] /. x2 -> Sum[b[i] K^i , {i, 0, 8}] , {K, 0, 
       8}], K] == 0, vars]

 Sum[b[i] K^i , {i, 0, 8}] /. sol

same result

$\endgroup$
1
  • $\begingroup$ george2079, Thank you very well. $\endgroup$
    – Betatron
    Commented Feb 7, 2017 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.