## 11843 Reputation

7 years, 184 days

## A bug...

 > restart;

It seems to be a bug.
If we alter a bit the bindings, the result is as expected
For x=0, y=0  the results should be the same, but they are not!

 > use a=a+b in   use b=a-b in     a*b   end use             #   ==>   a*(a-b)   end use;              #   ==>   (a+b)*a              ##??
 (1)
 > use a=a+b+x in   use b=a-b+y in     a*b                        end use             # ==>    a*(a-b+y) end use;              # ==>  (a+b+x)*(a+b+x -b +y)   ##OK
 (2)
 > eval(%,[x=0,y=0]);
 (3)

## Maybe this...

```expr:=1+3*diff(y(x),x):
select( has, ["itself"=expr, op(expr)], diff(y(x),x));
```

## solve...

It is simpler to just use the obvious:
solve(Determinant(A),w);

## sinh(x) / x...

Mathematicaly, you need the inverse of the function

f : (0, oo) -> (1, oo),  f(x) = sinh(x) / x.

The inverse exists, let's denote it by F : (1, oo) --> (0, oo);
it ca be developed in power series but cannot be expressed in terms of known functions.

Your equation has a unique positive solution  C = mu*g*a/F(L/(mu*g*a))
iff  L/(mu*g*a) > 1  (provided that your constants are >0).

## eliminate?...

It is not clear what "handle" means to you. If you want to eliminate x and sigma from A, then:

```S:=solve([sigma+x=a, sigma*x=b], [sigma,x]):
A1:=eval(A,S[1]); A2:=simplify(%);
```

Unfortunately, A is not rational (an "isolated" square root is there),. Also:

length(A1); length(A2);
1757
47950

## From general solution...

 > restart;
 > pde := diff(u(x,t),t) + u(x,t)*diff(u(x,t),x) = 0;
 (1)

The general solution is however correct:

 > pdsolve({pde});
 (2)

From here, one obtains for    pdsolve({pde,u(x,0)=f(x)});  # instead of  u(x,t)=0  :

 > sol:=f->RootOf((f@@(-1))(y)+y*t-x, y):   # or,
 > Sol:=f -> solve( (f@@(-1))(y)+y*t-x, y): # or,
 > SOL:=f -> solve( y - f(-y*t+x), y):
 >
 >
 >
 > # Now:
 > sol(exp); SOL(exp); Sol(exp);
 (3)
 > SOL(x->x);
 (4)
 > sol(sin); SOL(sin); Sol(sin);
 (5)
 > SOL(erf);
 (6)

## without assumptions...

```restart;
p := alpha -> alpha^m:
q := alpha -> alpha^n:
Sa := 1/2*int(p(alpha)*D(q)(alpha), alpha = 0 .. 1, continuous);```

## issues...

There are several issues in the worksheet.

1. You have the thype Z^+  (in 2D). It should be posint or nonnegint.
2. You have used m:type instead of m::type.  Note that ":" is a separator.
3.  assuming in the definition of p and q is not used (even when it is correctly inserted):

The assuming command does not scan programs regarding the presence of assumed variables; for that purpose use assume.

```restart;
assume(m>0, n>0);
p := alpha -> alpha^m;
q := alpha -> alpha^n;

Sa := eval(1/2*int(simplify(p(alpha)*D(q)(alpha)), alpha = 0 .. 1)); # actually eval is not needed
```

## StringTools...

```SUBS := [a,b,c], x, [2,4,5,1,a,4,5,a,b,434,a,b,c,5,5,5,1]:

X:= convert~([SUBS[1], SUBS[1][2..], SUBS[2..]], string):
parse(StringTools:-SubstituteAll(X[-1], X[1][2..-2], X[3]));
parse(StringTools:-SubstituteAll(X[-1], X[1][2..-2], cat(X[3],",",X[2][2..-2])));
```

[2, 4, 5, 1, a, 4, 5, a, b, 434, x, 5, 5, 5, 1]

[2, 4, 5, 1, a, 4, 5, a, b, 434, x, b, c, 5, 5, 5, 1]

## Java...

The memory usage at the bottom of the worksheet refers to the Maple kernel.

The Java memory in the task manager is due to the GUI. It is not controlled by gc().
It seems that it is not released to the OS: just try  plot3d(x^2+y^2,x=-1..2,y=-1..1, numpoints=1000000);

The Java GUI is convenient for Maplesoft because it can be used in all platforms, but for the users ...
(It's a pity that the old Classic interface is gone.)

To use less memory, try to avoid graphics. You may also consider the command-line Maple.

## evalindets...

`evalindets(p, `*`, u -> `+`(op(u)));`

However, if you have in mind a more general expression, you must decide what to do e.g. with a^2 ( = a*a), a/b (=a*b^(-1)) etc.

## proof...

 > restart;
 > f := (2*y-1)*(4*y+6*x-3)/(y+3*x-1)^2; F :=z -> 4*z*(2*z+3)/(z+3)^2;
 (1)
 > simplify( F((y-1/2) / (x-1/6)) )  =  f;
 (2)
 >

1. Replace e^(...)  with  exp(...)

(or define  e:=exp(1)).
2.  The integral cannot be computed symbolically.
If you are satisfied with numerical values, just assign values to your constants C:=..., ...
and then execute

evalf( Int(f1(g), g=0..infinity) );

## workaround...

It's simpler to express the recurrence in terms of
X[n] = Sum(x[k], k=1..n)
instead of x[n]. Notice that x[n] = X[n] - X[n-1].
So,

`rsolve({u(1) = X[1], u(n + 1) = u(n) + (X[n + 1]-X[n] - u(n))/(n + 1)}, u(n));`

X[n] / n

## Exact solution...

```restart;
f := (x1-x2)*(x2-x3)*(x3-x4)*(x4-x1):
G := x1^2+x2^2+x3^2+x4^2-1:
H:=f + x5*G:
X:=x1,x2,x3,x4,x5:
Groebner:-Basis(diff~(H, [X]), plex(X)):
S:=solve(%, explicit):
nops([S]);      #    40
S[-1], simplify(eval(f, S[-1]));
```

{x1 = 1/4 + sqrt(3)/4, x2 = sqrt(3)/4 - 1/4, x3 = 1/4 - sqrt(3)/4, x4 = -1/4 - sqrt(3)/4, x5 = 1/4},   -1/8

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