nm

8552 Reputation

19 Badges

12 years, 354 days

MaplePrimes Activity


These are questions asked by nm

I need to change any occurance of   anything*sqrt(anything)  to say Z in any large expression.  (later, I can add the correct replacement once I know how to do it for Z).

I can change   sqrt(anything) with the help of the answers in Substitution-Of-Sub-Expressions-Is  but not  anything*sqrt(anything)

Here is an example to make it clear. Given

expr:=(-x + sqrt(9*x^2*exp(2*c) + 8)*exp(-c)+99)/(4*x)+ (a*sqrt(z)-99+sin(c*sqrt(r+4)+20))/3+10+1/(c+exp(-x)*sqrt(exp(x)))+sqrt(h)

Need to all some transformation on  those subexpressions circled above. For now, lets say I wanted to replace them with so it should becomes this

I can do this

subsindets(expr,anything^({1/2,-1/2}),ee->Z)

But I need to have the term (if any) that multiplies the sqrt as well included.

And that is the problem. Can't figure how to do it. When I try

subsindets(expr,anything*anything^({1/2,-1/2}),ee->Z)

Maple says Error, testing against an invalid type Ok. So anything*anything^({1/2,-1/2}) is not a type. What to do then?  Tried also subsindets(expr,t::anything*anything^({1/2,-1/2}),ee->Z) same error

And 

applyrule(t1::anything*sqrt(t0::anything)=Z, expr);

gives  which is wrong.

How to make this work in Maple using subsindets? Can one use pattern with subsindets? How to make a type for

               anything*sqrt(anything) 

Maple 2021.1

 

Why Maple likes to extract exp() outside the sqrt when its argument has minus sign vs. not?  Compare the following

restart;
eq2 := ln(2*u^2 + u - 1) = -c - 2*ln(x);
sol:=[solve(eq2,u)]:
simplify(sol[1])

and

eq2 := ln(2*u^2 + u - 1) = c - 2*ln(x);
sol:=[solve(eq2,u)]:
simplify(sol[1])

I like the above much better than the first one. Mathematica keeps both same form (i.e. keeps the exp() inside):

Maple's answers are correct ofcourse, I just do not understand the logic why when there is a minus sign on it likes to format it differently as shown.

Is there a way to make not do that?

 

In Maple 2021.1

restart;
int(cos(3*x)/(-(-1+8*cos(x)^2)^(1/2)+(3*cos(x)^2-sin(x)^2)^(1/2)),x)

gives

Error, (in SumTools:-DefiniteSum:-ClosedForm) numeric exception: division by zero

But in Maple 2020.2 it works OK giving an answer. (A very long one)

btw, the answer should be

3/4*arcsin(2/3*sin(x)*3^(1/2))-3/4*arctan(sin(x)/(-1+4*cos(x)^2)^(1/2))-3/4*arctan(sin(x)/(-1+8*cos(x)^2)^(1/2
))+5/8*arcsin(2/7*sin(x)*14^(1/2))*2^(1/2)-1/2*sin(x)*(-1+4*cos(x)^2)^(1/2)-1/2*sin(x)*(-1+8*cos(x)^2)^(1/2)

 

Is this a known issue? I know Maple int has went some changes and improvements in Maple 2021 from the release notes. May be this was caused by some of these changes?

https://www.maplesoft.com/products/maple/new_features/

  • Integration has been enhanced with improved algorithms for indefinite integration, and the ability to easily specify which integration method should be used and to compare the results from different methods."

Maple 2021.1 on windows 10

update July 2, 2021

These are additional failed integration in 2021.1 that throw exceptions now. no errors in 2020.2

#427
int(cos(3*x)/(-(-1+8*cos(x)^2)^(1/2)+(3*cos(x)^2-sin(x)^2)^(1/2)),x)

#533 #no error in Maple 2020, it does not evaluate there. But no error
int((-3+exp(7*x))^(2/3)/exp(2*x),x)

#26/11 #no error in Maple 2020, it does not evaluate there. But no error
int((b*x+(b^2*x^2+a)^(1/2))^(1/2)/(b^2*x^2+a)^(1/2),x)


 

dsolve accept system of first order ode's in the form x'=A x, where x' is vector, A is matrix of coefficients and x are the dependent variables. This is convenient since one does not have to convert things to a list.

But  dfieldplot and phaseportrait and DEplot do not accept this form. One must convert things to list first.

Here is an example

restart;
sys:=Vector([diff(x(t),t),diff(y(t),t)]) = Matrix([[1,2],[0,3]]).Vector([x(t),y(t)]);
dsolve(sys)

But

DEtools:-dfieldplot(sys,[x(t),y(t)],t=0..4,x=-4..4, y=-4..4);

Error, (in DEtools/dfieldplot) system must have same number of dependent variables as DE's.

workaround is to write the system as list

new_sys:=[diff(x(t), t)=x(t) + 2*y(t),diff(y(t), t)=3*y(t)];
DEtools:-dfieldplot(new_sys,[x(t),y(t)],t=0..4,x=-4..4, y=-4..4);

I know one can automate the conversion. But still, it would be better if dfieldplot would accept sys as dsolve did.

Same for 

DEtools:-phaseportrait(sys,[x(t),y(t)],t=0..4,[[x(0)=1,y(0)=0]],x=-4..4, y=-4..4);
#
DEtools:-DEplot(sys,[x(t),y(t)],t=0..4,[[x(0)=1,y(0)=0]],x=-4..4, y=-4..4);

They gives same error.

Since dsolve can do it, may be these other functions can also support taking a system of ode's in vector/matrix form? Any reason why not?

Maple 2021.1

 

 

I do not remember if there was a post on this before or not
Maple 2021.1

int(arcsin(x)/(1+(-x^2+1)^(1/2)),x)

gives

Error, (in Utils:-TransformAndApply) numeric exception: division by zero

The correct answer should be

((-1 + Sqrt[1 - x^2]) ArcSin[x])/x + ArcSin[x]^2/2 -  Log[1 + Sqrt[1 - x^2]]

I had to go back to Maple 2018, to get no exception:

May be this could be looked at for next Maple version?

First 50 51 52 53 54 55 56 Last Page 52 of 164