Group Abstract Group Abstract

Message Boards Message Boards

0
|
240 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Partial replacement in polynomials

Posted 1 month ago
pol = -1 + (x - x0)^2/a^2 + (2 (x - x0) x0)/a^2 + x0^2/
      a^2 + (y - y0)^2/b^2 + (2 (y - y0) y0)/b^2 + y0^2/b^2

For the polynomial above, there is a relation:

rel = x0^2/a^2 + y0^2/b^2 == 1

How can I use this relation rel to replace the three terms x0^2/a^2 + y0^2/b^2 - 1 in the polynomial pol with 0, while keeping the other terms unchanged, to obtain the following final result:

(x - x0)^2/a^2 + (2 (x - x0) x0)/a^2 + (y - y0)^2/b^2 + (
 2 (y - y0) y0)/b^2

enter image description here

POSTED BY: Wen Dao
2 Replies

Here is a way:

pol /. (rel /. Equal -> Rule)
POSTED BY: Gianluca Gorni
Posted 24 days ago

This achieves the desired result. Thank you!

POSTED BY: Wen Dao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard