Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7923 > unrolled thread
| Started by | klw1026 <klw1026@gmail.com> |
|---|---|
| First post | 2012-01-17 08:44 +0000 |
| Last post | 2012-01-18 10:56 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
determining coefficients of a polynomial klw1026 <klw1026@gmail.com> - 2012-01-17 08:44 +0000
Re: determining coefficients of a polynomial janos <janostothmeister@gmail.com> - 2012-01-18 10:56 +0000
| From | klw1026 <klw1026@gmail.com> |
|---|---|
| Date | 2012-01-17 08:44 +0000 |
| Subject | determining coefficients of a polynomial |
| Message-ID | <jf3cda$nj3$1@smc.vnet.net> |
Hi,
Here's my problem: I have two rational polynomials in two variables, say x and y, with one having arbitrary coefficients. I would like to compare these two polys and solve for the arbitrary coefficients. For example, suppose the polys are $f(x,y) = \frac{2}{xy} - xy + \frac{x}{y} + \frac{y}{x}$ and $g(x,y) = \cdot\cdot\cdot + n_1\frac{1}{xy} + n_2 xy + n_3\frac{x}{y} + n_4\frac{y}{x} +\cdot\cdot\cdot$. Then you can see that $n_1 = 2$, $n_2=-1$, $n_3 = n_4 =1$ and all other $n_i = 0$. Does anyone know how to do this with Mathematica?
Thanks
[toc] | [next] | [standalone]
| From | janos <janostothmeister@gmail.com> |
|---|---|
| Date | 2012-01-18 10:56 +0000 |
| Message-ID | <jf68hp$g2h$1@smc.vnet.net> |
| In reply to | #7923 |
On Jan 17, 9:44 am, klw1026 <klw1...@gmail.com> wrote:
> Hi,
>
> Here's my problem: I have two rational polynomials in two variables, say x and y, with one having arbitrary coefficients. I would like to compare these two polys and solve for the arbitrary coefficients. For example, suppose the polys are $f(x,y) = \frac{2}{xy} - xy + \frac{x}{y} + \frac{y}{x}$ and $g(x,y) = \cdot\cdot\cdot + n_1\frac{1}{xy} + n_2 xy + n_3\frac{x}{y}+ n_4\frac{y}{x} +\cdot\cdot\cdot$. Then you can see that $n_1 = 2$, $n_2=-1$, $n_3 = n_4 =1$ and all other $n_i = 0$. Does anyone know how to do this with Mathematica?
>
> Thanks
One solution might be:
SolveAlways[f[x, y] - g[x, y] == 0, {x, y}]
giving
{{n1 -> 2, n2 -> -1, n3 -> 1, n4 -> 1}}
I hope this helps.
J=E1nos
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web