Kitonum

21530 Reputation

26 Badges

17 years, 84 days

MaplePrimes Activity


These are answers submitted by Kitonum

Solution of the equation:

solve({2*sin(2*((1/180)*x*Pi)) = 1, x >= 0, x <= 360}, AllSolutions, Explicit);

                                  {x = 15}, {x = 195}, {x = 75}, {x = 255}

 

Plotting of graphs  y=2*sin(2*x)  and  y=1 :

plot([2*sin(2*((1/180)*x*Pi)), 1, [15, t, t = 0 .. 1], [75, t, t = 0 .. 1], [195, t, t = 0 .. 1], [255, t, t = 0 .. 1]], x = 0 .. 360, color = [red, blue, black $ 4], thickness = [2, 2, 1 $ 4], linestyle = [1, 1, 3 $ 4], tickmarks = [[15 = "15", 75 = "75", 195 = "195", 255 = "255"], default]);

 

 

Of course,  n = 11  is also the answer  because  the original problem statement does not say that the maximum should be unique.

Carl's solution has 2 disadvantages:
1) Unimodality of the function  C(n,k)  is not proven.
2) The Carl's method does not work for  large  k ,  for example for  k = 50  we have:

C:= (n,k)-> binomial(n,k)*2^k:

fsolve({eval(diff(C(n,k),k), k=50)}, n= 50..infinity);

       fsolve({1125899906842624*(-Psi(51)+Psi(n-49))*binomial(n,50)+1125899906842624*binomial(n,50)*

               ln(2)},n,50 .. infinity)

 

I propose a simple solution that is different from all previous decisions and makes it easy to solve the problem for any . We consider only integers  n>0  and  0<=k<=n . First we prove that the numbers  C(n,k) (in Carl's notation)  behave similarly binomial coefficients and for each fixed n we find the value  k  for which the function  C(n,k)  reaches its maximum value.

Consider the quotient  C(n,k+1) / C(n,k) . It is easy to check that it is equal to  2*(n-k)/(k+1) . Comparing this number with 1, it is easy to make the following conclusions:

1) If  k=(2*n-1)/3  is integer then  C(n,k)  has 2 maximums at  k  and  k+1

2) If  k=(2*n-1)/3  is fraction  then  C(n,k)  has 1 maximum at  k=ceil( (2*n-1)/3)

From above it follows easily that the required numbers  n  for a given  k  are the integer solutions of the system

{(2*n-1)/3>=k-1, (2*n-1)/3<=k}

 

Two examples:

isolve({(2*n-1)/3>=7, (2*n-1)/3<=8});  # Solution of original problem

isolve({(2*n-1)/3>=49, (2*n-1)/3<=50});

                              {n = 11}, {n = 12}

                              {n = 74}, {n = 75}

 

 

 

q:=T-> sin(T)*_C2+cos(T)*_C1-(1/3000)*Pi*(4012562293500*Pi^3*cos(T)^3-32100498340000*Pi^3*cos(T)^2-3009421720125*Pi^3*cos(T)+16050249170000*Pi^3+435778855000*Pi*cos(T)^2-217889427500*Pi-3539762622):

solve({q(0)=0, D(q)(0)=0});

 

 

In Maple function definition is not provided as a subset of the Cartesian product with special properties. This can be done with a simple procedure.

Definition of a function  if  it is specified as a set of ordered pairs:

f:=proc(x)

local i;

for i in S do

if i[1]=x then return i[2]  fi;

od;

end proc:

 

Your example:

S:={[1,2], [2,a], [3,b]}:

f(1); f(2); f(3);

         2

         a

         b

 

 

 

Finding a monomial with the maximum coefficient:

restart:

expand((1+2*x)^12,x);

L:=convert(PolynomialTools[CoefficientVector](%,x), list); # full list of coefficients

M:=max(L);

op(map(t->t-1, [ListTools[SearchAll](M, L)])); 

 

Edited: solution of the problem:

K:=[]:

for n from 1 do

expand((1+2*x)^n,x);

L:=convert(PolynomialTools[CoefficientVector](%,x), list); 

M:=max(L);

S:=map(t->t-1, [ListTools[SearchAll](M, L)]);

if 8 in S then K:=[op(K),n] fi;

