Question: revised mathematical visualization

Hello,

 I need help writing a maple code to calculate the normal to the curve X^2-2X at x=1.5

and also display the curve, the tangent, and the normal on the same plot in the range x=[-10,10].

I manage to answer the question, but i am not quite certain if i have written a proper code..please if someone can review my solution and advise me i would really appreciate it....

I also would like to also make visisble the point of tangency at x=1.5 and give description of the figure but i am not sure how to do so...

 

how can i cut and paste the exact code with the images....it seesm that it doesnt allow me to do direct cut and paste so i changed it to 1-D and paste it into this page..

Thank you for your help.. 

 

 

 

 

 

restart;

 

 

    f := proc (x) options operator, arrow; x^2-2*x end proc;

   (D(f))(x);

 

 #Then, the slope of the line tangent to the graph of f(x) at the point with x-coordinate, x=1.5 is,

 

    D(f)*at*x = 1.5; 

   evalf((D(f))(1.5));

 

#The y-coordinate of the point is 

 

  f(x)*at*x = 1.5;

 

   evalf(f(1.5));

 

   showtangent(f(x), x = 1.5, color = [black, purple]);

   plot([f(x), (D(f))(1.5)*(x-1.5)+f(1.5)], x = -10 .. 10, y = -10 .. 10, color = [black, purple]);

 

 

  plot([x^2-2*x, x-1.5-.75, -x+.75], x = -10 .. 10, y = -10 .. 10, color = [black, purple, pink]);

 

 

 

 

 

 

Please Wait...