Kitonum

21133 Reputation

26 Badges

16 years, 213 days

MaplePrimes Activity


These are answers submitted by Kitonum

The problem is solved by direct calculation using the shoelace formula. See  https://en.wikipedia.org/wiki/Shoelace_formula

restart;
local D:
A:=[0,0]: B:=[b,c]: C:=[a+b,c]: D:=[a,0]:
f:=(A,B)->sort(expand((y-A[2])*(B[1]-A[1])-(x-A[1])*(B[2]-A[2]))):
g:=(a,b)->eval([x,y],solve({a, b},{x,y})):
mAB:=(A+B)/2: mBC:=(B+C)/2: mCD:=(C+D)/2: mDA:=(D+A)/2:
A1,A2,B1,B2,C1,C2,D1,D2:=map(t->f(t[]),[[A,mCD],[A,mBC],[B,mDA],[B,mCD],[C,mAB],[C,mDA],[D,mBC],[D,mAB]])[]:
L:=[[A2,B1],[A2,C1],[B2,C1],[B2,D1],[C2,D1],[C2,A1],[D2,A1],[D2,B1]]:
assign(seq(p[i]=g(L[i][]), i=1..8));
p[9]:=p[1]:
S:=expand(1/2*add(p[i][1]*p[i+1][2]-p[i][2]*p[i+1][1], i=1..8)):
is(abs(S)=abs(a*c/6));

 #  true

Explanations of the code:
A, B, C, D are the vertices of an arbitrary parallelogram (a<>0, c<>0); mAB, mBC, mCD, mDA are the midpoints of the corresponding sides, f is the procedure for finding a straight line through 2 points, g is the procedure for finding the intersection point of two straight lines, p[i] (i=1..8) are the vertices of the octagon, S is the area of ​​the octagon. The calculations use only formulas from the Maple core, so they are suitable for any version of Maple (even very old ones).

Visualization - the names of the objects match their names in the code above:

                           

Edited.                       

Octagon.mw

Since all the numbers in the problem are multiples of 5, the idea immediately came to me to work with a regular pentagon (roses - red solid circles and rows - blue segments):

restart;
with(plots): with(plottools):
Line:=(A,B)->sort(expand((y-A[2])*(B[1]-A[1])-(x-A[1])*(B[2]-A[2]))):
assign(seq(A[i]=[cos(Pi/2+2*Pi*(i-1)/5),sin(Pi/2+2*Pi*(i-1)/5)],i=1..5));
B[1]:=eval([x,y],solve({Line(A[3],A[5]),x=0})):
assign(seq(B[i]=[abs(B[1][2])*cos(-Pi/2+2*Pi*(i-1)/5),abs(B[1][2])*sin(-Pi/2+2*Pi*(i-1)/5)],i=2..5)):
E:=(B[3]+B[4])/2:
C:=eval([x,y],solve({Line(B[3],B[5]),Line(B[2],B[4])})):
M:=eval([x,y],solve({Line(B[1],B[4]),Line(B[2],B[5])})):
N:=eval([x,y],solve({Line(B[1],B[3]),Line(B[2],B[5])})):
K:=(M+N)/2:
P1:=pointplot([A[1],E,C,K,B[1]], color=red, symbol=solidcircle, symbolsize=15):
P2:=display(line(A[1],A[3]),line(A[1],B[1]),line(A[1],A[4]),line(B[2],B[5]), color=blue):
display(seq(rotate(P1,2*Pi*k/5),k=1..5),seq(rotate(P2,2*Pi*k/5),k=1..5), axes=none, size=[650,650], scaling=constrained);

                        

Edited.

restart;
M:=<sqrt(5),0>: C:=<2*sqrt(5),0>: MB:=y=2*(x-sqrt(5)):
Circle:=x^2+y^2=(2*sqrt(5))^2:
solve({MB,Circle}):
E:=eval(<x,y>,%[2]):
EM:=M-E: EC:=C-E:
Angle_CEM=arccos(EM.EC/sqrt(EM.EM)/sqrt(EC.EC));

                                           

 

In cases where the  solve command fails, it is useful to first plot the graphs to visually verify the roots. Then we find the roots numerically using the  fsolve  command. Finally, we try to find the roots symbolically using the  identify  command:

 

restart;
Eq:=9*(x^2+2*cos(x))=Pi^2+9;
plot([lhs(Eq),rhs(Eq)], x=0..3, 0..40, color=[red,blue]);
fsolve(Eq, x=0..infinity);
identify(%);

9*x^2+18*cos(x) = Pi^2+9

 

 

1.047197551

 

(1/3)*Pi

(1)

 


 

Download roots.mw

a:=Matrix(2,2,{(1, 1) = <1.0,2.0>, (1, 2) = 3.0, (2, 1) = 4.0, (2, 2) =<5.0,6.0>});
a[1,1][1];
a[2,2][2];

 

