nm

5976 Reputation

17 Badges

9 years, 146 days

MaplePrimes Activity


These are questions asked by nm

I think there is a problem here

restart;
the_integrand:=(((-2*x^2+2)*exp(exp(exp(3)))^2+(4*x^3-4*x)*exp(exp(exp(3)))-2*x^4-6*x^2+8)*exp(ln(x)-x^2)*ln(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4)+((2*x^2-2)*exp(2)*exp(exp(exp(3)))^2+((-4*x^3+4*x)*exp(2)-2*x)*exp(exp(exp(3)))+(2*x^4+6*x^2-8)*exp(2)+2*x^2)*exp(ln(x)-x^2))/(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4);

int(the_integrand,x,method=_RETURNVERBOSE)

#try MeijerG
int(the_integrand,x,method=MeijerG);

gives

I do not know if this known or not.

Maple 2021.1 on windows

This is Maple 2021.1 on windows.

===================
restart;
expr:=x^(6+1/3);
res:=series(expr,x=0,6);
==============

gives
        O(x^(19/3))

But type of the above is not series:

===========
type(res,'series');
        false
===========

Yet convert(res,polynom) works

================
convert(res,polynom)
          0
================

Which is correct conversion. But help says that

"convert/polynom
convert a series to polynomial form"

Notice, it says "series" there.

So the input must be type series. But Maple says
O(x^(19/3)) is not type series. I think this is wrong. The
type returned should be series. Now the type returned is 'function'
from the series command.

What Am I overlooking here?

fyi;

Maple 2021.1 on windows 10.

Screen in worksheet displays this (correct)

But latex generated when compiled using lualatex from TEXLIVE 2021 shows this

code 

sol:=(Vector(2, [x(t),y(t)])) = (Vector(2, [8*c[1]*exp((1/2+1/2*89^(1/2))*t)/(-3+89^(1/2))-8*c[2]*exp((1/2-1/2*89^(1/2))*t)/(3+89^(1/2))+2/11*t^2-3/11*exp(t)-2/121*t+23/1331,c[1]*exp((1/2+1/2*89^(1/2))*t)+c[2]*exp((1/2-1/2*89^(1/2))*t)-1/11*t^2-15/22*exp(t)+12/121*t-17/1331])):

sol:=simplify(sol);

latex(sol)

`Standard Worksheet Interface, Maple 2021.1, Windows 10, May 19 2021 Build ID 1539851`

`The "Physics Updates" version in the MapleCloud is 1105 and is the same as the version installed in this computer, created 2021, November 8, 23:55 hours Pacific Time.`

zip file attached include the latex file and worksheet used.

issue_latex_nov_6_2021.zip

help on structured type says

| identical(expr) an expression identical to expr

and

The type identical(expr) matches the expression expr identically. If there is more than one expr (i.e. identical(expr1,expr2,...)), then this type matches any one of the exprN identically.
 

Then why does the following produce the same output?

restart;
expr:=x*A[2]+A[1];
select(type,expr,'`*`'({anything, identical(x^2)}));
select(type,expr,'`*`'({anything, identical(x)}))

x*A[2]

x*A[2]


I would have expected only the second select to find x*A[2].

What do I need to only select anything*x^2 without selecting anything*x ?

Actually anything in identical gives same result

select(type,expr,'`*`'({anything, identical(zzzzz)}));

x*A[2]

So I must be misunderstanding something about identical and how it works.  I want to match only anything*x^2 and nothing else. How to do that?

all these things are trivial to do use pattern matching. But in Maple, one is supposed to use structured types.

 

I can't figure this one out.

I need to pick out the subexpression   anything*sin(3*x) from an expression.

it works, when the expression is   anything*sin(3*x)+something else. But when the expression is exactly  anything*sin(3*x) then select returns and not anything*sin(3*x) as I was expecting.

So I must be doing something silly, but do not see it.

restart;
TypeTools:-AddType('type_1', '`*`'({anything,identical(exp(3*x))}));
expr:=25*A[1]*exp(3*x);
type(expr,type_1);

returns true. good. Now I test it on 

select(type,expr+sin(x),type_1) ;

and this returns what is expected. 25*A[1]*exp(3*x) but when I type

select(type,expr,type_1) ;

it return

reading select help page did not help.  Tried flatten, inplace.

I can do this using patmatch

patmatch(expr,a::anything*exp(3*x),'la');la

But why is select not working in the above? What is the correct way to do this so it works for a*expr+anything and also for a*expr only? This is done inside a function and not interactive. So I need it to work for both cases, since the input can be anything, but I only need the term anything*exp(3*x) pulled out.

 

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