Computing symmetric form of certain polynomials I would like to know the best way to calculate the following.
Let $P(u,v,s,t)$ be a polynomial such that is invariant under permutation of $u\leftrightarrow s$ AND $v\leftrightarrow t$, that is $P(u,v,s,t)=P(s,t,u,v)$ 
This polynomial can be written as an algebraic combination of these elementary symmetric polynomials: $\{u+s,us,v+t,vt\}$.
An easy example is: $u^2 + s^2 = (u+s)^2 - 2us$. 
But if I have $s^n t+u^n v$ things get more complicated (even for $n=1$).
I need to compute this "symmetric form" of a bunch of polynomials, so I would like to know how can I do it with software. 
I tried with Maple but it cannot handle  $u\leftrightarrow s$ AND $v\leftrightarrow t$ (at the same time). 
In case it is relevant to the context, these polynomials are functions on the Jacobian $J$ of a hyperelliptic curve of genus $2$. So these are functions in the function field $k(J)$ where the generic point of $J$ is $\{(u,v),(s,t)\}$.
Thanks
 A: Not every polynomial $P$ satisfying $P\left(  u,v,s,t\right)  =P\left(
s,t,u,v\right)  $ can be written as a polynomial in the $u+s,us,v+t,vt$. And I
am not sure if every such polynomial can be written as a rational function in
the $u+s,us,\dfrac{t-v}{s-u},\dfrac{sv-ut}{s-u}$ either. But your polynomials
$s^{n}t+u^{n}v$ can be written in the latter form. Here is how:
Set $a=u+s$, $b=us$, $c=\dfrac{t-v}{s-u}$ and $d=\dfrac{sv-ut}{s-u}$ in the field $\mathbb{Q}\left(s,t,u,v\right)$. Set
$p_{n}=s^{n}t+u^{n}v$ for each $n\in\mathbb{N}$. Then, it is easy to check (by
straightforward computation) that
\begin{align*}
p_{0}  & =2d+ac;\\
p_{1}  & =a^{2}c+ad-2bc.
\end{align*}
Next, I claim that
\begin{equation}
p_{n}=ap_{n-1}-bp_{n-2}
\label{1}
\tag{1}
\end{equation}
for each $n\geq2$.
[Proof of \eqref{1}: Let $n\geq2$. Then, $p_{n}=s^{n}t+u^{n}v$ and similarly
$p_{n-1}=s^{n-1}t+u^{n-1}v$ and $p_{n-2}=s^{n-2}t+u^{n-2}v$. But
straightforward computation shows that $as-b=s^{2}$ and $au-b=u^{2}$. Now,
\begin{align*}
& a\underbrace{p_{n-1}}_{=s^{n-1}t+u^{n-1}v}-b\underbrace{p_{n-2}}
_{=s^{n-2}t+u^{n-2}v}\\
& =a\left(  \underbrace{s^{n-1}}_{=ss^{n-2}}t+\underbrace{u^{n-1}}_{=uu^{n-2}
}v\right)  -b\left(  s^{n-2}t+u^{n-2}v\right)  \\
& =a\left(  ss^{n-2}t+uu^{n-2}v\right)  -b\left(  s^{n-2}t+u^{n-2}v\right)
\\
& =ass^{n-2}t+auu^{n-2}v-bs^{n-2}t-bu^{n-2}v\\
& =\underbrace{\left(  ass^{n-2}t-bs^{n-2}t\right)  }_{=s^{n-2}\left(
as-b\right)  t}+\underbrace{\left(  auu^{n-2}v-bu^{n-2}v\right)  }
_{=u^{n-2}\left(  au-b\right)  v}\\
& =s^{n-2}\underbrace{\left(  as-b\right)  }_{=s^{2}}t+u^{n-2}
\underbrace{\left(  au-b\right)  }_{=u^{2}}v=\underbrace{s^{n-2}s^{2}}
_{=s^{n}}t+\underbrace{u^{n-2}u^{2}}_{=u^{n}}v\\
& =s^{n}t+u^{n}v=p_{n}.
\end{align*}
This proves \eqref{1}.]
From $p_{0}=2d+ac$ and $p_{1}=a^{2}c+ad-2bc$, we conclude that $p_{0}$ and
$p_{1}$ are polynomials in $a,b,c,d$. Therefore, by strong induction, we can
conclude that each $p_{n}$ (for $n\in\mathbb{N}$) is a polynomial in
$a,b,c,d$. (Indeed, \eqref{1} shows that if $p_{n-1}$ and $p_{n-2}$ are
polynomials in $a,b,c,d$, then so is $p_{n}$.)
A: This answer rests on a misreading of the question; see comments to see why. I'm leaving it because I think it may nonetheless prove useful to someone at some point.
First step: symmetrize., 
You've got $P(u, v, s, t) = P(s, v, u, t)$, so apply that and rewrite
$P$ as the average of those two. Applying this to the case you asked about, this turns
$$
st + uv
$$
into
$$
\frac{1}{2} \left([st + uv] + [ut + sv]  \right).
$$
Then do that again with the $v$-to-$t$ symmetry:
$$
\frac{1}{4} \left([st + uv] + [ut + sv] + [sv + ut] + [uv + st]  \right).
$$
At this point, everywhere you have a term $u^k s^\ell t$, you've also got $u^k s^\ell v$. So gather up each $u^k s^\ell$ term, and its coefficient will be some expression that's symmetric in $v$ and $t$. 
Then (using the method outlined below), rewrite each $u^k s^\ell$ term (leaving its coefficient in $v$ and $t$ untouched); then, using the same method, rewrite each $v^k t^\ell$ term similarly, leaving the $s$-and-$u$ part untouched. Then you're done!
You can write out the relevant items like $1, us + us, u^2 + s^2, u^2s + s^2 u, u^3s + s^3 u, u^2 s^2 + s^2 u^2, \ldots$ in terms of the given functions, and do this once and for all. 
$$
1 = (u+s)^0 \\
us + su  = 2 * us \\
u^2 + s^2 = (u+s)^2 - us
u^2s + s^2 u = us(s + u) \\
u^3 s + s^3 u =usu ( u^2 + s^2) = su( (u+s)^2 - us )
$$
and pretty soon you start to notice some patterns. If we denote by $P(n, k)$ the polynomial $u^n s^k + s^n u^k$, then there's a recurrence:
$$
P(n, k) = \begin{cases}
(us)^r \cdot P(n-r, k-r) & \text{for $r = min(n, k) > 0$}\\
P(n, k) = (u+s)^n - Q(n) & \text{when $k= 0$}\\
P(n, k) = (u+s)^n - Q(k) & \text{when $n= 0$}\\
\end{cases}
$$
where $Q(n)$ is a polynomial of degree $n-1$ defined as
$$
Q(n, k) = \sum_{i = 1}^{n-1} {n \choose i} u^i k^{n-i}.
$$
i.e., it's just the binomial expansion of $(u+s)^n$ without the $u^n$ and $s^n$ terms. 
Applying this recurrence to each symmetric pair of terms in your polynomial will rewrite the $P(n, k)$ as an algebraic combination of powers of $u+s$ and $us$  (or similarly for $v+t$ and $vt$). 
Post-comment addition
I've already showed that $st + uv$ is the same as 
$$
\frac{1}{4} \left([st + uv] + [ut + sv] + [sv + ut] + [uv + st]  \right).
$$
Gathering powers of $u$ and $s$ we have
$$
4(st + uv) = s(2t + 2v) + u(2t + 2v) = 2(s+u)(t+v).
$$
so that 
$$
st + uv = \frac{1}{2} \left ( (s+u)(t+v) \right).
$$
