vv

12453 Reputation

19 Badges

9 years, 278 days

MaplePrimes Activity


These are answers submitted by vv

It's obvious that the smartview option cannot guess all user's intentions.
If you don't know the relevant y-domain (used by view=...) you may try a slope criterion. E.g.

restart;
f:=exp(-3^(1/2)*(cos(x)-1)/sin(x)):
f1:= diff(f, x):
maxslope:=100:
ff:=piecewise(abs(f1) < maxslope, f, undefined):
plot(ff, x=0..2*Pi);

Maple can compute the integral directly as a hypergeom function.
So, this is for didactic purposes only.

 

 

restart;

with(IntegrationTools):

J(n)=Int(1/(x^2+1)^n, x):

Parts(%, 1/(x^2+1)^n):

eval(%, x^2=q(x)-1):

simplify(Expand(%)) assuming n::integer:

eval(%, [ Int(q(x)^(-n), x)=J(n), Int(q(x)^(-n-1), x)=J(n+1) ]):

solve(%, J(n+1)): J(n+1) = simplify(eval(%, q(x)=x^2+1)); # the recurrence relation

J(n+1) = (1/2)*(x*(x^2+1)^(-n)+J(n)*(2*n-1))/n

(1)

R:=unapply(rsolve({%, J(1)=arctan(x)}, J(n)), n);

proc (n) options operator, arrow; (1/2)*GAMMA(n-1/2)*(Sum(x*Pi^(1/2)*GAMMA(n1+1)/(n1*(x^2+1)^n1*GAMMA(n1+1/2)), n1 = 1 .. n-1)+2*arctan(x))/(Pi^(1/2)*GAMMA(n)) end proc

(2)

value(R(6));

(63/256)*x/(x^2+1)+(21/128)*x/(x^2+1)^2+(21/160)*x/(x^2+1)^3+(9/80)*x/(x^2+1)^4+(1/10)*x/(x^2+1)^5+(63/256)*arctan(x)

(3)

simplify(diff(%,x)); #check

1/(x^2+1)^6

(4)

 

restart;
Digits := 15: 
nu_0 := sqrt(k^2 - k_0^2): nu_m := sqrt(k^2 - k_m^2): 
pref2 := 2*rho_me*exp(-nu_0*(zs + z))*BesselJ(0, k*sqrt((xs - x)^2 + (ys - y)^2))*k/(rho_me*nu_0 + rho_0*nu_m*tanh(nu_m*d)):

f:= (eval(0.5*(((eval(pref2, [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I])))), [z = 0, k_0 = 0.018371886863098, xs = 0, ys = 0, zs = 10, rho_0 = 1.2, d = 0.04, rho_me = 1.528516816439260 - 1235.297048886680*I, k_m = 0.490806242885258 - 0.490314205803914*I]) ):

dom := [k=0..100, x = -2/2 .. 2/2, y = -3/2 .. 3/2]:  # 100 is enough
evalf(Int(f, dom, digits=10));

                               0.5867621705 - 0.1097638086*I

The answer is correct, a being a name and non-constant.
eval(diff(y(x,t), x$3), x=Pi);  and  eval(diff(y(x,t), x$3), x=a+1);

will look as you expect.

You may declare a as a constant. In this case the result will appear as for Pi:
constants := constants, a;
eval(diff(y(x,t), x$3), x=a)
;
            

restart;
N:=100:  dx:=evalf(2*Pi/N):
X:=<seq(k*dx, k=-N/2..N/2)>:
Y:= sin~(X):
f:=unapply(CurveFitting:-Spline(X, Y, x, degree=1),x):
Z:= [seq( evalf(Int(f, X[1]..x, epsilon=1e-5)), x=X)]:
plots:-display(plot(X,Y),  plot(X,Z), color=[red,blue]); 

Use the definition:

P := (x-6)^2 + (y+3)^2 = (x+2*y-1)^2 / 5;

with(plots): display(implicitplot([P, x+2*y-1], x=-10..10,y=-10..10), pointplot([6,-3], color=red));

The singularities of F1 are on the Jordan curve

plots:-implicitplot(1/F1, x=0..k - varepsilon,y=0..2*Pi, view=0..6.5, color=red);

Note that the integrand is even in x, so, one may integrate over x = 0 ... 1 - eps.

Unfortunately Maple cannot compute numerically a CPV integral, but it is easy to transform it into a regular one. If the singular point is c, then 

