2
$\begingroup$

Suppose $y=f(x;p_1,p_2,...)$ and $t=g(x;p_1,p_2,...)$ are given where $p_1,p_2,...$ are some parameters. We want to find a series expansion of $y$ in terms of $t$. Is there a direct command or publicly available program for doing this?

For example:

y == Subscript[p, 1] x + Subscript[p, 2] x^2
t == Sin[x] + Subscript[p, 3] x^3
$\endgroup$
  • $\begingroup$ Could you please think of a small concrete example to use as a guide ? $\endgroup$ – b.gates.you.know.what Feb 26 '14 at 15:41
  • $\begingroup$ @b.gatessucks for example $y=p_1 x+ p_2 x^2$ and $t=\sin(x)+p_3x^3$ $\endgroup$ – Maesumi Feb 26 '14 at 16:38
  • $\begingroup$ I don't know under which conditions it can be done in general. In your specific example it might be possible to get t=t(y) as you can invert the first equation exactly. $\endgroup$ – b.gates.you.know.what Feb 26 '14 at 16:52
2
$\begingroup$

I'm not sure how sound this solution is, but you can substitute x in f[x] with the inverse series of g[x] and then take the serie

fS[y_, t_, x_, xo_, n_] := With[{s = InverseSeries[Series[t, {x, xo, n}]]}, Series[ y /. x ->  s, {x, xo, n}]]

fS[p1 x + p2 x^2, Sin[x] + p3 x^3, x, 0, 4]

Mathematica graphics

$\endgroup$
3
$\begingroup$

You can use the new in M12 function AsymptoticSolve:

y /. First @ AsymptoticSolve[
    {
    y == Subscript[p, 1]x + Subscript[p, 2] x^2,
    t == Sin[x] + Subscript[p, 3] x^3
    },
    {{x,y}, {0,0}},
    {t, 0, 5}
] //TeXForm

$\frac{1}{40} \left(120 p_1 p_3^2-40 p_1 p_3+3 p_1\right) t^5+\frac{1}{3} \left(p_2-6 p_2 p_3\right) t^4+\frac{1}{6} \left(p_1-6 p_1 p_3\right) t^3+p_2 t^2+p_1 t$

Update

While you don't have access to M12, you can use CloudEvaluate:

$Version
CloudEvaluate[
    y /. First @ AsymptoticSolve[
        {
        y == Subscript[p, 1]x + Subscript[p, 2] x^2,
        t == Sin[x] + Subscript[p, 3] x^3
        },
        {{x,y}, {0,0}},
        {t, 0, 5}
    ]
] //TeXForm

"11.3.0 for Mac OS X x86 (64-bit) (March 6, 2018)"

$\frac{1}{40} \left(120 p_1 p_3^2-40 p_1 p_3+3 p_1\right) t^5+\frac{1}{3} \left(p_2-6 p_2 p_3\right) t^4+\frac{1}{6} \left(p_1-6 p_1 p_3\right) t^3+p_2 t^2+p_1 t$

$\endgroup$
2
$\begingroup$

Not sure if this is what you are after, but could implicitly write all vars as functions of t, then take derivatives and solve for first few in y to form a Taylor series. For the given example it is as below.

exprs = {p1*x[t] + p2*x[t]^2 - y[t]
     Sin[x[t]] + p3*x[t]^3 - t};
dexprs = D[exprs, t];
d2exprs = D[dexprs, t];

augexprs = Join[exprs, dexprs, d2exprs] /. t -> 0;

(* Out[766]= {p1 x[0] + p2 x[0]^2 + p3 x[0]^3 - Sin[x[0]] y[0], -1 + 
  p1 Derivative[1][x][0] + 2 p2 x[0] Derivative[1][x][0] + 
  3 p3 x[0]^2 Derivative[1][x][0] - 
  Cos[x[0]] y[0] Derivative[1][x][0] - Sin[x[0]] Derivative[1][y][0], 
 2 p2 Derivative[1][x][0]^2 + 6 p3 x[0] Derivative[1][x][0]^2 + 
  Sin[x[0]] y[0] Derivative[1][x][0]^2 - 
  2 Cos[x[0]] Derivative[1][x][0] Derivative[1][y][0] + 
  p1 (x^\[Prime]\[Prime])[0] + 2 p2 x[0] (x^\[Prime]\[Prime])[0] + 
  3 p3 x[0]^2 (x^\[Prime]\[Prime])[0] - 
  Cos[x[0]] y[0] (x^\[Prime]\[Prime])[0] - 
  Sin[x[0]] (y^\[Prime]\[Prime])[0]} *)

In[768]:= 
y[0] + y'[0]*t + (y^\[Prime]\[Prime])[0]*t^2/2 /. 
 First[Solve[
   augexprs == 0, {y[0], 
    Derivative[1][y][0], (y^\[Prime]\[Prime])[0]}]]

(* Out[768]= 
p1 Csc[x[0]] x[0] + p2 Csc[x[0]] x[0]^2 + p3 Csc[x[0]] x[0]^3 + 
 t (-Csc[x[0]] + p1 Csc[x[0]] Derivative[1][x][0] + 
    2 p2 Csc[x[0]] x[0] Derivative[1][x][0] - 
    p1 Cot[x[0]] Csc[x[0]] x[0] Derivative[1][x][0] + 
    3 p3 Csc[x[0]] x[0]^2 Derivative[1][x][0] - 
    p2 Cot[x[0]] Csc[x[0]] x[0]^2 Derivative[1][x][0] - 
    p3 Cot[x[0]] Csc[x[0]] x[0]^3 Derivative[1][x][0]) + 
 1/2 t^2 (2 Cot[x[0]] Csc[x[0]] Derivative[1][x][0] + 
    2 p2 Csc[x[0]] Derivative[1][x][0]^2 - 
    2 p1 Cot[x[0]] Csc[x[0]] Derivative[1][x][0]^2 + 
    p1 Csc[x[0]] x[0] Derivative[1][x][0]^2 + 
    6 p3 Csc[x[0]] x[0] Derivative[1][x][0]^2 - 
    4 p2 Cot[x[0]] Csc[x[0]] x[0] Derivative[1][x][0]^2 + 
    2 p1 Cot[x[0]]^2 Csc[x[0]] x[0] Derivative[1][x][0]^2 + 
    p2 Csc[x[0]] x[0]^2 Derivative[1][x][0]^2 - 
    6 p3 Cot[x[0]] Csc[x[0]] x[0]^2 Derivative[1][x][0]^2 + 
    2 p2 Cot[x[0]]^2 Csc[x[0]] x[0]^2 Derivative[1][x][0]^2 + 
    p3 Csc[x[0]] x[0]^3 Derivative[1][x][0]^2 + 
    2 p3 Cot[x[0]]^2 Csc[x[0]] x[0]^3 Derivative[1][x][0]^2 + 
    p1 Csc[x[0]] (x^\[Prime]\[Prime])[0] + 
    2 p2 Csc[x[0]] x[0] (x^\[Prime]\[Prime])[0] - 
    p1 Cot[x[0]] Csc[x[0]] x[0] (x^\[Prime]\[Prime])[0] + 
    3 p3 Csc[x[0]] x[0]^2 (x^\[Prime]\[Prime])[0] - 
    p2 Cot[x[0]] Csc[x[0]] x[0]^2 (x^\[Prime]\[Prime])[0] - 
    p3 Cot[x[0]] Csc[x[0]] x[0]^3 (x^\[Prime]\[Prime])[0]) *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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