Behaviour of Symbolics.solve_for

I’ve just started using Symbolics, and I really like it. However, I’m not sure about the output from solve_for

using Symbolics
@variables p x y
eq = x *p + y * (1 - p) ~0
Symbolics.solve_for(eq,p)

returns

(p*y + y*(1 - p))*((y - x)^-1)

I have to expand() in order to get back an answer without p in it. Is this the expected behaviour?

1 Like

That’s funny, it trolled you. Ehh, gotta watch out for those evolving AI systems, they have a mind of their own.

1 Like

So just to confirm, it’s not a bug? If I want to see one variable in terms of the other variables solve_for isn’t the way to go?

Yeah, open an issue. That’s definitely odd behavior.

1 Like

Yeah, sorry to be dim! Math isn’t my first language, so I was still open to the possibility that my expectations were wrong.