## 2473 Reputation

1 years, 275 days

## Eigenvectors...

You just need:

Eigenvectors(K, evalf(M));

(omit evalf for a symbolic solution).

## Example...

```plot(cos(1/theta)/sqrt(1-theta^2), theta=0.2 .. 0.99,
labels = ['theta', typeset(cos," (","1/",theta,") / ",sqrt(sort(1-theta^2,theta,ascending)))]);
```

Probably o solution using Typesetting exists but with more "acrobatics".
In my opinion Maple should provide a "LaTeX" option  for such situations:
label = ['theta', LaTeX(...)],    title = LaTeX(...)   etc.

## assume...

int(1/(x^2*sqrt(1-x^4/b^4)), x = a .. b) assuming a>0,b>a ;

## The definition of the differential order...

The definition of the differential order (DO) is recursive.
Suppose that we have a single indeterminate x.
E.g. if E is a (nonconstant) expression then DO(diff(E,x)) = DO(E) + 1  and  DO(h(E)) = DO(E), h being a function.
This approach seems to be natural.

## Apollonius...

```Apollo:=proc()
local A:=table([[0,-1],[-1/2,2],[1/2,2],[2*I/3,3]]), N:=4, fifth, gen;
fifth :=proc(i1,i2,i3,i4)
local k5,z5;
if N>500 then return fi;
k5 := 2*(A[i1][2]+A[i2][2]+A[i3][2])-A[i4][2];
z5 := (2*(A[i1][2]*A[i1][1]+A[i2][2]*A[i2][1]+A[i3][2]*A[i3][1])-A[i4][2]*A[i4][1])/k5;
if k5<200 and not member([z5,k5],A) then N:=N+1; A[N]:=[z5,k5];
gen(i1,i2,i3,N);
fi;
end:
gen:= proc(i1,i2,i3,i4) fifth(i1,i2,i3,i4);fifth(i1,i2,i4,i3);
fifth(i1,i3,i4,i2);fifth(i2,i3,i4,i1) end;
gen(1,2,3,4);   #print(N);
plots:-display(seq(plottools:-circle([Re(A[i][1]),Im(A[i][1])],1/A[i][2]), i=1..N),
axes=none, caption=cat("Apollonius gasket: ",N, " circles plotted"), size=[800,800])
end:
```

Apollo();

## split...

Maple does not know to manipulate indexed variables from a symbolic sum such as

 > s:=sum(f[i](x[i]),i=1..n);
 (1)

For example, diff will act syntactically, giving wrong mathematical results

 > diff(s,x[i]);  # wrong
 (2)
 > diff(s,x[j]); # wrong
 (3)

To differentiate versus x[j]  we must split each such sum in sums independent of x[j]

In the previous example:

 > sj:=sum(op(1,s),i=1..j-1) + sum(op(1,s),i=j+1..n) + subs(i=j, op(1,s));
 (4)
 > diff(sj, x[j]);  # OK
 (5)
 > diff( x[j]*sj^2, x[j]);  # OK
 (6)

Note that sometimes such a split could be tricky, for example:

 > sum(x[floor(i/3)]*x[i], i=3..n);
 (7)
 >

## direct solution...

 > restart;
 > f:=w__1 * x__1 + w__2 * x__2; constr:=x__1^a * x__2^b - y=0;
 (1)
 > extrema(f, constr, {x__1, x__2}, 's'):
 > expand~(s[])  assuming positive;
 (2)
 > combine(%);
 (3)

It is possible to combine the middle terms but I think that this should not matter (i.e. Maple should not be used as a typesetting machine).

## spacecurve...

Catalan1 := (alpha,beta)->[alpha-sin(alpha)*cosh(beta), 1-cos(alpha)*cosh(beta), 4*sin((1/2)*alpha)*sinh((1/2)*beta)]:
p1:=plot3d(Catalan1(alpha,beta), alpha = 0 .. 2*Pi, beta = -3 .. 3, scaling = constrained, title = "Catalan's surface", titlefont = [Courier, bold, 14]):
with(plots):
p2:=spacecurve( [Catalan1(alpha,-3), Catalan1(alpha,3)],alpha=0..2*Pi,color=red,thickness=5):
display(p1,p2);

## scalars...

It seems that now the Vector and Matrix constructors accept only scalars.

But we may use delayed evaluation.

 > Vector(2,(a) -> 'Matrix'(2,2,(b,c) -> m||a||b||c));
 (1)
 > A:=<1,2;3,4>;B:=<2,3,4>;
 (2)
 > Vector([B,B]); #assemble
 (3)
 > Vector([A,B]);
 > Vector(['A','B']);
 (4)
 > Matrix(1,2,[[A,B]]);
 > Matrix(1,2,[['A','B']])
 (5)

