Kitonum

21525 Reputation

26 Badges

17 years, 75 days

MaplePrimes Activity


These are answers submitted by Kitonum


 

restart:
 with(Student:-MultivariateCalculus):
 A := [0, 0];
B := [5, 0];
C := [3, 4];
DD := [a, 2];
solve([Distance(B, A)*Distance(C, DD) = Distance(B, C)*Distance(A, DD)], [a]);
DD:=eval(DD,%[1]);
X:=[x,y];
DDA:=<op(A-DD)>; DDX:=<op(X-DD)>; BX:=<op(X-B)>; BC:=<op(C-B)>;
AB:=<op(B-A)>; AX:=<op(X-A)>; CDD:=<op(DD-C)>; CX:=<op(X-C)>;
solve({DotProduct(DDA,DDX)/Norm(DDA)/Norm(DDX)=DotProduct(BX,BC)/Norm(BX)/Norm(BC), DotProduct(AB,AX)/Norm(AB)/Norm(AX)=DotProduct(CDD,CX)/Norm(CDD)/Norm(CX)});
X:=eval(X,%[1]);
XA:=<op(A-X)>: XB:=<op(B-X)>: XC:=<op(C-X)>: XDD:=<op(DD-X)>:
is(DotProduct(XA,XB)/Norm(XA)/Norm(XB)=-DotProduct(XC,XDD)/Norm(XC)/Norm(XDD));

A := [0, 0]

 

B := [5, 0]

 

C := [3, 4]

 

DD := [a, 2]

 

[[a = 15-4*sqrt(11)], [a = 15+4*sqrt(11)]]

 

DD := [15-4*sqrt(11), 2]

 

X := [x, y]

 

Vector(2, {(1) = -15+4*sqrt(11), (2) = -2})

 

Vector(2, {(1) = -15+4*sqrt(11)+x, (2) = -2+y})

 

Vector(2, {(1) = -5+x, (2) = y})

 

Vector(2, {(1) = -2, (2) = 4})

 

Vector(2, {(1) = 5, (2) = 0})

 

Vector(2, {(1) = x, (2) = y})

 

Vector(2, {(1) = 12-4*sqrt(11), (2) = -2})

 

Vector[column](%id = 18446745371972441022)

 

{x = -(44/181)*11^(1/2)+511/181, y = 478/181-(112/181)*11^(1/2)}, {x = -(8*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)^2-31*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)+24*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)^2+75*11^(1/2)-131*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)+75)/(-23*11^(1/2)+32*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)-103), y = RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 1)}, {x = -(8*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)^2-31*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)+24*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)^2+75*11^(1/2)-131*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)+75)/(-23*11^(1/2)+32*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)-103), y = RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 2)}, {x = -(8*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)^2-31*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)+24*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)^2+75*11^(1/2)-131*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)+75)/(-23*11^(1/2)+32*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)-103), y = RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 3)}, {x = -(8*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)^2-31*11^(1/2)*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)+24*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)^2+75*11^(1/2)-131*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)+75)/(-23*11^(1/2)+32*RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)-103), y = RootOf(192*_Z^4+(240*11^(1/2)-2208)*_Z^3+(-3440*11^(1/2)+13880)*_Z^2+(10840*11^(1/2)-36535)*_Z-7200*11^(1/2)+28050, index = 4)}, {x = -(8*11^(1/2)*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)^2+230*11^(1/2)*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)-36*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)^2-660*11^(1/2)-850*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)+2415)/(-100*11^(1/2)+37*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)+265), y = RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 3)}, {x = -(8*11^(1/2)*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)^2+230*11^(1/2)*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)-36*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)^2-660*11^(1/2)-850*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)+2415)/(-100*11^(1/2)+37*RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)+265), y = RootOf(5*_Z^4+(-30*11^(1/2)+60)*_Z^3+(206*11^(1/2)-561)*_Z^2+(6420*11^(1/2)-21495)*_Z-24000*11^(1/2)+79750, index = 4)}, {x = RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 3), y = (1/7)*(4*11^(1/2)*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 3)-60*11^(1/2)+41*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 3)+15)/(-2*11^(1/2)+5*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 3)-10)}, {x = RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 4), y = (1/7)*(4*11^(1/2)*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 4)-60*11^(1/2)+41*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 4)+15)/(-2*11^(1/2)+5*RootOf(1225*_Z^4+(4760*11^(1/2)-26915)*_Z^3+(-28062*11^(1/2)+134853)*_Z^2+(47038*11^(1/2)-244772)*_Z-4920*11^(1/2)+108855, index = 4)-10)}

 

[-(44/181)*11^(1/2)+511/181, 478/181-(112/181)*11^(1/2)]

 

true

(1)

 


 