Int(f(x), x =c-r .. c+r, CPV) = Int(f(c+t) + f(c-t), t = 0 .. r)

Strange implementation (bug?) for numboccur.

restart;
L:=[1., HFloat(1.), 1., 0., 0.];
#                   L := [1., 1., 1., 0., 0.]

numboccur(L, 1.);
#                               2

numboccur(L, 1.0);
#                               0

numboccur(L, HFloat(1.0));
#                               1

evalb(L[1]=L[2]);
#                              true

select(`=`, L, 1.); select(`=`, L, 1.0);
#                          [1., 1., 1.]

#                          [1., 1., 1.]

dismantle(%);

#LIST(2)
#   EXPSEQ(4)
#      FLOAT(3): 1.
#         INTPOS(2): 1
#         INTPOS(2): 0
#      HFLOAT(2): 1.
#      FLOAT(3): 1.
#         INTPOS(2): 1
#         INTPOS(2): 0

 

                      

arctand ignores the second argument.

arctand(y,x) simplifies to arctand(y)

BTW, for y <> 0,

arctan(y,x) = (Pi/2)*signum(y)-arctan(x/y)

The fact that leadterm is not documented under asympt is probably because asympt(f, x, n) is actually equivalent to series(f, x=infinity, n), and here leadterm appears. By taking n=2, leadterm is not strictly necessary, but it is convenient because O(...) is removed.

There is an old worksheet at the Application Center https://www.maplesoft.com/applications/view.aspx?SID=6322

It is clear enough and includes an animation.


 

The Maple answer is correct for your question. It gives the two intervals on which the derivative is negative.
If you are interested in the (relative) extrema, use exprema.
Of course x=0 is not an extreme point.

A := x^2 + 400/x;

x^2+400/x

(1)

plot(A, x=-10..10, view=-500..500);

 

solve(evalf(diff(A, x) < 0));lprint([%]);

RealRange(-infinity, Open(0.)), RealRange(Open(0.), Open(5.848035476))

 

[RealRange(-infinity, Open(0.)), RealRange(Open(0.), Open(5.848035476))]

 

solve(diff(A, x) < 0);lprint(%);  # it is better not to approximate A

RealRange(-infinity, Open(0)), RealRange(Open(0), Open(2*5^(2/3)))

 

RealRange(-infinity, Open(0)), RealRange(Open(0), Open(2*5^(2/3)))

 

extrema(A, {}, x, 'S'); evalf(%);S=evalf(S);

{60*5^(1/3)}

 

{102.5985568}

 

{{x = 2*5^(2/3)}} = {{x = 5.848035476}}

(2)

 

Download extrema.mw

restart;
eq1:= f(x) + 2*f(1/x) + 3*f(x/(x-1)) = x:
eq:=eq1, simplify(eval(eq1, x=1/x)):
eq:=eq, simplify(eval(eq1, x=x/(x-1))):
eq:=eq, simplify(eval(eq1, x=-1/(x-1))):
eq:=eq, simplify(eval(eq1, x=1-x)):
eq:=eq, simplify(eval(eq1, x=(x-1)/x)):
solve([eq], indets([eq],function)): f(x) = eval(f(x), %);
simplify( eval(eq1,  f = unapply(rhs(%), x)) );   # check

             

             

 

So, you want the surface integral on the projection of a cuboid on a plane.

V:=<0,0,0>, <1,2,0>, <0,2,0>, <1,0,0>, <0,0,1>, <1,2,1>, <0,2,1>, <1,0,1>:
T:=<-1,0,0>, <0,-1,0>, <0,0,-1>: 
PM:=LinearAlgebra:-ProjectionMatrix([T[2]-T[1], T[3]-T[1]]):
Pr := v -> T[1]+PM.v:
Pr2:= v -> (PM.v)[[1,2]]:  # ConvexHull works in dimension 2.
P:=Pr~([V]):
P2:=Pr2~([V]):
ind:=ComputationalGeometry:-ConvexHull(Matrix(P2)^+):
C:=P[ind]: n:=nops(C):  # the vertices of the projection
Tri:=(v1,v2,v3) -> Surface( v1 + t*(v2+s*(v3-v2)-v1), s=0..1, t=0..1):
# the parametrization of the interior of a triangle
add(VectorCalculus:-SurfaceInt( x^2+y^2, [x,y,z] = Tri(C[1],C[i],C[i+1])), i=2..n-1);

                         

First 12 13 14 15 16 17 18 Last Page 14 of 111