vv

14202 Reputation

20 Badges

10 years, 336 days

MaplePrimes Activity


These are answers submitted by vv

For f := arctan(sin(x)^3),  int(f,x = 0..Pi/2),  Newton-Leibniz gives a complex number (using the antiderivative).
This is known and docomented. F = int(f, x)  is not necessarily continuous; there could appear even distinct complex constants in consecutive intervals.
So, for a correct F, we have to adjust  the constants.
Here is how.

restart; 
F := Re(int(arctan(sin(x)^3), x)) assuming 0<x,x<Pi/2; 
plot(F,x=0..Pi/2); # F is discontinuou at x=Pi/4 
                   # we could use discont(F,x)
a,b := simplify~([limit(F, x=Pi/4, left), limit(F, x=Pi/4, right)])[];
Fcont:=piecewise(x<Pi/4, F, F+a-b); 
# Fcont is the desired continuous antiderivative

plot(Fcont, x=0..Pi/2); # check visually the continuity

evalf(eval(Fcont,x=Pi/2)-eval(Fcont,x=0));
# 0.5716654497

Remark. int(f, x = 0 .. X) should be able to produce a continuous antiderivative, but it returns unevaluated (i.e. fails).
 

The fixed points are not needed/accepted; they are "deduced".
So, just use:

p := Perm([[1,4,7],[2,8,5]])

                       p := (1 4 7)(2 8 5)

Also:

convert(p, 'permlist'); 
convert(p, 'permlist', 10);

        [4, 8, 3, 7, 2, 6, 1, 5]
        [4, 8, 3, 7, 2, 6, 1, 5, 9, 10]

convert([4, 8, 3, 7, 2, 6, 1, 5], Perm)

        (1 4 7)(2 8 5)

restart;
Digits:=15:
f:=(2*x^2+1)/(x^4+6*x^2*y^2+y^4+1)-(y^2+1)/(x^4+y^4+2):
g:=simplify(eval(f, [x=R*cos(t), y=R*sin(t)])*R) assuming R>0: # polar coords
h:=simplify(int(g, t=-Pi..Pi)) assuming R>0 :
ans := evalf(Int(h, R=0..infinity)); # this is the desired limit
identify(ans); # added

        ans := 1.53978589107117
        

It is possible to use Green's formula via e.g.:

pdsolve({diff(Q(x,y),x) = op(2,f), -diff(P(x,y),y) = op(1,f)});

but P,Q are too complicated; maybe with some other decomposition ...

Note that the limit is finite as the asymptotics for h shows:

expand(simplify(asympt(h, R, 6))) assuming R>0

                                 

The series is indeed divergent. BesselK(n,r) has the asymptotic expansion (for r=constant):
BesselK(n,r) ~ 2^(n-1)*(n-1)! / r^n
(not used by Maple).

The summation used by Maple is via Levin transform (see ?Numerical Summation); it is more adapted for numeric computations than Borel summation.

P.S. To upload a worksheet, use the green up-arrow in the toolbar.

restart:
with(DocumentTools:-Layout): with(DocumentTools:-Components):
N:=20: L:=[]:
update := proc(comp)
   local cx, cy;
   global L;  # L = [[x1,y1],...] will contain the clicks
   (cx, cy) := round(DocumentTools:-Do(comp(clickx))), round(DocumentTools:-Do(comp(clicky)));
   if type(L, listlist) then L := [L[], [cx, cy]] else L := [[cx, cy]] end if;
   DocumentTools:-Do(comp = plots:-display(
      plot(L, style = point, symbol = solidcircle, symbolsize = 15, color = blue, axes = normal),
      plot(L), gridlines, view = [0 .. N, 0 .. N]));
end proc:
P := Plot(plot([[0, 0]], color = white, axes = normal, view = [0 .. N, 0 .. N]),
          identity = "Plot0", clickdefault, clickaction = "update(%Plot0);"):
xmlapp := Worksheet(Group(Input(Textfield(P)))):
DocumentTools:-InsertContent(xmlapp):

L;
[[2, 4], [1, 8], [6, 12], [3, 14], [3, 18], [11, 15], [9, 18], [14, 17], [14, 10], [18, 12], [18, 8], [17, 5], [13, 3], [10, 1], [6, 7], [2, 4]]

 