Download Check.mw

f2:=cos(y-Pi/3):
is(expand(f1/f2)=1);

                         true


Formally, the expressions  f1  and  f2  do not coincide for all values x and y. For example we get an undefined expression  0/0  for x=0, y=0 :
 

eval([numer(f1),denom(f1)],[x=0,y=0]);

                         [0, 0]
 

m := n->piecewise(type(n,even),0, 1):
f := proc(a,b)
if type(a*b,integer) then return m(a*b) else FAIL fi;
end:

 
f(a,b);
f(2,3);
f(1,3);
f(a,3);

sin(30*Pi/180);
30^`&deg;`;

                                                 

 

 

                                      

Example:

restart;
CurveFitting:-LeastSquares([[0, 1], [1, 2], [2, 3], [3, 10]], x);
A, B:=coeffs(%);

                               1/5+14*x*(1/5)
                             A, B := -1/5, 14/5

Good question - vote up.

restart;
P:=proc(n::nonnegint) 
local x, x0, v0, q, v:= <<x>>, s:= <<0>>, p:= <<1>>; 
   for x0 to n do v0:=eval(v,x=x0); p:= eval(p.v0,x=x0); s:= eval(s+v0, x=x0) od; 
   p, s; 
end proc:

P(6);

I have never used the command  rtable_eval  and do not know the reasons for this error.  A workaround below:

restart;
P:=proc()
local v;
v:= <x>;  
eval(v, x=1);
end proc():
P();

`&Delta;a`;
                                    

 

 

 

Should be  u*v  instead of  uv .

diff(BesselJ(alpha, sqrt(u^2+v^2-2*u*v*cos(phi))), u);

 

Here are 2 easy ways to do this without a long fraction bar:

restart;
(1/x)*(x^3-2*x^2+5*x-7);  # With long fraction bar
``(1/x)*(x^3-2*x^2+5*x-7);  # The first way
(x)^``(-1)*(x^3-2*x^2+5*x-7);  # The second way

                           

 

Here are all the $ 200 shopping options, sorted by increasing Gb:

sort([seq(seq(seq([s=32*x+64*y+128*z,['x'=x,'y'=y,'z'=z]],z=floor((200-15*x-20*y)/30)),y=0..floor((200-15*x)/20)),x=0..floor(200/15))], key=(p->rhs(p[1]))):
select(p->floor((200-eval(15*x + 20*y + 30*z,p[2]))/15)<1 and floor((200-eval(15*x + 20*y + 30*z,p[2]))/20)<1 and floor((200-eval(15*x + 20*y + 30*z,p[2]))/30)<1, %)[];
nops([%]); # The number of all the possibilities

       [s = 416, [x = 13, y = 0, z = 0]], [s = 448, [x = 10, y = 2, z = 0]], [s = 448, [x = 12, y = 1, z = 0]], [s = 480, [x = 9, y = 3, z = 0]], [s = 480, [x = 11, y = 0, z = 1]], [s = 512, [x = 6, y = 5, z = 0]], [s = 512, [x = 8, y = 2, z = 1]], [s = 512, [x = 8, y = 4, z = 0]], [s = 512, [x = 10, y = 1, z = 1]], [s = 544, [x = 5, y = 6, z = 0]], [s = 544, [x = 7, y = 3, z = 1]], [s = 544, [x = 9, y = 0, z = 2]], [s = 576, [x = 2, y = 8, z = 0]], [s = 576, [x = 4, y = 5, z = 1]], [s = 576, [x = 4, y = 7, z = 0]], [s = 576, [x = 6, y = 2, z = 2]], [s = 576, [x = 6, y = 4, z = 1]], [s = 576, [x = 8, y = 1, z = 2]], [s = 608, [x = 1, y = 9, z = 0]], [s = 608, [x = 3, y = 6, z = 1]], [s = 608, [x = 5, y = 3, z = 2]], [s = 608, [x = 7, y = 0, z = 3]], [s = 640, [x = 0, y = 8, z = 1]], [s = 640, [x = 0, y = 10, z = 0]], [s = 640, [x = 2, y = 5, z = 2]], [s = 640, [x = 2, y = 7, z = 1]], [s = 640, [x = 4, y = 2, z = 3]], [s = 640, [x = 4, y = 4, z = 2]], [s = 640, [x = 6, y = 1, z = 3]], [s = 672, [x = 1, y = 6, z = 2]], [s = 672, [x = 3, y = 3, z = 3]], [s = 672, [x = 5, y = 0, z = 4]], [s = 704, [x = 0, y = 5, z = 3]], [s = 704, [x = 0, y = 7, z = 2]], [s = 704, [x = 2, y = 2, z = 4]], [s = 704, [x = 2, y = 4, z = 3]], [s = 704, [x = 4, y = 1, z = 4]], [s = 736, [x = 1, y = 3, z = 4]], [s = 736, [x = 3, y = 0, z = 5]], [s = 768, [x = 0, y = 2, z = 5]], [s = 768, [x = 0, y = 4, z = 4]], [s = 768, [x = 2, y = 1, z = 5]], [s = 800, [x = 1, y = 0, z = 6]], [s = 832, [x = 0, y = 1, z = 6]]
                                                                            44


