C_R

3817 Reputation

21 Badges

6 years, 266 days

MaplePrimes Activity


These are questions asked by C_R

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

I asked Maple AI what a glyph is. Then I prompted this

A kernel lost message was returned and the AI pannel became irresponsive.

Maple is still running well in exsisting and new tabs. 

Can the AI service be restarted from the user interface?

(Is that crash reproducible?)

 

Edit:

The HTML characters in the attached document cause problems here on MaplePrimes. You have to open the worksheet

Download HTML_characters_in_math_mode.mw

On my system (Windows 11) I can only remove an entry from the favorites when a document is open. With all documents closed removing does not work.

Can someone confirm?

Just for my interest.
Why is the following not working

one := ``(1);
                           one := (1)

 lprint(`%`);
Error, Got internal error in Typesetting:-Parse:-Preprocess : "invalid subscript selector"
Typesetting:-mambiguous(Typesetting:-mambiguous( lprint(%), 

  Typesetting:-merror("Got internal error in Typesetting:-Parse:\

  -Preprocess : "invalid subscript selector"")))

but this works

lprint(one);
``(1)
1 2 3 4 5 6 7 Last Page 1 of 53