Kitonum

17510 Reputation

24 Badges

13 years, 149 days

MaplePrimes Activity


These are answers submitted by Kitonum

First, we find the equation of the normal at an arbitrary point  P(x1,x1^2)  on the parabola. This normal intersects the axis  Oy  at a point  Q(0,y0) . Imposing the condition that the distance  PQ  = 1, we first find x1, and then the point  Q (the center of desired circle).

restart;
f:=x->x^2:
g:=x->f(x1)-1/D(f)(x1)*(x-x1):
y0:=g(0):
P,Q:=[x1,f(x1)],[0,y0];
solve((P[1]-Q[1])^2+(P[2]-Q[2])^2=1);
x1:=%[1]:
Q;

# Visualization
A:=plot([f(x),[t,g(t),t=Q[1]..P[1]]], x=-2..2):
B:=plot([P,Q],style=point):
C:=plots:-textplot([[P[],"P"],[Q[],"Q"]], align=right, font=[TIMES,14]):
c:=plottools:-circle(Q,1):
plots:-display(A,B,C,c, scaling=constrained);

                             

 

 

Yesterday I answered the same question only asked in another post (this post disappeared for some reason). Here's my answer:
 

restart;
A__left:=1/C__AO-1/C__AA;
f:=1/C__AO;
A__right:=``(f)*(expand(A__left/f));
expand(A__right); # Check

                               

 

                              

restart;
A__left:=1/C__AO-1/C__AA;
f:=1/C__AO;
A__right:=``(f)*(expand(A__left/f));
expand(A__right); # Check

                                  

 

 

@jrive  For arbitrary real parameters the last line should be

Pabang := evalc(argument(Pab));

Returns 
                   


From help  "For real arguments x, y, the two-argument function arctan(y, x), computes the principal value of the argument of the complex number 
                            x + I y
, so 
           -Pi < arctan(y, x) and arctan(y, x) <= Pi"

The code below implements this process in Maple. As already pointed out by vv, on each new launch, the numbers  N  may be different.

restart;
randomize():
n:=2012:
S:={seq([i,i], i=1..n)}:
for step from 1 to n-2 do
t:=combinat:-randcomb(S, 2);
S:=(S minus t) union {[n+step,2*(t[1][2]+t[2][2])]};
od:
N:=S[1][2]+S[2][2];
N/1000;

 

The problem is that Maple does not implement work with piecewise-functions where the number of variables is greater than 1. For example, Maple cannot convert the sum of such functions into some new piecewise-function. Therefore, we have to do something manually. You have 2 variables  lambda[1]  and  lambda2 . Straight lines  (1 - alpha)*lambda[1] - lambda[2]=0  and  -(1 + alpha)*lambda[1] + lambda[2]=0  divide the entire plane  (lambda[1], lambda2)  into 4 regions  R1, R2, R3, R4. In your example,  alpha=0.01 is very small and therefore the regions  R1  and  R3  will be very narrow. Therefore, for better drawing, I took  alpha=0.3 .We define the functions  U1  and  U2  in terms of these regions, and we define the operations on the functions using procedures (for example for `-` sign we use the procedure  `p-`  below) :
 

restart;
alpha := 0.3;
e1:=(1 - alpha)*lambda[1] - lambda[2]:
e2:=-(1 + alpha)*lambda[1] + lambda[2]:
R1:=e1<=0 and e2<=0;
R2:=e1<=0 and e2>0;
R3:=e1>0 and e2>0;
R4:=e1>0 and e2<=0;
U1 := piecewise(R1,0,R2,0,R3,5,R4,5);
U2 := piecewise(R1,0,R2,5,R3,5,R4,0);
`p-`:=(U1,U2)->piecewise(seq(`if`(type(i,odd),op(i,U1),op(i,U1)-op(i,U2)),i=1..nops(U1)));
U:=`p-`(U1,U2);
A:=plots:-inequal([{e1<=0,e2<=0},{e1<=0,e2>0},{e1>0,e2>0},{e1>0,e2<=0}], lambda[1]=-3..3, lambda[2]=-3..3, optionsfeasible=[[color="Pink"],[color="LightBlue"],[color="LightGreen"],[color="Yellow"]],labels=[lambda[1], lambda[2]]):
B:=plots:-textplot([[2.3,2.3,"R1"],[-2,2,"R2"],[-2.3,-2.3,"R3"],[2,-2,"R4"]]):
plots:-display(A,B);
plot3d(U, lambda[1]=-3..3, lambda[2]=-3..3, numpoints=10000);
 

alpha := .3

 

R1 := `and`(.7*lambda[1]-lambda[2] <= 0, -1.3*lambda[1]+lambda[2] <= 0)

 

R2 := .7*lambda[1]-lambda[2] <= 0 and 0 < -1.3*lambda[1]+lambda[2]

 

R3 := `and`(0 < .7*lambda[1]-lambda[2], 0 < -1.3*lambda[1]+lambda[2])

 

R4 := -1.3*lambda[1]+lambda[2] <= 0 and 0 < .7*lambda[1]-lambda[2]

 

U1 := piecewise(`and`(.7*lambda[1]-lambda[2] <= 0, -1.3*lambda[1]+lambda[2] <= 0), 0, .7*lambda[1]-lambda[2] <= 0 and 0 < -1.3*lambda[1]+lambda[2], 0, `and`(0 < .7*lambda[1]-lambda[2], 0 < -1.3*lambda[1]+lambda[2]), 5, -1.3*lambda[1]+lambda[2] <= 0 and 0 < .7*lambda[1]-lambda[2], 5)

 