We see that  s=832  can only be obtained in one way.

 

Edit.
 

[seq(seq(`if`(5*x + 3*y = 100, [x,y], NULL), x=0..20), y=0..20)];
plots:-pointplot(%);

 

Here are the Euclidean algorithm and the extended Euclidean algorithm.

Euclidean algorithm 

 

GCD:=proc(a,b)
local r, r1, b1;
r:=a-b*iquo(a,b); b1:=b;
while r>0 do
r1:=b1-r*iquo(b1,r); b1:=r; r:=r1;
od;
b1;
end proc:

GCD(2680,3244);  # Example

4

(1)

 

Extended Euclidean algorithm
 

ExtendedEuclid:=proc(a::nonnegint,b::nonnegint)
local d, x, y, x1, y1, x2, y2, a1, b1, q, r;
if a<b then error "Should be a>=b" fi;
if b=0 then d:=a; x:=1; y:=0; return [d,x,y] fi;
x2:=1; x1:=0; y2:=0; y1:=1; a1:=a; b1:=b;
while b1>0 do
q:=floor(a1/b1); r:=a1-q*b1; x:=x2-q*x1; y:=y2-q*y1;
a1:=b1; b1:=r; x2:=x1; x1:=x; y2:=y1; y1:=y;
od;
d:=a1; x:=x2; y:=y2;
[d,x,y];
end proc:

ExtendedEuclid(30,12);  # Example

[6, 1, -2]

(2)

30*1+12*(-2);  # Check

6

(3)

ExtendedEuclid(65208, 18344);  # Your example

[8, 539, -1916]

(4)

65208*539+18344*(-1916);  # Check

8

(5)

 


 

Download Euclid.mw

You can use the commands  plots:-arrow, plots:-display, LinearAlgebra:-CrossProduct  to plot vectors, the results of operations on them, and animations of these. See examples below:


 

restart;
with(plots):
with(LinearAlgebra):

u, v, w:=<1, 2, 3>, <-1, 2, 3>, <-1, 2, -2>:
U:=arrow(u, color=blue):
V:=arrow(u, v, color=blue):
W:=arrow(u+v, w, color=blue):

r1:=u+v+w: r2:=u-v: r3:=CrossProduct(u,v):
R1:=arrow(r1, color=red):
R2:=arrow(v, r2, color=red):
R3:=arrow(CrossProduct(u,v), color=red):
display(U, V, W, R1, scaling=constrained);
V1:=arrow(v, color=blue):
display(U, V1, R2, scaling=constrained);
display(U, V1, R3, scaling=constrained);

 

 

 

display(plot3d([[0,0,0]])$5, display(U)$10, display([U,V])$10, display([U,V,W])$10, display([U,V,W,R1])$10, insequence, scaling=constrained);

 

 


 

Download Plotting_Vectors.mw

Try the  Explore  command for this:


 

restart;
f:=1+B*x-(1/12)*B*x^3+0.1666666667e-4*B^3*x^3-4.166666667*10^(-8)*B^4*x^4+(1/160)*B*x^5+8.333333333*10^(-11)*B^5*x^5-0.5000000000e-2*B^2*x^2+0.1666666667e-4*B*x^3*C^2-4.166666667*10^(-8)*B*x^4*C^3+8.333333333*10^(-11)*B*x^5*C^4-0.5000000000e-2*B*C*x^2+0.3333333333e-4*B^2*x^3*C-1.250000000*10^(-7)*B^3*x^4*C-1.250000000*10^(-7)*B^2*x^4*C^2+3.333333333*10^(-10)*B^4*x^5*C+5.000000000*10^(-10)*B^3*x^5*C^2+3.333333333*10^(-10)*B^2*x^5*C^3+0.7291666667e-3*B*x^4*C-0.3333333333e-5*B*x^5*C^2+0.6250000000e-3*B^2*x^4-0.2083333333e-5*B^3*x^5-0.5416666667e-5*B^2*x^5*C:
Explore(plot(f, x=-4..4, view=-10..10), B=-5...5., C=-5...5.);

 



It can be noted that changing the parameter  C  has very little effect on the graph

 

Download 2param.mw

First 78 79 80 81 82 83 84 Last Page 80 of 290