# Partial replacement in polynomials

**URL:** <https://community.wolfram.com/t/partial-replacement-in-polynomials/26132>\
**Category:** Questions\
**Created:** [November 8, 2025, 11:38pm UTC](https://community.wolfram.com/t/partial-replacement-in-polynomials/26132 "2025-11-08T23:38:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![studymma168](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@studymma168](https://community.wolfram.com/u/studymma168)\
**Post date:** [November 8, 2025, 11:38pm UTC](https://community.wolfram.com/t/partial-replacement-in-polynomials/26132/1 "2025-11-08T23:38:04Z")

</div>

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

```

 ![2025-11-09_073709.png](https://global.discourse-cdn.com/wolfram/original/3X/9/5/954a3ca65915d158097d4f7953d6ae0362bd79d2.png)

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [November 9, 2025, 10:56am UTC](https://community.wolfram.com/t/partial-replacement-in-polynomials/26132/2 "2025-11-09T10:56:15Z")

</div>

Here is a way:

```
pol /. (rel /. Equal -> Rule)

```

---

<div class="post-metadata">

**Author:** ![studymma168](https://avatars.discourse-cdn.com/v4/letter/s/9fc29f/32.png) [@studymma168](https://community.wolfram.com/u/studymma168)\
**Post date:** [November 13, 2025, 2:42am UTC](https://community.wolfram.com/t/partial-replacement-in-polynomials/26132/3 "2025-11-13T02:42:53Z")

</div>

This achieves the desired result. Thank you!