We will assume that the parameters are not equal to  0  simultaneously, otherwise we have a trivial case  x=0 . Factoring, we see that for any values ​​of the parameters, the equation has the root  n=1 . The second factor is a third-degree polynomial with respect to n  with the leading coefficient different from 0, so there will be another real root:

restart;

x:=(4*sigma__d^4 + 4*sigma__d^2*sigma__dc^2 + sigma__dc^4)*n^4 + (-4*sigma__d^4 - 2*sigma__d^2*sigma__dc^2)*n^3 + (sigma__d^4 - 4*sigma__d^2*sigma__dc^2 - sigma__dc^4)*n^2 + (-4*sigma__d^4 + 2*sigma__d^2*sigma__dc^2)*n + 3*sigma__d^4;
factor(x);

(4*sigma__d^4+4*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^4+(-4*sigma__d^4-2*sigma__d^2*sigma__dc^2)*n^3+(sigma__d^4-4*sigma__d^2*sigma__dc^2-sigma__dc^4)*n^2+(-4*sigma__d^4+2*sigma__d^2*sigma__dc^2)*n+3*sigma__d^4

 

(n-1)*(4*n^3*sigma__d^4+4*n^3*sigma__d^2*sigma__dc^2+n^3*sigma__dc^4+2*n^2*sigma__d^2*sigma__dc^2+n^2*sigma__dc^4+n*sigma__d^4-2*n*sigma__d^2*sigma__dc^2-3*sigma__d^4)

(1)

P:=op(2,%);

4*n^3*sigma__d^4+4*n^3*sigma__d^2*sigma__dc^2+n^3*sigma__dc^4+2*n^2*sigma__d^2*sigma__dc^2+n^2*sigma__dc^4+n*sigma__d^4-2*n*sigma__d^2*sigma__dc^2-3*sigma__d^4

(2)

collect(P, n);
map(factor,%);

(4*sigma__d^4+4*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^3+(2*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^2+(sigma__d^4-2*sigma__d^2*sigma__dc^2)*n-3*sigma__d^4

 

(2*sigma__d^2+sigma__dc^2)^2*n^3+sigma__dc^2*(2*sigma__d^2+sigma__dc^2)*n^2+sigma__d^2*(sigma__d^2-2*sigma__dc^2)*n-3*sigma__d^4

(3)
 

 

Thus, for any values ​​of the parameters, the equation will have at least   real roots.

Download quartic_equation_in_n_new.mw

Let's consider the vertices of a regular hexagon with a side of 1, the center of which lies at the origin. For definiteness, we will assume that the point in the center is red. Since there are still 6 points left, there are a total of 2^6=64 coloring options (see the figure below). Of these 64 options, only 3 options do not have an equilateral triangle with equally colored vertices. Let's take one of these options (the next figure) and add 3 more points to the right, forming 2 equilateral triangles with a side of 1 with the right red point. If the rightmost point is black, then we immediately get an equilateral triangle with black vertices with a side  sqrt(3). If this point is red, then with any choice of colors for the remaining 2 points we also get an equilateral triangle with vertices of the same color.

restart;
with(plots):
L:=combinat:-permute([red$6, black$6], 6):
P:=seq(pointplot([[0,0],seq([cos(2*Pi*k/6),sin(2*Pi*k/6)], k=0..5)], color=[red,p[]],symbol=solidcircle, symbolsize=40, scaling=constrained, axes=none, size=[100,100]), p=L):
display(Matrix(8,8,[P]));
pointplot([[0,0],seq([cos(2*Pi*k/6),sin(2*Pi*k/6)], k=0..5),[3/2,sqrt(3)/2],[2,0],[3/2,-sqrt(3)/2]], color=[red,L[28][],"LightGrey","LightGrey","LightGrey"], scaling=constrained,symbol=solidcircle, symbolsize=20, size=[600,600]);

      

Edit. You can get by with just one additional point above the top side of the hexagon, as  @Alfred_F  already wrote about. Regardless of the choice of its color, we get an equilateral triangle with vertices of the same color:

 

 

Look at the following 2 examples:

cat(alpha,beta); # not OK
`&alpha;&beta;`; # OK
cat(d,alpha); # not OK
`d&alpha;`; # OK

                              

For your example

`#3  Q24` (`&alpha;`);

                         

restart;
Proc := proc(m)
local xA, yA, xB, yB, xC, yC, xJ, yJ, tx, Oo, c1, r, eqBJ, eq1, sol, O;
uses plots, geometry;
_EnvHorizontalName := 'x'; _EnvVerticalName := 'y';
xJ := 5; yJ := 1; point(A, 2, 4); point(J, xJ, yJ); point(Oo, 0, 0);
r := 3; circle(c1,[Oo, r]);
eqBJ := y = m*(x - xJ) + yJ; line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y}, explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y);
point(B, xB, yB); xC := subs(sol[2], x); yC := subs(sol[2], y);
point(C, xC, yC); circle(c2, [A, B, C],centername=O); line(AB, [A, B]); line(AC, [A, C]); line(BC, [B, C]);
eqBJ := y = m*(x - xJ) + yJ; line(BJ, eqBJ, [x, y]);
eq1 := x^2 + y^2 = r^2; sol := solve({eqBJ, eq1}, {x, y},explicit);
xB := subs(sol[1], x); yB := subs(sol[1], y); point(B, xB, yB);
xC := subs(sol[2], x); yC := subs(sol[2], y); point(C, xC, yC);
line(AB, [A, B]); line(AC, [A, C]);
draw([BC(color = black), c2(color = magenta), A(color = blue, symbol = solidcircle, symbolsize = 16),
B(color = red, symbol = solidcircle, symbolsize = 16), C(color = red, symbol = solidcircle, symbolsize = 16),
J(color = red, symbol = solidcircle, symbolsize = 16),c1(color=blue)],axes = normal, printtext = true);
end proc:
plots:-animate(Proc,[m],m=-0.3..1, frames=50);  # Animation

plots:-display(Proc(-0.3),Proc(0),Proc(1)); # 3 circles

It is clearly seen that these circles have only one common point  A .

Proc.mw

The formula  cos(theta) = sqrt(1 - sin(theta)^2)   is incorrect because the cosine can be negative, but the root on the right is always non-negative. The right  substitution  is  cos(theta) = sin(theta + Pi/2)  or  cos(theta) = sin(Pi/2  -  theta ) .

restart;
eqs:=[a=b,c=d,e=f]:
map(`+`, eqs, 2);
map(`-`, eqs, 2);
map(`/`, eqs, 2);
map(t->t*~2, eqs);
map(t->t^2, eqs);

                       

I think it is a purely visual effect, because your function near  x=0  takes very small values. In fact, this function does not have a singularity at  x=0 , it is simply not defined at  0, since 0 appears in the denominator. But if you define it at x=0  by  f(0)=0 , then it will not only be continuous but also differentiable at zero. Its derivative at zero is  , that is, the graph touches the Ox axis. If you want to visually verify that the function is not equal to 0 near  x=0 , you can reduce the range along the vertical axis:

restart;
f:=x->piecewise(x=0, 0, sin(x)*sqrt(1 - (sin(x)/x)^2)):
f(0.1);
simplify(D(f)(x)); # Derivative of the function f 
plot(sin(x)*sqrt(1 - (sin(x)/x)^2), x = 0 .. Pi/4, y=0..0.01);

                

The  parametric=full  option does not work here because Maple 2018.2 does not support solving equations (inequalities) of this type. But a direct solution using  assumptions on the sign of  n  leads to success:

restart;
f := (x, n) -> 2^n/(1 + n*2^n*x^2) - 2*x^2*(2^n)^2*n/(1 + n*2^n*x^2)^2;
solve(f(x,n)>0, x, parametric=full) assuming n::integer;
Eq:=simplify(f(x,n));
solve(Eq>0, x) assuming  n>0;
solve(Eq>0, x) assuming  n=0;
solve(Eq>0, x) assuming  n<0;

               


Of course, this inequality can be easily solved manually, since it comes down to solving a quadratic inequality.

The minimum natural number that has the specified property is 911.
Here are some thoughts to explain the code below.
Let n=n1+n2+n3+n4+n5+n6  (the summands are in ascending order). So we have
n-n1=m1^2
n-n2=m2^2
n-n3=m3^2
n-n4=m4^2
n-n5=m5^2
n-n6=m6^2
Adding these 6 equalities we get  5*n = m1^2 + m2^2+ ... + m6^2 or
n=(m1^2 + m2^2+ ... + m6^2) /5

So we have to find 6 different squares with a minimum sum that is divisible by 5  and
(m1^2 + m2^2+ ... + m6^2) /5 > m1^2
Having tried all possible 6 of the first 30 squares, we come to a single answer:

restart;
L:=combinat:-choose([seq(i^2, i=1..30)],6):
L1:=select(t->irem(add(t),5)=0, L):
L2:=select(t->add(t)/5>t[6], L1);
L3:=[seq(add(L2[])/5-L2[][i], i=6..1,-1)];
n=add(L3);

                     

 

It seems you made a typo in the expression  P(u,v) . Direct calculation shows that  P(u0,v0)<>0 . But if we replace the free term in the expression  -1  by  3  then everything is OK:

restart;
P:=(u,v)->-u^4+88*u^3*v-146*u^2*v^2+88*u*v^3-v^4+2*u^2+40*u*v+2*v^2+3;
u0 := sqrt(2)/6: v0 := -sqrt(2)/6:
P(u0,v0);
implicitdiff(P(u,v), v, u);
eval(%, [u=u0,v=v0]);
implicitdiff(P(u,v), v, u, u);
eval(%, [u=u0,v=v0]);

                

 

 

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