The result (after dividing with a*b) is Pi, so, a constant!

This is easy when C is a circle, using the Stewart theorem in elementary geometry.
In the general case, this can be obtained from the theory of convex bodies, support functions. Of course the computations could be assisted by Maple but I don't think it's an interesting approach.

    Note first that if the triangle SBC is not supposed to be isosceles and BC is not parallel to the plane π then the minimum is 0, S being the intersection between BC and the plane π (so SBC is of course degenerated).
    
    If the triangle is isosceles (SB=SC) and BC is not perpendicular to the plane π, then S must belong to the mediator plane π′ of the segment BC (i.e. the plane perpendicular on BC through the midpoint M of the segment BC).
    So, S∈π∩π′. For a minimal area, S must be the projection of the point M onto the straight line π∩π′.

(For a Maple solution one has to find the equation of π∩π′ and minimize the quadratic expression MS^2 for S∈π∩π′).

A1 := 
plot([L12, L22], Ce = 0 .. 0.8, 
color = ["Red", "Blue"], 
linestyle = [solid, longdash], 
labels = [C__e, pi__r], labeldirections = ["horizontal", "vertical"], 
legend = ['one'=0.11, 'two'=0.12], legendstyle=['location=right'], 
axis[2] = [color = "#600000"]);

Similar for A2, A3.

F:=x-> (x^4+3*x^3-3*x^2-2*x-24)/(x^4-4*x^3-13*x^2+62*x-56);
u:=x->piecewise(x=-4, limit(F(x_), x_=x), true, F(x));   # or x_=-4
u(-4);

The solution has not an unexpected behavior.

The rhs of the ode is obviously C^1, so locally Lipschitz, so the solution exists and is unique in a nbd of IC.
The solution found by dsolve is valid in  `#mrow(mi("a"),mo("&comma;"),mo("&infin;"))`

where a=-1.3...   (see below).

 

A sufficient condition for F(x,y)  to be Lipschitz wrt  y near (x0,y0)  is that D[2](F) be without singularities near (x0,y0).   

 

F := (x,y) -> x^2 - y^2;
ode := diff(y(x), x) = x^2 - y(x)^2:
IC := y(0) = 1:
sol := dsolve([ode, IC]);

F := proc (x, y) options operator, arrow; x^2-y^2 end proc

 

y(x) = piecewise(x < 0, x*((1/2)*BesselI(-3/4, (1/2)*x^2)*Pi*(GAMMA(3/4)^2*2^(1/2)-Pi)/GAMMA(3/4)^2-BesselK(3/4, (1/2)*x^2))/((1/2)*Pi*(GAMMA(3/4)^2*2^(1/2)-Pi)*BesselI(1/4, (1/2)*x^2)/GAMMA(3/4)^2+BesselK(1/4, (1/2)*x^2)), x = 0, 1, 0 < x, x*((1/2)*BesselI(-3/4, (1/2)*x^2)*Pi*(GAMMA(3/4)^2*2^(1/2)+Pi)/GAMMA(3/4)^2-BesselK(3/4, (1/2)*x^2))/((1/2)*Pi*(GAMMA(3/4)^2*2^(1/2)+Pi)*BesselI(1/4, (1/2)*x^2)/GAMMA(3/4)^2+BesselK(1/4, (1/2)*x^2)))

(1)

Y1:=rhs(sol) assuming x<0: Y2:=rhs(sol) assuming x>0:

plot([Y1, Y2], x=-3..3);

 

plot(rhs(sol), x=-3..3, discont=[usefdiscont], title=`ode solution` );

 

fdiscont(Y1, x=-2..-1);

[HFloat(-1.0378337700000781) .. HFloat(-1.0368198762094487)]

(2)

discont(D[2](F)(x,y), x), discont(D[2](F)(x,y), y);

{}, {}

(3)

limit(D[2](F)(x,y), [x=0,y=1]);

-2

(4)


Download LipODE-vv.mw

Such triangles exist even in the plane. (AE is the angle bisector in  ΔABC.)

restart;

