Ask Your Question
0

solve with 2 unknows types

asked 2021-05-04 12:25:01 +0100

ortollj gravatar image

updated 2021-05-04 13:18:54 +0100

HI I would like SageMath will give me the solution [x_00=0,x_10=-2,x_20=0] is there a way to do that with 9.2 or should I wait for 9.3 ?

uV=var('x_00, x_10, x_20',domain='integer')
#xyzV=var('x,y, z', domain='real')
xyzV=var('x,y, z', domain='complex')
solve(x^2*x_00 + x*x_10*y + x_20*y^2 == -2*x*y,[x_00 , x_10 , x_20])


solve(x^2*x_00 + x*x_10*y + x_20*y^2 == -2*x*y,[x_00 , x_10 , x_20])

link text

edit retag flag offensive close merge delete

Comments

I put the code delimiter on the first code ,it is displayed ok but when I click on save the code is displayed as text !

ortollj gravatar imageortollj ( 2021-05-04 12:28:49 +0100 )edit

You can not start with a displayed block, you have to add an introduction sentence.

tmonteil gravatar imagetmonteil ( 2021-05-04 12:31:17 +0100 )edit

ok , I just corrected it

ortollj gravatar imageortollj ( 2021-05-04 13:19:51 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-05-04 12:38:11 +0100

tmonteil gravatar image

A polynomial vanishes ift each of its coefficients vanish, so you can work with polynomials as follows:

sage: var('x_00, x_10, x_20')
(x_00, x_10, x_20)
sage: R.<x,y,z> = SR[]
sage: R
Multivariate Polynomial Ring in x, y, z over Symbolic Ring
sage: P = x^2*x_00 + x*x_10*y + x_20*y^2 - -2*x*y
sage: P
x_00*x^2 + (x_10 + 2)*x*y + x_20*y^2
sage: solve([p == 0 for p in P.coefficients()], [x_00 , x_10 , x_20])
[[x_00 == 0, x_10 == -2, x_20 == 0]]

For more algebraic tasks, instead of SR[x,y,z]It is also possible to work in the ring ZZ[x_00, x_10, x_20][x,y,z], but you get the idea.

edit flag offensive delete link more

Comments

Thank you @tmonteil

ortollj gravatar imageortollj ( 2021-05-04 13:15:59 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-05-04 12:25:01 +0100

Seen: 256 times

Last updated: May 04 '21