U2 := piecewise(`and`(.7*lambda[1]-lambda[2] <= 0, -1.3*lambda[1]+lambda[2] <= 0), 0, .7*lambda[1]-lambda[2] <= 0 and 0 < -1.3*lambda[1]+lambda[2], 5, `and`(0 < .7*lambda[1]-lambda[2], 0 < -1.3*lambda[1]+lambda[2]), 5, -1.3*lambda[1]+lambda[2] <= 0 and 0 < .7*lambda[1]-lambda[2], 0)

 

`p-` := proc (U1, U2) options operator, arrow; piecewise(seq(`if`(type(i, odd), op(i, U1), op(i, U1)-op(i, U2)), i = 1 .. nops(U1))) end proc

 

piecewise(.7*lambda[1]-lambda[2] <= 0 and -1.3*lambda[1]+lambda[2] <= 0, 0, .7*lambda[1]-lambda[2] <= 0 and 0 < -1.3*lambda[1]+lambda[2], -5, 0 < .7*lambda[1]-lambda[2] and 0 < -1.3*lambda[1]+lambda[2], 0, 0 < .7*lambda[1]-lambda[2] and -1.3*lambda[1]+lambda[2] <= 0, 5)

 

 

 

 


 

Download piecewise.mw

restart;
sol:=msolve(x^2=-1, 5);
map2(eval, x, [sol]);

                                    sol := {x = 2}, {x = 3}
                                              [2, 3]

restart;
A:=[seq(a||i,i=1..4)];
B:=[seq(b||i,i=1..4)];
Matrix(4,8, {seq((i,2*i-1)=A[i], i=1..4), seq((i,2*i)=B[i], i=1..4)});

                             

 

Use the continuous option:

restart;
F:=int( 1/(1+x^n), x=0..1, continuous);
convert(F, hypergeom);

                                

                              

Use the Student:-VectorCalculus package and the LineInt command for this:

restart;
with(Student:-VectorCalculus):
LineInt(VectorField(<x^2-y^2+x, -2*x*y-y>), Path(<t^2, t>, t = 0 .. 1));
LineInt(VectorField(<x^2-y^2+x, -2*x*y-y>), Path(<t^2, t>, t = 0 .. 1),output=plot,fieldoptions=[fieldstrength = fixed]);

                     

 

The expression for your function can be greatly simplified to the fraction  (x-4)/x  by reducing the numerator and denominator by  x^2-9 . But at the same time you lose information that the original expression in points  x=-3  and  x=3  will be  0/0  (these will be the points of removable discontinuity) .
For better plotting, it is useful to increase the range on the x-axis, it is reasonable to limit the range on the y-axis. Additionally, the horizontal asymptote, vertical asymptote and points of removable discontinuity are shown in blue on the plot below:

restart;
f:=x->(x^3 - 4*x^2 - 9*x + 36)/(x^3 - 9*x);
g:=unapply(simplify(f(x)),x);
Lines:=plot([f(x), [0,t, t=-10..10],1], x=-7..7, y=-6..7, linestyle=[1,3,3], thickness=[2,0,0], color = [red,blue$2], discont ):
Points:=plot([[-3,g(-3)],[3,g(3)]], style=point, symbol=circle, color=blue, symbolsize=14):
plots:-display(Lines,Points);

                   

Addition. If we write  (x - 4)/x = 1 - 4/x , then we see that the graph of your function will be symmetrical about the point  (0, 1)  (this graph is called a hyperbola).

a. To plot a semicircle graph, it is better to use parametric equations, which make it easy to plot any part of the circle.
b. Obviously, the rotation results in a ball of radius 2 centered at the origin.
c. To calculate the volume of this ball, you can use the explicit equation of the given semicircle and the penultimate formula from your list.
 

restart;
plot([2*cos(t),2*sin(t),t=0..Pi], scaling=constrained);
f(x):=sqrt(4-x^2):
Pi*int(f(x)^2, x=-2..2);

                    

 

 

 

I'm guessing that the original expression is missing the parentheses (for the numerator and denominator), as well as the multiplication signs. Using the indication in the problem statement, we first find the tangency points, and then the tangent lines at these points:

restart;
f:=x-> (x^3+9*x^2-9*x-1)/(x^4+1):
solve(D(f)(x)=0.5);
L:=select(type,[%], realcons); # the tangency points
Lines:=map(p->f(p)+0.5*(x-p), L); # the tangency lines

plot([f(x),Lines[]], x=-6..6,-4..10, color=[red,blue,green,brown,cyan], scaling=constrained, legend=[f(x),Lines[]]); 

0.4396034712, 1.545359967, 1.135924545 + 3.219224078 I, 0.07028667536 + 0.8729569266 I, -0.8928416048, -3.504544275,  0.07028667536 - 0.8729569266 I, 1.135924545 - 3.219224078 I
 L := [0.4396034712, 1.545359967, -0.8928416048, -3.504544275]
     Lines := [-3.239253622 + 0.5 x, 0.7602488505 + 0.5 x, 8.699886068 + 0.5 x, 2.397905593 + 0.5 x]

          

You can use the Student:-Calculus1:-Roots command for this:

restart;
f(x) := 2.0*cos(1.5*x + 4.0) + 2.2:
g(x) := 2.0*cos(1.6*x + 3.85) + 2.0:
Student:-Calculus1:-Roots(f(x)=g(x), x=-1..4);             

                                                    [-0.7967442905, 3.834531623]

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