## 16895 Reputation

12 years, 335 days

## We can simply use the empty circle to sh...

We can simply use the empty circle to show that the line is interrupted at the point [0,0] :

 > restart; delta := t -> piecewise(t=0, 1, 0); Line:=plot(delta(t), t=-1..1, color=red, thickness=4): Options:=style=point,color=red,symbolsize=15: Point1:=plot([[0,0]],symbol=circle,Options): Point2:=plot([[0,1]],symbol=solidcircle,Options): plots:-display(Line,Point1,Point2, scaling=constrained, size=[800,400]);
 >

## Another way...

Example:

```n:=3:
Matrix(2^n,n, combinat:-permute([0\$n,1\$n],n));
```

## Finding y by x...

Since Maple does not explicitly solve your system of differential equations (only numerically), it is probably also impossible to express   in terms of  x  explicitly. But this is easy to do numerically. After that It's easy to plot the graph  y(x)  immediately using the numerical solution of the differential equation [x(t), y(t)]  as  parametric equations:

 > restart;         sys:=diff(x(t),t)=x(t)*y(t)+t,diff(y(t),t)=x(t)-t; diff(x(t), t) = x(t)*y(t)+t, diff(y(t), t) = x(t)-t; dsolve([sys,x(0)=0,y(0)=1],[x(t),y(t)]); # NULL (no answer from Maple)          sol:=dsolve([sys,x(0)=0,y(0)=1],[x(t),y(t)],numeric); # Examples X:=s->eval(x(t),sol(s)); Y:=s->eval(y(t),sol(s)); X(1); Y(2); plots:-odeplot(sol,[x(t),y(t)], t=0..2); # The plot y=F(x) plots:-odeplot(sol,[t,x(t)], t=0..2); plots:-odeplot(sol,[t,y(t)], t=0..2);
 > # Finding y numerically by x F:=x->Y(fsolve(s->X(s)-x, 0..infinity)); # Examples F(2), F(3); plot(F, 0..4, labels=["x","y"]); # The same plot as above
 >

Edit.

## is...

Do

```if is(89^(1/2)>0) then
print("yes");
else
print("no");
fi;```

## Area of a region...

Since your curve is just a straight line segment, your linear integral can be thought of as the area of a flat region (see the figure below):

 > restart; x:=2*t: y:=t: z:=2-2*t: F:=x*y+y+z: ds:=sqrt(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2); int(F*ds, t=0..1); plot(F*ds, t=0..1, filled);
 >

Addition. We can also illustrate your integral as the area of a ruled surface in 3D, set on your segment and made up of perpendiculars to that segment.

 > restart; x:=2*t: y:=t: z:=2-2*t: F:=x*y+y+z: A:=plots:-spacecurve([x,y,z], t=0..1, color=red, thickness=4, axes=normal, labels=["x","y","z"], orientation=[80,80]); v1:=eval(,t=1)-eval(,t=0); v2:=<-1,2,0>; with(LinearAlgebra): w:=v1 &x v2; e:=w/Norm(w,2); B:=plot3d([x,y,z]+~s*~F*~convert(e,list), t=0..1, s=0..1, style=surface, color="LightBlue", axes=normal, labels=["x","y","z"],orientation=[80,80]); plots:-display(A,B);
 >

Edit.

## A short way...

```restart;
with(Student[LinearAlgebra]):
A:=Matrix([[2, 3, -4], [0, -4, 2], [1, -1, 5]]);
Matrix(3,3, (j,i)->(-1)^(i+j)*Minor(A, i, j)); # This is the adjoint matrix to A ```

## Two-argument arctan, expand...

In fact, if  sin(t)=a  and  cos(t)=b, then from this does not follow that  t=arctan(a/b)  (only tan(t)=a/b). The correct equality will be  t=arctan(a,b) (of course up to a summand a multiple of 2 * Pi). See help on two-argument arctan  ?arctan
For proof, it is sufficient to use the command  expand  and no assumptions are required:

 > restart;
 > subexpx := Ls*cos(omega*t + phi__l + theta)*omega + sin(omega*t + phi__l + theta)*Rs;
 (1)
 > subexpx2 := sqrt((omega*Ls)^2+Rs^2)*sin(omega*t + phi__l + theta + arctan(omega*Ls,Rs));
 (2)
 > is(expand(subexpx - subexpx2 = 0));
 (3)
 >

## A way...

 > restart; V1:=LinearAlgebra[RandomVector](6,generator=10..20): V2:=LinearAlgebra[RandomVector](6,generator=50..100): ;
 (1)
 >

Edit: another way:

```Matrix(6,2, (i,j)->`if`(j=1,rand(10..20)(),rand(50..100)()));
```

## Alternative...