if nops(K)=2 then break fi;

od:

K;

                               [11, 12]

convert((x^2+5*x+9)/(x+2), parfrac);

 

x+3  is  the quotient and  3  (in the numerator)  is the remainder. 

 

restart;

a:=-7:  b:=2:  c:=9:

solve(a*x^2+b*x+c=0, x);

                         -1,  9/7

 

Another way (without assignment):

restart;

simplify({eval(solve(a*x^2+b*x+c = 0, x), {a = -7, b = 2, c = 9})});

                        {-1,  9/7}

! have not any problems with your expression:

expr := a*ln(u) + b*ln(u) + a*ln(v)+b*ln(v);

collect(expr, [ln(u), ln(v)]);

                  expr := a*ln(u)+b*ln(u)+a*ln(v)+b*ln(v)


                               (a+b)*ln(u)+(a+b)*ln(v)

c := a+I*b;

 ``(Re(c^2))+I*``(Im(c^2))  assuming a::realcons, b::realcons;

 

1)  Maple does not know that you assume that  a  and  b  are real numbers.

2)  Construction  ``(...)  prevents the disclosure of the parentheses.

 

poly := x^2*y+x*y*z+x*z;

poly1:=0:

for i in [op(poly)] do

if degree(i, x)=2 then poly1:=poly1+subs(x=a+b, i) else

if degree(i, x)=1 then poly1:=poly1+subs(x=c+d, i) else

poly1:=poly1+i; fi; fi;

od:

poly1;

 

 Another way:

poly := x^2*y+x*y*z+x*z;

map(t->`if`(degree(t, x)=2,subs(x=a+b,t), `if`(degree(t, x)=1,subs(x=c+d,t), t)), poly);

 

 

The following code simulates the manual solution:

Eq:=sin(x*y(x)) = x + y(x):

diff(Eq, x);

subs(y(x)=y, solve(%, diff(y(x), x)));

 

 

subs(W[0]=Re*V[0], V[0]/W[0] * diff(u(t),t));

 

Re  is an unfortunate designation because in Maple  Re  means the real part of a complex number.

You can use the construction  ``(...)  to prevent the automatic disclosure of parentheses:

A:=simplify( (a1/2+a2/2)*ln(a1/2+a2/2+sqrt((a1/2+a2/2)^2+(b1/2-b2/2)^2)+d^2)+(a1/2-a2/2)*ln(a1/2-a2/2+sqrt((a1/2-a2/2)^2+(b1/2-b2/2)^2+d^2)), {a1-a2=deltaa,a1+a2=sigmaa}):

a:=-2*b1*b2+b2^2+b1^2;  ``(factor(a));

algsubs(a=%, A);

 

 

Different way - to convert the exponent into the symbol:

A:=simplify( (a1/2+a2/2)*ln(a1/2+a2/2+sqrt((a1/2+a2/2)^2+(b1/2-b2/2)^2)+d^2)+(a1/2-a2/2)*ln(a1/2-a2/2+sqrt((a1/2-a2/2)^2+(b1/2-b2/2)^2+d^2)), {a1-a2=deltaa,a1+a2=sigmaa}):

a:=-2*b1*b2+b2^2+b1^2; subs(2=`2`, factor(a));

algsubs(a=%, A);

 

simplify( (a1/2+a2/2)*ln(a1/2+a2/2+sqrt((a1/2+a2/2)^2+(b1/2-b2/2)^2+d^2))+(a1/2-

a2/2)*ln(a1/2-a2/2+sqrt((a1/2-a2/2)^2+(b1/2-b2/2)^2+d^2)), {a1-a2=deltaa, a1+a2=sigmaa});

 

 

The parts of the cube below and above the surface  z=x^2*y:

plot3d(x^2*y , x=0..1, y = 0 .. 1, filled, color=grey, scaling=constrained, axes=normal, orientation=[25,60], lightmodel=light4);

plottools[translate](plot3d(x^2*y-1 , x=0..1, y = 0 .. 1, filled, color=grey, scaling=constrained, axes=normal, orientation=[25,60], lightmodel=light4), 0, 0, 1);

 

 

 

First 239 240 241 242 243 244 245 Last Page 241 of 290