Question: How to use map and add assuming to the command?

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

Please Wait...