# Revision history [back]

### Solving an equation in multiple variables

I have this equation : sqrt((b-a)^2 + (B-A)^2) == A+B and i would like to have it solved to b-a=+- 2 * sqrt(AB) in sage. Right now I have the following code but it doesn't really output what I want. I just get
A^2 - 2AB + B^2 + a^2 - 2ab + b^2 == A^2 + 2AB + B^2 and I don't know how to make sage solve it further.

my code:

var('a,b,c,A,B,C') eq1 = (sqrt((b-a)^2 + (B-A)^2) == A+B) (eq1^2).expand()

### Solving an equation in multiple variables

I have this equation : sqrt((b-a)^2 + (B-A)^2) == A+B and i would like to have it solved to b-a=+- 2 * sqrt(AB) in sage. Right now I have the following code but it doesn't really output what I want. I just get
A^2 - 2AB + B^2 + a^2 - 2ab + b^2 == A^2 + 2AB + B^2 B^2
and I don't know how to make sage solve it further.further.

my code:code:

var('a,b,c,A,B,C') eq1 = (sqrt((b-a)^2 + (B-A)^2) == A+B) (eq1^2).expand()

### Solving an equation in multiple variables

I have this equation : sqrt((b-a)^2 + (B-A)^2) == A+B and i would like to have it solved to b-a=+- 2 * sqrt(AB) in sage. Right now I have the following code but it doesn't really output what I want. I just get
A^2 - 2AB + B^2 + a^2 - 2ab + b^2 == A^2 + 2AB + B^2
and I don't know how to make sage solve it further.

my code:

var('a,b,c,A,B,C') var('a,b,c,A,B,C')
eq1 = (sqrt((b-a)^2 + (B-A)^2) == A+B) (eq1^2).expand()A+B)
(eq1^2).expand()