0
$\begingroup$

I want to be able to build an operator $S$, on a polynomial in multiple variables which does something like this

$f[x,y] =$ some polynomial

$S[f][x,y] = y*f[y,x]$

And then for a specific choice of $n$, I would like to see the results of $S^k[f]$ for all $1 \leq k \leq n$.

I am very new to Mathematica, practically a baby, so I would appreciate as syntactically simple an explanation as possible.

$\endgroup$
2
  • 2
    $\begingroup$ You can type almost literally what you have written in the question: Try S[f_][x_,y_]:=y*f[y,x] (see Blank/_ and SetDelayed/:=), and take a look at Nest and NestList $\endgroup$
    – Lukas Lang
    Oct 17, 2022 at 21:35
  • $\begingroup$ Alternatively, S[expr_]:=y*(expr/.{x->y,y->x}); Rest[NestList[S,x^5+y^7,6]]. $\endgroup$
    – user293787
    Oct 17, 2022 at 23:18

0

Your Answer

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

Browse other questions tagged or ask your own question.