Read-only forum archive

SOS : Substitution 1/x to a poly!!!

SOS : Substitution 1/x to a poly!!!

Guest · Sat Sep 18, 2010 4:29 pm

Hello everybody!
How can we substitute the variable x of a polynomial with 1/x or 1/(x+1)?? We ask you because when we divide 1/x system returns Zero!

For example: If we have a poly p(x)=x and substitute with the command f(x)=subst(p(x),x,1/x) system returns f(x)=0. But we expect to get f(x)=1/x. :shock: :shock: :shock:

Its an emergency!!! :!: :!: :!:

Re: SOS : Substitution 1/x to a poly!!!

hannes · Mon Sep 20, 2010 9:52 am

The area, you are working in is the set of polynomial: the
division in that ring ignores remainder: 1/x is 0 with remainder 1
which is ignored.

You seem to want to work in the field of rational functions:
in order to do so, define a ring with rational functions a coefficients:
Code:
ring r=(0,a),x,dp;
poly p=x;
subs(p,x,1/a); -> 1/(a)