C_R

1960 Reputation

19 Badges

5 years, 282 days

MaplePrimes Activity


These are questions asked by C_R

Update: partly resolved in Maple 2023. int_warning.mw still does not show the warning

There is a very helpful warning about using assumptions from the int command that does not appear in the attached case:
Warning, unable to determine if -1 is between 0 and x0; try to use assumptions or use the AllSolutions option
Warning, unable to determine if 1 is between 0 and x0; try to use assumptions or use the AllSolutions option

Using infolevel[int]:=5 in Maple 2022.2,  one can see that the integrals listed under int/ellalg/elltype are not the same.

My preference would be to have this warning always working. It's a reminder that Maple cannot give a general answer but that there might be solutions for a restricted real domain. The warning also does not reproduce when execution the corresponding help page
(Update: the warning reproduces in Maple 2023)

https://www.maplesoft.com/support/help/errors/view.aspx?path=Warning,%20unable%20to%20determine%20if%201%20is%20between%200%20and%20x__0;%20try%20to%20use%20assumptions%20or%20use%20the%20AllSolutions%20option

Sidenote: This kind of warning is so useful that I wonder if and how such warnings could be extended beyond  integration with piecewise solutions. (Maybe also to other commands. Maple often returns input unevaluated because there is no general solution in the complex domain, without informing the inexperienced user that there might be solutions available in the real domain.)

int_warning.mw

int_warning_with_infolevel.mw

 

 

queryequal(expr1, expr2)

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

(1)

(This question has its origin here).
Plotting the difference of rhs - lhs seems to indicate equality over the range [0..1)

difference := rhs(op(queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))))[1])-op(queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))))[2]; plot(difference, x__0 = 0 .. 1, title = 'difference', color = RED)

 

Try simplify

`assuming`([simplify(difference)], [0 < x__0 and x__0 < 1])

(EllipticK((1/2)*(2+2*x__0)^(1/2))-EllipticF(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))-EllipticF(1/(1+x__0)^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))*2^(1/2)

(2)

Try combine

`assuming`([combine(difference)], [0 < x__0 and x__0 < 1])

-2^(1/2)*EllipticF((x__0/(1+x__0))^(1/2)*2^(1/2), (1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2))+2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))

(3)

Try conversion to integral form

convert(difference, Int)

2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. 1))-2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2)))-2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. (1-1/(1+x__0))^(1/2)*2^(1/2)))

(4)

`assuming`([simplify(%)], [0 < x__0 and x__0 < 1])

-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1)))

(5)

plot(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = .999 .. 1, color = RED)

 

evalf(eval(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = 1), 40); evalf(eval(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = .9999999999), 40)

-0.8716953127866940896552122384831392143938e-30

(6)

There seems to be a finite difference at x__0 = 1

``

Try an addition theorem from DLMF

Since all elliptic expression have the same modulus k, the following addition theorem could be applied under the condition that the corresponding case is fulfilled https://dlmf.nist.gov/19.11#E7

Check if the following case applies (i.e. is ψ=π/2?)

 

NULL

NULL

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

(7)

theta = 1/sqrt(1+x__0), `&varphi;` = sqrt(1-1/(1+x__0))*sqrt(2)

theta = 1/(x__0+1)^(1/2), varphi = (1-1/(x__0+1))^(1/2)*2^(1/2)

(8)

k = (1/2)*sqrt(1+x__0)*sqrt(2)

k = (1/2)*(x__0+1)^(1/2)*2^(1/2)

(9)

tan((1/2)*psi) = (sin(theta)*Delta(`&varphi;`)+sin(`&varphi;`)*Delta(theta))/(cos(theta)+cos(`&varphi;`))

tan((1/2)*psi) = (sin(theta)*Delta(varphi)+sin(varphi)*Delta(theta))/(cos(theta)+cos(varphi))

(10)

Delta(theta) = sqrt(1-k^2*sin(theta)^2)

Delta(theta) = (1-k^2*sin(theta)^2)^(1/2)

(11)

subs(theta = `&varphi;`, Delta(theta) = (1-k^2*sin(theta)^2)^(1/2))

Delta(varphi) = (1-k^2*sin(varphi)^2)^(1/2)

(12)

subs(Delta(theta) = (1-k^2*sin(theta)^2)^(1/2), Delta(varphi) = (1-k^2*sin(varphi)^2)^(1/2), k = (1/2)*(1+x__0)^(1/2)*2^(1/2), theta = 1/(1+x__0)^(1/2), varphi = (1-1/(1+x__0))^(1/2)*2^(1/2), tan((1/2)*psi) = (sin(theta)*Delta(varphi)+sin(varphi)*Delta(theta))/(cos(theta)+cos(varphi)))

tan((1/2)*psi) = (sin(1/(x__0+1)^(1/2))*(1-(1/2)*(x__0+1)*sin((1-1/(x__0+1))^(1/2)*2^(1/2))^2)^(1/2)+sin((1-1/(x__0+1))^(1/2)*2^(1/2))*(1-(1/2)*(x__0+1)*sin(1/(x__0+1)^(1/2))^2)^(1/2))/(cos(1/(x__0+1)^(1/2))+cos((1-1/(x__0+1))^(1/2)*2^(1/2)))

(13)

`assuming`([simplify(subs(psi = (1/2)*Pi, tan((1/2)*psi) = (sin(1/(1+x__0)^(1/2))*(1-(1/2)*(1+x__0)*sin((1-1/(1+x__0))^(1/2)*2^(1/2))^2)^(1/2)+sin((1-1/(1+x__0))^(1/2)*2^(1/2))*(1-(1/2)*(1+x__0)*sin(1/(1+x__0)^(1/2))^2)^(1/2))/(cos(1/(1+x__0)^(1/2))+cos((1-1/(1+x__0))^(1/2)*2^(1/2)))))], [0 < x__0 and x__0 < 1])

1 = (sin(1/(x__0+1)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2))*((2+2*x__0)*cos(1/(x__0+1)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(x__0+1)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2)))

(14)

plot([lhs(1 = (sin(1/(1+x__0)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))*((2+2*x__0)*cos(1/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(1+x__0)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2)))), rhs(1 = (sin(1/(1+x__0)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))*((2+2*x__0)*cos(1/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(1+x__0)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))))], x__0 = 0 .. 1, legend = [lhs, rhs])

 

lhs and rhs are not equal -> Case psi = (1/2)*Pi does not apply (provided that the formulas have been applied correctly).
Perhaps this is why Maple does not simply the difference to zero.  NULL


Anything else that could be tried in Maple (maybe with other formulas)?

Download Equality_of_Elliptic_expressions.mw

DLMF offers different encodings for mathematical expressions. Example:

 

I was wondering if TeX or pMML (never seen before)  can be imported into Maple and subsequently be used as  Maple Input.

I cannot find documentation on Typesetting commands that can explain the following

From the help page of apply:

lprint(Typesetting[Typeset](sqrt(x)));

Typesetting:-msqrt(Typesetting:-mi("x"))

 

The first argument to Typeset has type uneval , signifying that it is not evaluated before being passed to Typesetting[Typeset].

Questions:

Where can I see  in the lprint output that the first argument is of type uneval?
Is sqrt(x) the first argument?
What does mi do?

Download help_page_apply.mw

I remember a section “Tell us what we can do better” at the bottom of online help pages. I used this whenever I came across a potential error worth investigating.

Has this section disappeared (I hope not) or do I have a browser issue?

First 12 13 14 15 16 17 18 Last Page 14 of 24