nm

10416 Reputation

19 Badges

12 years, 189 days

MaplePrimes Activity


These are questions asked by nm

These two expressions are the same

e1:=-sqrt(-(exp(-2 + 2*x) - 2)*exp(-2 + 2*x))/(exp(-2 + 2*x) - 2);
e2:=1/sqrt(2*exp(-2*x)*exp(2) - 1);

Is there an automated way to simplify e1 to e2? Below are my attempts. The closest I got is 

simplify(e1) assuming real;

But that still does not give same as e2. I can do it by "hand" as shown. But I like to find automated way since this is done in code without looking at expression. So I can't use the "hand" method there.

We can assume everything in real domain.


 

15244

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

e1:=-sqrt(-(exp(-2 + 2*x) - 2)*exp(-2 + 2*x))/(exp(-2 + 2*x) - 2);
e2:=1/sqrt(2*exp(-2*x)*exp(2) - 1);
plot([e1,e2],x=-3..3)

-(-(exp(-2+2*x)-2)*exp(-2+2*x))^(1/2)/(exp(-2+2*x)-2)

1/(2*exp(-2*x)*exp(2)-1)^(1/2)

simplify(e1,size);
simplify(e1,symbolic);
simplify(e1) assuming real; #closest but still no cigar
 

-(-(exp(-2+2*x)-2)*exp(-2+2*x))^(1/2)/(exp(-2+2*x)-2)

-I*exp(-1+x)/(exp(-2+2*x)-2)^(1/2)

exp(-1+x)/(-exp(-2+2*x)+2)^(1/2)

#can do it "by hand" by dividing upstairs and downstrais by numerator
A:=exp(-1 + x);
B:=-exp(-2 + 2*x) + 2;
e3:=1/sqrt( simplify(expand(B/A^2)))

exp(-1+x)

-exp(-2+2*x)+2

1/(-1+2*exp(2-2*x))^(1/2)

#verify
plot([e3,e2],x=-3..3)

 

 


Download simplification_june_6_2024.mw

We see that this ode (x + y(x))*(1+diff(y(x),x)) = 0  has 2 solutions, One when (x + y(x))=0 and one when (1+diff(y(x),x))=0. Maple gives 3 solutions. They are correct but why?

Also when changing (1+diff(y(x),x)) to (a+diff(y(x),x)) now it gives only two solution.

Why does this happen? Should it not just return 2 solutions in both cases? and more strange one

(x + y(x))^2 *(1+diff(y(x), x))=0; now it gives 4 solutions. But this is no different. We also have 2 solutions. One when (x + y(x))=0 and one when (1+diff(y(x), x))=0. This time the extra two solutions are complex. 

17168

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1754 and is the same as the version installed in this computer, created 2024, June 3, 20:39 hours Pacific Time.`

ode:=(x + y(x))*(a+diff(y(x),x)) = 0;
dsolve(ode);
map(X->odetest(X,ode),[%])

(x+y(x))*(a+diff(y(x), x)) = 0

y(x) = -x, y(x) = -a*x+c__1

[0, 0]

ode:=(x + y(x))*(1+diff(y(x),x)) = 0;
dsolve(ode);
map(X->odetest(X,ode),[%])

(x+y(x))*(1+diff(y(x), x)) = 0

y(x) = -x, y(x) = -x-c__1, y(x) = -x+c__1

[0, 0, 0]

ode:= (x + y(x))^2 *(1+diff(y(x), x))=0;
dsolve(ode);
map(X->odetest(X,ode),[%])

 

(x+y(x))^2*(1+diff(y(x), x)) = 0

y(x) = -x, y(x) = -x+c__1, y(x) = -(1/2)*c__1-((1/2)*I)*3^(1/2)*c__1-x, y(x) = -(1/2)*c__1+((1/2)*I)*3^(1/2)*c__1-x

[0, 0, 0, 0]

 

 

Download why_extra_solution_from_dsolve_june_5_2024.mw

Any idea why this sometimes happens? odeadvisor says ode is quadrature but when asking it to solve it using quadrature sometimes it works and sometimes not.

Am I doing something wrong?

22020

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1754 and is the same as the version installed in this computer, created 2024, June 3, 20:39 hours Pacific Time.`