IntegerTriangle := proc(iter)
local p,q,r,s, A:=[0,0], B,C,E,AB,AC,BC,AE,  den,
      nor:=V -> sqrt(V[1]^2+V[2]^2):
for p to iter do
for q to p-1  do   if igcd(p,q)>1 or irem(p,2)=irem(q,2) then next fi;
for r from p to iter do
for s to r-1  do   if igcd(r,s)>1 or irem(p,2)=irem(q,2) then next fi;
  B:=[p^2-q^2, 2*p*q]: AB:=p^2+q^2:
  C:=[r^2-s^2, 2*r*s]: AC:=r^2+s^2:
  BC:=nor(B-C):
  if not type(BC, rational) then next fi:
  E:=(AC*~B+AB*~C)/~(AC+AB):
  AE:=nor(E):
  if not type(AE, rational) then next fi:
  if (AB=AC)or(AB=BC)or(AC=BC) then next fi:
  if (AB+AC+BC)<=2*max(AB,AC,BC) then next fi:
  if (AB^2=AC^2+BC^2)or(AC^2=AB^2+BC^2)or(BC^2=AB^2+AC^2) then next fi:
  den:=ilcm(denom~([E[],AE])[]): B:=B*den: C:=C*den: E:=E*den;
  print(ABCE=[A,B,C,E]);
od od od od:
print("OK")
end proc:
IntegerTriangle(100);

 ABCE = [[0, 0], [4797, 1804], [4797, 280604], [4797, 6804]]
 ABCE = [[0, 0], [697, 14280], [18377, 14280], [7425, 14280]]
ABCE = [[0, 0], [1989, 116348], [55029, 45628], [34845, 72540]]
ABCE = [[0, 0], [7605, 444860], [226395, 153140], [143136, 264152] ]
"OK"

 

restart;
eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:
Student[Precalculus][CompleteSquare](eq);

                            (z-3)^2 + (y+4)^2 + (x-1)^2 - 56  =  0

You must unevaluate the argument of latex using right single quotes 'expr'.

latex('diff(phi(t), t) = (`&Dscr;`[1, 4](phi(t)) + `&Dscr;`[4, 1](phi(t)))*diff(phi(t), t, x) + (`&Dscr;`[2, 4](phi(t)) + `&Dscr;`[4, 2](phi(t)))*diff(phi(t), t, y) + (`&Dscr;`[3, 4](phi(t)) + `&Dscr;`[4, 3](phi(t)))*diff(phi(t), t, z) + (`&Dscr;`[1, 2](phi(t)) + `&Dscr;`[2, 1](phi(t)))*diff(phi(t), x, y) + (`&Dscr;`[1, 3](phi(t)) + `&Dscr;`[3, 1](phi(t)))*diff(phi(t), x, z) + (`&Dscr;`[2, 3](phi(t)) + `&Dscr;`[3, 2](phi(t)))*diff(phi(t), y, z) + `&Dscr;`[4, 4](phi(t))*diff(phi(t), t, t) + `&Dscr;`[1, 1](phi(t))*diff(phi(t), x, x) + `&Dscr;`[2, 2](phi(t))*diff(phi(t), y, y) + `&Dscr;`[3, 3](phi(t))*diff(phi(t), z, z) + (diff(phi(t), t) + diff(phi(t), x) + diff(phi(t), y) + diff(phi(t), z))*(D(`&Dscr;`[1, j])(phi(t))*diff(phi(t), x) + D(`&Dscr;`[2, j])(phi(t))*diff(phi(t), y) + D(`&Dscr;`[3, j])(phi(t))*diff(phi(t), z) + D(`&Dscr;`[4, j])(phi(t))*diff(phi(t), t))');

Otherwise your expression is evaluated, and for example diff(phi(t), t, x) evaluates to 0.

A way to obtain the plot file is the following:

In the worksheet "f.mw" subject to RunWorksheet, don't use plotsetup but use:

...
p := plot(...):
...
return p;

(so, return the PLOT structure).
In the calling worksheet use:

ret := DocumentTools :-RunWorksheet("f.mw"):
plottools:-exportplot( "d:/temp/myplot.png", ret);
1 2 3 4 5 6 7 Last Page 1 of 122