### How to express boolean polynomials by special form

If I have boolean polynomials ~~like $$x_1 ~~like

`x_1 * x_2 + `~~x_1~~*x_3* x_1*x_3* x_5 + x_3 + ~~x_7~~*x_2$$,
**x_7*x_2
*

* *then given a variable ~~$x_1$, ~~`x_1`

, how can I represent it ~~as $$x_1 *(x_2 ~~as

`x_1 * (x_2 + `~~x_3~~

`x_5) x_3*x_5) + `~~x_3 ~~(x_3 + ~~x_7~~*x_2$$ by sage?
**x_7*x_2)
*

* *using Sage?

*In general, I want to find a way to represent a form of *~~$$a~~ `a * `

`x_1 + `~~c$$, ~~c

,
where ~~$a$ ~~`a`

is the linear combination of multiples of ~~$x_1$ ~~`x_1`

and ~~$c$ ~~`c`

is the rest polynomial.