restart;

18368

Example 1 that does not work

 

ode:=diff(y(x),x)=-1;
DEtools:-odeadvisor(ode);

diff(y(x), x) = -1

[_quadrature]

sol:=dsolve(ode,y(x),['quadrature']);

"sol := "

Example 2 that works

 

ode:=diff(y(x),x)=x;
DEtools:-odeadvisor(ode);

diff(y(x), x) = x

[_quadrature]

sol:=dsolve(ode,y(x),['quadrature']);

y(x) = (1/2)*x^2+c__1

 

 

Download sometimes_dsolve_works_on_quadrature_june_5_2024.mw

Any one could find why Maple 2024 gives Error, (in evalf/int) invalid arguments on this ode? Why is it even calling evalf in first place as this is all symbolic.

Also reported to Maplesof just in case.

25504

restart;

25504

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1752 and is the same as the version installed in this computer, created 2024, May 31, 18:17 hours Pacific Time.`

ode:=diff(y(x), x)^3 = (x - 2)^2;
ic:=y(2)=1;
Student:-ODEs:-ODESteps([ode,ic]);

(diff(y(x), x))^3 = (x-2)^2

y(2) = 1

Error, (in evalf/int) invalid arguments

dsolve([ode,ic])

y(x) = 1+(1/5)*(3*x-6)*RootOf(_Z^3-x^2+4*x-4)

DEtools:-odeadvisor(ode)

[_quadrature]

 

 

Download odetest_internal_error_evalf_int_june_3_2024.mw

I wanted to do 

map(X->odetest(X,ode) assuming x>0,[sol]) 

where sol are the solutions I wanted to test. The above does not work as is. After some trial and errors, I found this works

map(X->[odetest(X,ode) assuming x>0],[sol]) 

I am not sure why. But it works. Is this the above the correct way to add assuming to a command inside Map? Or is there a different way or better way to do this?

I want to stick to the map command as above and nothing else such as ~ or some other ones. I find map more clear to use for me.

Here is worksheet.

9592

restart;

9592

ode:=x = diff(y(x), x)*sqrt(1 + diff(y(x), x)^2);

x = (diff(y(x), x))*(1+(diff(y(x), x))^2)^(1/2)

sol:=dsolve(ode);
map(X->[odetest(X,ode) assuming x>0],[sol])

y(x) = ((1/32)*I)*2^(1/2)*(-(256/3)*Pi^(1/2)*2^(1/2)*x^3*cosh((3/2)*arcsinh(2*x))-8*Pi^(1/2)*2^(1/2)*(-(64/3)*x^4-(8/3)*x^2+2/3)*sinh((3/2)*arcsinh(2*x))/(4*x^2+1)^(1/2))/Pi^(1/2)+c__1, y(x) = -((1/32)*I)*2^(1/2)*(-(256/3)*Pi^(1/2)*2^(1/2)*x^3*cosh((3/2)*arcsinh(2*x))-8*Pi^(1/2)*2^(1/2)*(-(64/3)*x^4-(8/3)*x^2+2/3)*sinh((3/2)*arcsinh(2*x))/(4*x^2+1)^(1/2))/Pi^(1/2)+c__1, y(x) = Int(-(1/2)*(-2+2*(4*x^2+1)^(1/2))^(1/2), x)+c__1, y(x) = Int((1/2)*(-2+2*(4*x^2+1)^(1/2))^(1/2), x)+c__1

[[(1/2)*(2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)], [-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)], [2*x], [0]]

for item in [sol] do
    odetest(item,ode) assuming x>0;
od;

(1/2)*(2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

-(1/2)*(-2*x*(4*x^2+1)^(1/2)+(-8*x^2*cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+16*x^3*sinh((3/2)*arcsinh(2*x))-cosh((3/2)*arcsinh(2*x))*(4*x^2+1)^(1/2)+4*sinh((3/2)*arcsinh(2*x))*x)*(-2+2*(4*x^2+1)^(1/2))^(1/2))/(4*x^2+1)^(1/2)

2*x

0

 

 

Download how_to_use_map_with_assuming.mw

First 19 20 21 22 23 24 25 Last Page 21 of 189