Ask Your Question

relatively_random's profile - activity

2023-05-15 10:12:11 +0200 received badge  Notable Question (source)
2021-11-25 13:04:57 +0200 received badge  Popular Question (source)
2019-05-15 09:53:22 +0200 received badge  Scholar (source)
2019-05-15 09:48:01 +0200 received badge  Supporter (source)
2019-05-14 23:25:02 +0200 received badge  Nice Question (source)
2019-05-13 23:10:26 +0200 received badge  Student (source)
2019-05-13 17:33:41 +0200 asked a question Rearranging expressions to minimize negative signs

SageMath newbie still learning the basics here. My goal is to mostly use Sage for basic arithmetic and calculus. I'm playing with some basic equations here, but I can't seem to figure out how to rearrange the output the way I'd like.

For instance:

f, s, s_i = var("f, s, s_i")
thin_lens_formula = 1/f == 1/s + 1/s_i
solve(thin_lens_formula, s)[0]

Output:

s == -f*s_i/(f - s_i)

I'd prefer this to be expressed as s == f*s_i / (s_i - f), multiplying both numerator and denominator by -1 so there is one less negative sign in total. Is there a way to do this or is Sage not really meant to be micro-managed like this?