vv

9379 Reputation

18 Badges

5 years, 268 days

MaplePrimes Activity


These are answers submitted by vv

Maple is not able to recognize a particular 0 expression. This is not uncommon in any CAS. In our case:

ex := -sqrt((-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4) + 4*exp(x/2) - x - 2:

is(simplify(ex)=0) assuming x::real;
        FAIL
simplify(eval(ex, x=2*t)) assuming t::real;  #workaround
        0

I don't think this is a true bug. The designer simply did not anticipate that a user would choose numerical labels. Probably such numerical labels should not be accepted.

You cannot prescribe all three points of tangency, because this implies 6 conditions and the ellipse has only 5 parameters.
But it is possible (in general) to fix two tangency points and the third will be computed.

You must check the definitions when comparing the results from different CAS-es.
Zeta(0, 3, 0.5);
      8.414398322

restart
ode:=diff(y(x),x) = 2*(2*y(x)-x)/(x+y(x)): ic:=y(0)=2:
mu:=DEtools:-intfactor(ode):
sol:=dsolve([mu*ode,ic], [exact], implicit):
simplify(map(exp,sol));

To avoid complex solutions, let's assume x>0,y>0.

1. ode_original can be factored. This will explain the difficulties:

(2*x^(5/2)-3*y(x)^(5/3))  *  (2*(diff(y(x), x))*x-3*y(x))  /  (6*x^(5/2)*y(x)^(5/3)) = 0

The first factor does not depend on y'   and ==>  y = a * x^(3/2) for a = ...  [the singular solution]
The second factor ==> your linear ode ==> y = C x^(3/2), so, it contains the previous singular solution.

2. Now, about the dsolve solution without simplification. All the listed solutions except the last are of the form y = b * x^(3/2) for some b.
The last solution can be written as  z^(-3/2) + z = - C1,  where z = y / x^(3/2).
It rezults that z = C2,  so,  y = C2 * x^(3/2). Hence, it contains indeed the general solution.

 

In packages such as VectorCalculus or DifferentialGeometry  the functions are usually supposed to be "sufficiently smooth".
For a "pathological" function it's better to use the definition.
The directional derivative of F in the direction of the unit vector V is:
Limit((F(X+t*V)-F(X))/t, t=0);
In our case:

F:=(x,y) -> min(abs(x),abs(y)):
(F(0-t/sqrt(2), 0+t/sqrt(2)) - F(0,0))/t;
limit(%, t=0);

        

        undefined

It is a bug. If mysol is given as   lhs-rhs=0  or lhs-rhs, it works.

odetest((lhs-rhs)(mysol) = 0, [ode,ic]);
      [0,0]
 

simpSum:=proc(S::specfunc(Sum))
local o1:=op(1,S), eq:=op(2,S), n,a,b,c;
if not type(eq, name=range) then return S fi;
n:=lhs(eq); a,b:=op(rhs(eq));
c:=max(select(type, [solve(o1,n)], integer));
if c>=a and c <= b then
  sum(o1, n=a..c-1) + Sum(o1, n=c+1..b)
else S fi;
end:

simpSum(Sum(n*x^n, n = 0 .. 20));

           

S:=Sum(n*(n-4)*x^(n^2), n = 0 .. infinity);
simpSum(S);

                     

             

S := Sum(epsilon^k*v(k,t)/k!, k = 0 .. infinity);

                  

S1 := diff(S, epsilon);

                       
 S1ok:=simpSum(S1);                   

                      

limit(%, epsilon=0);

                       

The result is correct. diff(x^n,x)  is 0 for n=0, not for n=1.
diff(Sum(x^n, n = 0 .. infinity), x) is correct too. Note that diff(Sum(f,...), x)  simply applies diff to f.
Of course, it is possible to simplify by eliminating the 0 term, but unfortunately it has to be done by hand (if you want).

S:=diff(Sum(x^n, n = 0 .. infinity),x);
eval(S, 'n = 0 .. infinity' = 'n = 1 .. infinity');

(In this case you may simply use eval(S, 0=1).)

I think that setting interface(typesetting=extended) solves the problem, but I cannot check this in Maple 2015.
But another problem is that the continued fraction appears as 1/( 1/... + 1). To change this, use inert operators g := x -> 1/(1 %+ x)

1 + something   is not  1.  It corresponds to Not(something).

with(GraphTheory):
G := RandomGraphs:-RandomGraph(8, .5):
u:=3;
DrawGraph(G);
add(map2(Degree, G, Neighbors(G,u)));

 

Here is the adaptation of the answer to your previous question. Note that now we must accept numerical solutions.

restart

f:=(exp(x^2)+exp(1))/(exp(x^2)-exp(1))+3;

(exp(x^2)+exp(1))/(exp(x^2)-exp(1))+3

(1)

 

 

b:=0: p:=0: a:=-c:

circ := (x-p)^2+(y-q)^2-r2: F:=unapply(eval(circ, y=f), x):
  

sys:=numer(simplify([F(b),F(c), D(F)(c)])):

fsolve(sys);

{c = -1.722111366, q = 3.005815153, r2 = 4.707895631}

(2)

assign(%);r1:=sqrt(r2);

2.169768566

(3)

plots:-display(
  plot(f, x=-5..5, view=-2..8,color=red, discont),
  plot([p+r1*cos(t), q+r1*sin(t), t=0..2*Pi]), scaling=constrained);

 

 

 

 

restart;

f := arcsin(x)/(1+(-x^2+1)^(1/2));

arcsin(x)/(1+(-x^2+1)^(1/2))

(1)

int(f,x);

Error, (in Utils:-TransformAndApply) numeric exception: division by zero

 

f1:=rationalize(f);

-(-1+(-x^2+1)^(1/2))*arcsin(x)/x^2

(2)

J:=Int(f1,x)

Int(-(-1+(-x^2+1)^(1/2))*arcsin(x)/x^2, x)

(3)

#map(rationalize,J);

F:=value(%);

(1/2)*arcsin(x)^2+(2*I)*arcsin(x)-(-(-x^2+1)^(1/2)+1+I*x)*arcsin(x)/x-2*ln(I*x+(-x^2+1)^(1/2)+1)

(4)

simplify(diff(F,x)-f);

0

(5)

plot(F,x=-1..1);

 

 

IntegrationTools:-Change(J, arcsin(x)=t);

Int(-(-1+(-sin(t)^2+1)^(1/2))*t*cos(t)/sin(t)^2, t)

(6)

simplify(%) assuming t<Pi/2,t>-Pi/2;

Int(t*cos(t)/(cos(t)+1), t)

(7)

value(%);

(1/2)*t^2-t*tan((1/2)*t)+ln(1+tan((1/2)*t)^2)

(8)

F1:=eval(%, t=arcsin(x));

(1/2)*arcsin(x)^2-arcsin(x)*tan((1/2)*arcsin(x))+ln(1+tan((1/2)*arcsin(x))^2)

(9)

simplify(diff(F1,x)-f);

0

(10)

F2:=eval(F1,tan = (u -> sin(2*u)/(1+cos(2*u))));

(1/2)*arcsin(x)^2-arcsin(x)*x/(1+(-x^2+1)^(1/2))+ln(1+x^2/(1+(-x^2+1)^(1/2))^2)

(11)

simplify(diff(F2,x)-f);

0

(12)

 

 

 

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