## 1465 Reputation

5 years, 131 days

## how to convert latex output to string in...

Maple 16

I just found that Maple 17 and Maple 16 do not have the option "output=string" in the latex command.

And I need a way to convert the Latex generated to the screen to a string and save it to a variable like I can do with Maple 2017

Here is an example. In current Maple 2017 this works

result_of_int:=int((-5+3*x)^2/(2*x-1)^(7/2),x):
my_latex:= latex(result_of_int,output=string);


But in Maple 16, it gives an error

If I remove the output, then the result is not string.

How to capture the above output which is on the screen and save it as string in a variable?

I do not want to send the output to a file as is. I need to first convert it to a string, and save
it to variable first.

## strange result from algsubs...

Maple 2017

Would someone be able to explain this strange output?

restart;
sol:=int(1/(x*sin(x)),x);
algsubs(x=t,sol);


How did Maple manage to obtain this? I tried tracing but it did not help me figure it out.  If it is of any help:

int(1/sin(x),x);

It seems algsubs got confused somewhere?

Maple 2017.2, windows.

## make latex() generate y'(x) for diff(y(x...

Maple 2017

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 ## Determining f,g such that f(x)*g(y)= H(... Maple 2017 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? ## local symbols and global symbols scope q... Maple 2017 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?

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