You can use  the empty symbol  ``  for this  (to prevent parentheses from expanding):

```restart;
eq:=a*``(2*A + 2*B) + b*C = c*``(2*A + B) + d*``(B*2) + e*``(C + 4*B);
subs({a = 6, b = 1, c = 6, d = 1, e = 1}, eq);
```

Your system has an infinite number of solutions depending on one parameter  C2 :

 > restart; wres := sqrt(C1+C2)/sqrt(C1*C2*L1); vores := -C1/C2*vin; z3 := (C1^2 *R1- j*sqrt(C1*C2*L1*(C1+C2)))/C2^2; sys :={wres=13.56e6*2*Pi, C1=C2, z3=40,abs(vores/vin)>=1}; solve(sys, {C1, C2, L1, R1});
 (1)
 >

## Procedure for this...

The procedure  PS  finds the first  m  members of this sequence.

```PS:=proc(m)
local L, S, k, n, a, b;
L:=[];
for k from 1 to m do
for n from 1 do
a:=ithprime(n); b:=cat(op(L),a);
if not (a in L) and isprime(parse(b)) then
L:=[op(L),a];  break fi;
od; od;
op(L);
end proc:

```

Example of use:
PS(100);
2, 3, 11, 7, 41, 31, 17, 163, 23, 79, 197, 241, 29, 37, 59, 193, 227, 229, 239, 439, 929, 337, 257, 1447, 509, 19, 293, 1723, 1619, 937, 179, 367, 251, 1063, 4241, 1291, 521, 1951, 443, 139, 191, 1753, 1217, 673, 53, 883, 809, 109, 5381, 3733, 311, 967, 449, 2683, 9239, 577, 971, 1453, 101, 1051, 107, 3301, 233, 1627, 2729, 2689, 5669, 1597, 2153, 1117, 5099, 10429, 5303, 6991, 4253, 1777, 281, 349, 5273, 1543, 1997, 1867, 1109, 769, 167, 4261, 3821, 14923, 173, 1531, 71, 13267, 14699, 3877, 137, 2389, 3803, 2671, 5879, 1039

Edit.

## Check...

```restart;
pde := -e*(diff(u(x, y), x, x) + diff(u(x, y), y, y) )+ a*diff(u(x, y), x) - x*(-p^2*x + 1)*sin(l*y) = 0;
A := -p; B := (1-2*a*A)/p; C := (2*e*A - a*B); p := e*l^2;
eval(pde, u(x,y) = (A*x^2 + B*x +C)*sin(l*y));
simplify(%);```

## The examples...

In addition to the numerical optimization commands  Optimization:-Maximize  and  Optimization:-Minimize, Maple has symbolic optimization commands  maximize  and  minimize , but none of these commands work with functions containing parameters. The simple examples below illustrate this. Optimization:-Maximize  and  Optimization:-Minimize commands does not work with piecewise-functions, even if they do not contain parameters.

 > restart;
 > f:=piecewise(x<=0,0,x<=2,x*(2-x),x<=3,2*(x-2),x<=5,-2*(x-4),-2);
 (1)
 > plot(f, x=-1..6, thickness=2, scaling=constrained);
 > Optimization:-Minimize(f, x=0..6); # a bug minimize(f, x=0..6); # OK maximize(f, x=0..6); # OK
 (2)
 > minimize(x^2+a*x+1, x=-infinity..infinity); # no answer minimize(x^2+a*x+1, x=-1..1); # no answer minimize(eval(x^2+a*x+1,a=1), x=-1..1); # OK for a specific parameter
 (3)
 >

Check if maximize  and  minimize commands will work with your function for specific parameter values. If so, you can write a procedure to calculate these, the parameters of this procedure will be the parameters of your function. This procedure will allow you to solve a variety of problems, for example, to plot graphs the dependence of the maximum and minimum on parameters.

## Maximum value of alpha...

Let  a  and  b  be the major and minor semiaxes of the ellipse, c - focal distance. From the condition  b=с  and the equality  a^2=b^2+c^2 , we easily get that  a=c*sqrt(2)  and the eccentricity  e=1/sqrt(2) .  By the condition b = c  the ellipse is determined up to similarity, the alpha angle does not change, therefore, in the calculations, we can assume that  c=1 .
Below  r1  and  r2  are the distances from a point  M(x,y)  on the ellipse to the ellipse foci.

 > restart; a:=c*sqrt(2): e:=c/a: r1:=a+e*x: r2:=a-e*x: c:=1: Eq:=(2*c)^2=r1^2+r2^2-2*r1*r2*cos(alpha); # The cosine rule
 (1)
 > solve(Eq, alpha);
 (2)
 > maximize(%, x=0..a, location);
 (3)
 >