Kitonum

21435 Reputation

26 Badges

17 years, 26 days

MaplePrimes Activity


These are answers submitted by Kitonum

In Maple a function can be specified as follows:

 f:=x->f(x)

For your example:

f:=x->x^2+2*x:

f(x+1);

(x+1)^2+2*(x+1)

 

The natural domain and the range of the function  x->sqrt(x+1)  of real variable x  can be found as follows:

 

Domain:=solve(x+1>=0);

r:=convert(domain, list);

Range=minimize(sqrt(x+1), x=r[1]..r[2])..maximize(sqrt(x+1), x=r[1]..r[2]);

                                Domain:=RealRange(0, infinity)

                                            r:=[-1, infinity]

                                          Range=0..infinity

 

Thanks Aser. Your code is perfect!

 

Adjustment of Brian Bovril's  code:

 

restart;

with(combinat);

DartSum := proc (Darts, Total)

local L, N, S, x, n;

 L := choose([seq(10, i = 1 .. Darts), seq(20, i = 1 .. Darts), seq(30, i = 1 .. Darts), seq(40, i = 1 .. Darts), seq(50, i = 1 .. Darts)], Darts):

N := nops(L); n:=0;

 for x to N do

 S := add(i, i = L[x]);

if S <> Total

then next

else print(L[x]); n:=n+1;

 end if

 end do;

if n=0 then print("does not exist"); fi; 

 end proc;

The routine:

Darts:=proc(n::integer, L::list, Total::integer)  # n - the number of shots,  L -  the list of the numbers on the target,  Total - total amount of points  

local l, M, S, T, U, c;

l:=nops(L);

M:=[seq(floor(Total/L[i]), i=1..l)];

S:=seq([seq([k,L[i]], k=0..M[i])], i=1..l);

T:=combinat[cartprod]([S]):

U:=[];

while not T[finished] do

c:=T[nextvalue]();

if add(c[i,1], i=1..l)=n and add(c[i,1]*c[i,2], i=1..l)=Total then U:=[op(U), c]; fi;  od;

U; # List of all variants

end proc;

 

Examples:

We will use "a prime" sign instead "a dot" sign. Your second-order equation with the initial conditions  x''+2 x'+3 x=4 t, x(0)=1, x'(0)=2,  can be written as a system of first-order equations  {x'=y, y'=-3 x-2 y+4 t, x(0)=1, y(0)=2} . Then solve this system by  Euler method just as one first-order equation.

1) Find the equation of the tangent line at any point (x0, y0) of the circle.

2) Write down the condition that the tangent line passes through the point (4,1).

3) Solving the resulting system of two equations with two unknowns x0 and y0, find the point of contact, and then the  tangent line. Get two solutions.

Express   z   through  x  and  y , substitute into the formula for  L  and then find the minimum of the resulting function of two variables:

minimize(4*x+2*y+64/x/y, x>0, y>0, location);

           24, {[{x = 2, y = 4}, 24]}

Parametric representation of the surface:

plot3d([r*cos(t), r*sin(t), sqrt(25-r^2)],t=0..2*Pi,r=0..5, scaling=constrained, axes=normal, view=[-7.5..7.5, -7.5..7.5, -1..7.5]);

We have 64 points  with coordinates (x_i, y_j), where  x_i=1..8, y_j=1..8 . The right answer is 16 points (2 points in each row and each column):

4  4  8  8  2  2  6  6

3  3  7  7  1  1  5  5

For brevity,  only the second coordinates are specified. The first column contains  the points for which the first coordinates equal to 1 and so on.

Obviously, if the number of points is greater than 16, at least three points lie in one line.

 This problem was discussed at the Russian site  http://dxdy.ru/topic62965.html

I think the solving this problem in Maple is not easy - it takes too long time.

 

restart;

k:=2: M:=10*exp(-t/5)+3*(1-exp(-t/5)):

dsolve({diff(y(t),t)=k*(1-y(t)/M)*y(t), y(0)=1});