## Change...

J:=int(ln(x)^n,x):
ch := t=ln(x):   IntegrationTools:-Change(J, ch):
simplify(eval(%, ch));

## It will work...

1. Don't use procedures. Use expressions:

SED2 := 32/3 * ...

(if you really need procedures, for diff use unapply).

2. To have polynomials extract only the numerators:

SED2 := numer(SED2).

(Maybe you will have to take the derivatives before that, it depends on your intentions).

3. Use ":" instead of ";"  only after everything works OK,

## Floats?...

rand(-2 .. 2)  generates coefficients from the set {-2,-1,0,1,2}.

If you want floats (real numbers), use rand(-2.0 .. 2.0)

## Numerically...

 > restart;
 > Digits:=15;
 (1)

Solving numerically the recurrence

F(0,y) = 0,

F(x,y) = y/(y+1)*F(x-1,y)^((y+1)/y) + 1/(y+1)

and approximating  limit( F(n,n),  n = infinity)

No chance for a closed form (probably).

 > F:=proc(x,y)    if x=0 then return 0 fi;    y/(y+1)*F(x-1,y)^((y+1)/y)+1/(y+1) end:
 > F(2,2);
 (2)
 > F(1000,1000.);
 (3)
 > F(10^4,10.^4);
 (4)
 > F(10^5,10.^5);
 >

We must use a non-recursive version:

 > f:=proc(x,y) local r:=0,a, z:=(y+1)/y, w:=y/(y+1), y1:= 1/(y+1); to x do r:=  w*r^z+y1 od; r end:
 > f(2,2);
 (5)
 > seq( [n, f(10^n,10.^n)],n=1..6);
 (6)
 >

## Symbolic absolute extrema for two variab...

 > restart;

The exact (symbolic) absolute min and max.
Two variables. The constraints must define a compact domain.
Based on extrema and solve (which are supposed to work).

 > absminmax:=proc(f::algebraic, constr::set(relation),candi::name:='_candidates') local bdr, n,P,i,j,u,s,cand,x,y; s:=indets([f,constr],name) minus {constants}; if nops(s)<>2 then error "Two indeterminates only" fi; bdr:=seq(lhs(u)-rhs(u)=0,u=constr): x,y:=s[];  n:=0:  P:=Vector(): for j to nops(constr) do for i to j-1 do   s:=solve([bdr[i],bdr[j]],{x,y},explicit);   for u in [s] do n:=n+1; P(n):=u od; od od: for i to nops(constr) do   extrema(f, {bdr[i]},{x,y}, 's'):   for u in s do n:=n+1: P(n):=u od; od: s:=solve([diff(f,x),diff(f,y)],{x,y},explicit): for u in [s] do n:=n+1: P(n):=u od: cand:=select(u -> type(rhs~(u),set(realcons)), {entries(P,nolist)}); cand:=select(u -> is( `and`( eval(constr, u)[]) ), cand); candi:=cand; if cand={} then return {} fi; min[index]( [seq(eval(f,u),u=cand)]):     s:=`min`=eval(f,cand[%]), cand[%]; max[index]( [seq(eval(f,u),u=cand)]):     s, `max`=eval(f,cand[%]), cand[%]; end:

Examples

 > f1:=2*x^2+4*x*y+2*x-2*y^2+y+4:
 > constr1:={ y>=(1/21)*x-283/42,           x<=(3/29)*y+329/58,           y<=(1/9)*x+131/18,           x>=-(1/9)*y-113/18 }:
 > absminmax(f1, constr1);
 (1)
 > _candidates;
 (2)
 > f2:=4*x*y-2*y^2+4*x+y+4: constr2:={y >= -(1/13)*x-85/13, y <= -(25/14)*x+26/7, y <= (23/12)*x+89/12}:
 > absminmax(f2, constr2,'ccc');
 (3)
 > absminmax(x^2+y^2, {x<=1,y<=3,x>=0,y>=0});
 (4)
 > absminmax(x+y, {(x-1)^2+y^2<=1, y>=x^2});
 (5)
 > absminmax(exp(x+y), {(x-1)^2+y^2<=1, y>=x^2});
 (6)
 > absminmax(x+y, {(x-1)^2+y^2<=1, y>=x^2+10});
 (7)
 > absminmax(x^2-y^2, {(x-1)^2+y^2<=1, y>=x^2});
 (8)
 > absminmax(x^4-y^2, {(x-1)^2+y^2<=1, y<=x^2});
 (9)
 >

## int...

Diff(int(value(z), t), t);

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