C_R

1461 Reputation

19 Badges

4 years, 9 days

MaplePrimes Activity


These are questions asked by C_R

For example from

sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity)

sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity)

(1)

by substituting k by k+1 to

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

(2)

Doing

subs(k = k+1, sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity))

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k+1 = 0 .. infinity)

(3)

leads to output that can't be processed further  

subsop(2 = 'k = -1 .. infinity', sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k+1 = 0 .. infinity))

Error, (in sum) second argument must be a name, name=a..b, name=RootOf, or name=algebraic

 

NULL

Doing it programmatically this way

shift := k = k+1; rsd := (lhs-rhs)(shift); subs(shift, [op(sum(a[k]*(k+r)*(k+r-1)*x^(k+r-1), k = 0 .. infinity))]); lhs(%[2])+rsd = map(`+`, rhs(%[2]), rsd); sum(subsop(2 = %, `%%`)[])

sum(a[k+1]*(k+1+r)*(k+r)*x^(k+r), k = -1 .. infinity)

(4)

is not realy elegant and easy to understand.

Download shifting_index_in_sums.mw

Are there better ways?

(Deleted because not reproducible on a different PC)

With 1D

int(1/(sqrt(x__0 - x)*sqrt(-x^2 + 1)), x = 0 .. x__0)

Warning, unable to determine if -1 is between 0 and x__0; try to use assumptions or use the AllSolutions option

 

Warning, unable to determine if 1 is between 0 and x__0; try to use assumptions or use the AllSolutions option

 

int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0)

(1)

NULL

With 2D

int(1/(sqrt(x__0-x)*sqrt(-x^2+1)), x = 0 .. x__0)

int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0)

(1)

NULL

The root cause might be the same as for this open question.

int_warning_2D.mw

int_warning_1D.mw

Q1: Is it possible to find out where a warning was generated (i.e. which procedure issued the warning)?

Q2: Is a command specific warning suppression possible? Something like that for example: infolevel[int] := 0

Q3: Can warnings be removed form a document before printing it?

Typical warnings I want to suppress are attached
 

Download warnings_to_suppress.mw

Update: for the attached warnings Typesetting:-Settings(parserwarnings = false) is effective, which does not work for warnings discussed bellow.

 

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

5 6 7 8 9 10 11 Last Page 7 of 18