assign(%);

Limit('y(t)', t=infinity)=limit(y(t), t=infinity);

plot(y(t), t=0..20, thickness=2);

Change this line

point(B,rhs(op(1,op(1,sys))),rhs(op(2,op(1,sys))),0):

to the next

point(B,rhs(op(1,op(1,sys))),allvalues(rhs(op(2,op(1,sys))))[1],0):

 

x:=m/n: y:=p/q:

solve((1 + 1/x)*(1 + 1/y)*(1 + 1/z)=2, z);

                   

Of course, should be   m*p-m*q-n*p-n*q<>0 

                  

 

In the last three lines add  simplify  command. You get the angles in radians. Translate to degrees can yourself or by  convert  command.

None computer search in a limited range ensures the final solution, since the  question  remains  open whether any solutions  outside of this range. Therefore it is necessary to prove that there are no solutions outside the range of search.

1) First, we note that if  [x, y, z]  is a list of integer solutions, then any of its permutations is also a solution. We shall therefore consider only integer solutions, that the inequalities x <= y <= z hold true.

2) First we look for solutions, where at least one of the numbers is negative. It is easy to prove that may be only x<0 and at the same time should be y>0 and z>0.

   So, let x<0. Consider the possibilities:

   a) y=1 . We obtain  (1+1/x)*(1+1/z)=1  and  z=-x-1 . Thus, for any  x<=-2,  [x, 1, -x-1]  is a solution.

   b) y=2 .   We obtain  (1+x)*(1+z)=4*x*z/3  and  for negative  x  we have 1 solution  [-9, 2, 2] .

   c) If y>2, it is easy to show that there is no integer solutions for negative x .

3) So, let x>0, y>0, z>0 . We prove that no integer solutions such that  z>20 .

The original equation is reduced to  1/(x*y*z)+1/(x*y)+1/(x*z)+1/(y*z)+1/x+1/y+1/z=1 . Suppose the contrary z> 20 and obtain a contradiction.

Should be x>=2 and y>=2 . Therefore,  1/(x*y*z)+1/(x*z)+1/(y*z)+1/z<=1/80+1/40+1/40+1/20=9/80<1/8 . Therefore,  should be  1/(x*y)+1/x+1/y>=7/8 .

   Consider the possibilities:

   a)  x=2,  y=2 . Then we obtain z=-9. Contradiction.

   b)  x=2,  y=3 - no solutions.

   c)  x=2,  y=4 . Then we obtain z=15. Contradiction.

   d)  x=2,  y>4 . Contradiction with condition  1/(x*y)+1/x+1/y>=7/8 .

   e) x>=3, y>=3 . Contradiction with condition  1/(x*y)+1/x+1/y>=7/8 .

Thus to find all positive integer solutions adequate search in the range from 2 to 20.

L:=[]:

for x from 2 to 20 do

for y from x to 20 do

for z from y to 20 do

if (1+1/x)*(1+1/y)*(1+1/z)=2 then L:=[op(L), [x, y, z]]: fi:

od: od: od:

L;

           [[2, 4, 15], [2, 5, 9], [2, 6, 7], [3, 3, 8], [3, 4, 5]]

 

Final result:

   If inequalities x <= y <= z hold true then

   1) If x<0  then     [-9, 2, 2]  or  [x, 1, -x-1]  where x<=-2

   2) If x>0  then     [2, 4, 15]  or  [2, 5, 9]  or  [2, 6, 7]  or  [3, 3, 8]  or  [3, 4, 5]

       No other integer solutions. 

restart:

a:=3:

eq1:=(a^2+b^2-c^2)/(2*a*b):

eq2:=(b^2+c^2-a^2)/(2*b*c):

eq3:=(c^2+a^2-b^2)/(2*a*c):

solve([eq1=convert(cos(15*Pi/180), radical), eq2=cos(30*Pi/180), eq3=cos(135*Pi/180)], [c,b]);

First 272 273 274 275 276 277 278 Last Page 274 of 289