nm

1435 Reputation

13 Badges

5 years, 31 days

MaplePrimes Activity


These are questions asked by nm

I know the latex() command in Maple have many issues and I have no hope of what I will ask having a solution, but thought to ask any way.

Is there a way to make maple generate the latex for all the derivatives to use ' instead of d/dx ?

for example, given this
 

ode:=diff(y(x),x)=x;
latex(ode,output=string);

The Latex generated (which is correct) is

{\frac {\rm d}{{\rm d}x}}y \left( x \right) =x

but sometines I find it more readable if the latex was

y'(x)=x

which is more common in textbooks and other places. The problem also is that I am using worksheet so can't use  y'(x) as input.

But even switching to document mode, and writing it 2D math as input, the Latex output still does not match the input

So if there is a solution to this, would it require changing the latex() command itself? or can it be done at user level?

I'd like all orders of derivatives anywhere in the equation to come out as y'' etc.. so diff(y(x),x$3) should generate the latex y'''(x) and so on.

Is there a trick to do this?

Maple 2017.2

 

 

Does Maple have build-in function, which when given an expression that depends on x and y, will separate it to a product of two functions, one that depedns on x only and the other that depends on y only?

The input mathematical expression is known to be seperable.

For example, If the input is

((3*y + y^2)*3*x)/(x + sin(x))

Then I'd the Maple function to take the above and return list or set of two parts  {(3*y + y^2)   ,     3*x/(x + sin(x) } (if it can't separate it, it can return null).

The API can be something as  

 f,g = find_product_functions(expression,[x,y])

Something like this is used on determining for example if RHS of first order ODE is separable in order to solve it more easily.  collect() does not really work for this. So Maple allready does this internally in its ODE solver when it checks if ODE is separable or not. But is the function available for users?

 

 

One of the things I like in Maple is that I can return a local symbol from a proc() in some expression and it will not "conflict" with same symbol in the global space and will show the same.

I just do not know how Maple manages to do this.

For example:

foo:=proc(n)
   local x;
   x^n;
end proc;

And now if I do

x:=99;
foo(3);

Will return  x^3. This is even thought I had defined x:=99; before the call.

So there is one global `x` with value 99 and the `x` in the expression returned `x^3` did not get confused with the global `x`. Yet they look the same.

How does Maple manages to do this? In Mathematica, it always return local symbols with $nnn assigned to them to distinguish them from global symbols. (attaches the Module ID). For example, in Mathematica the same example above gives

Notice that the `x` returned from a proc() look different from inside the Module. It is not the same as the x in the global space.

Maple seems to be able to do the same thing, but using the same looking symbol. So it must be keeping track of things internally? It must know that the x in x^3 is not the same x in the x:=99 ofcourse.

Any idea how Maple does this?

 

restart;
sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)),y(x));

Gives

But the solution can also be written as

I just do not know how to transform the first solution to the second simpler one. I tried:

sol:=map(x->rhs(x),[sol]);
simplify(sol,radical);

Also tried simplify(sol,sqrt); simplify(sol,radical,symbolic); simplify(sol,size);

The simpler solution can be found as follows

restart;
sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)),y(x),'implicit');

But the term in the middle above is

Therefore the solution is really

eq:=y(x)^2-sqrt(x^2-16)-_C1 = 0;
solve(eq,y(x));

Which gives

What command to simplify the long solution to the shorter one obtained from the implicit?

 

The solution by Maple below is correct, but non-the-less, a little strange.

restart;
dsolve(diff(y(x),x)=3*x^2*(y(x)^2+1),y(x));

Gives

Ofcourse 3*constant is still constant. But it is a little strange and have no reason for it to be there.  When I solve it by hand

What could made Maple put the 3 in there? Again, solution is 100% correct, but it could be simpler.

Maple 2017.1

 

 

1 2 3 4 5 6 7 Last Page 1 of 35