Question: How to simplify this radical expression

The below problem has already occured several times to me. In all such instances Maple did not realise that extracting a factor from a square root is the key for further simplification. Doing this by hand is obvious and often easy when extracted factors are positive.  

Did I overlook something? Are there other ways avoid disassembling an expression with the op command?
Should simplify or other commands be improved to adress such problems?

restart

How to transform the left-hand side by commands that it matches the right-hand side

sqrt(x__0+1)*sqrt(-2*beta^2*x__0-2*beta^2+4)*sqrt(-(x__0+1)*(beta^2-1))/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/(sqrt(-beta^2+1)*sqrt(-2*beta^2*x__0-2*beta^2+4))

(x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(1)

assumptions := 0 < x__0 and x__0 < 1, 0 < beta and beta < 1

0 < x__0 and x__0 < 1, 0 < beta and beta < 1

(2)

`assuming`([simplify(lhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))))], [assumptions])

-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2))

(3)

I have tried the usual simplify and combine commands to remove the square root from the numerator.
Extracting a factor for -2 from the square root would probably make further simplification possible but there is no simple command to do so.

Factor_ := -2

-2

(4)

old := simplify([op(denom(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2))))])

[(-beta^2+1)^(1/2), -2+(x__0+1)*beta^2]

(5)

new := old; new[1] := old[1]/Factor_; new[2] := old[2]*Factor_

[-(1/2)*(-beta^2+1)^(1/2), 4-2*(x__0+1)*beta^2]

(6)

subs(1/old[1] = 1/new[1], 1/old[2] = 1/new[2], -(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))

2*(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(4-2*(x__0+1)*beta^2))

(7)

expand(simplify(2*(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(4-2*(x__0+1)*beta^2))))

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(8)

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = rhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(9)

is(2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

true

(10)

Second approach after "discovering" that content works also on square roots

[op(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))]

[-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)]

(11)

mul(`~`[`*`](`~`[content]([-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)]), `~`[primpart]([-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)])))

-2^(1/2)*(-beta^2*x__0-beta^2+2)^(1/2)/((-beta^2+1)^(1/2)*(beta^2*x__0+beta^2-2))

(12)

simplify(-2^(1/2)*(-beta^2*x__0-beta^2+2)^(1/2)/((-beta^2+1)^(1/2)*(beta^2*x__0+beta^2-2))) = rhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

2^(1/2)/((2+(-x__0-1)*beta^2)^(1/2)*(-beta^2+1)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(13)

is(%)

true

(14)

NULL

Context: The left-hand side in an integrand which was produced by a change of variables in a elliptic integral. Maple simplifies only halfway which makes validation of the result of the variable change difficult.  

NULL

Related functional programming question: Is a onliner `...`(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))from the above content-primpart construct possible?

 

NULL

 

 

 

Download Simplify_radical_02.mw

Please Wait...