So I saw this picture on my book and it was left as an exercise to figure out.

enter image description here

This is what I have so far, but I'm not sure where I went wrong.

 Plot[{t^3 - t}, {t, -1, 1}, PlotStyle -> Blue, Exclusions -> {t == 1},Exclusions -> {t == -1}, Exclusions -> {s == 2/(3*Sqrt[3])},Exclusions -> {s == -2/(3*Sqrt[3])}, ExclusionsStyle -> {Pink}]       

I think somewhere I should use Epilog for that red dot, but with my original input incorrect, I cannot go any further.

  • 1
    $\begingroup$ Look at GridLines instead of Exclusions... $\endgroup$ – rm -rf Nov 12 '13 at 23:00
  • $\begingroup$ @rm-rf is correct. Also, for the dots, all the fun is taken since you already have the coordinates... Anyway, Epilog -> {PointSize[Medium], Point[{-1/Sqrt[3], 2/(3 Sqrt[3])}]}. Show with a ListPlot and Plot would also work $\endgroup$ – Sos Nov 12 '13 at 23:30
  • $\begingroup$ Hm..I will try this and let you know of my new result. $\endgroup$ – asik Nov 12 '13 at 23:31

I leave the legends to you:

f[t_] := t^3 - t;
Plot[f[t], {t, -1.5, 1.5}, GridLines -> (Transpose[#]), 
                           GridLinesStyle -> Pink, 
                           Epilog -> {PointSize[Large], Red, Point@#}] &@({u, f@u} /. 
                       Solve[f'@u == 0, u])

Mathematica graphics

|improve this answer|||||
  • $\begingroup$ If I wanted to change the color from the positive red restriction and negative restriction, how would I do that?PlotStyle->Purple would do the entire line but how would I restrict that? $\endgroup$ – asik Nov 13 '13 at 0:03
  • $\begingroup$ @asik What book are you using? $\endgroup$ – Dr. belisarius Nov 13 '13 at 0:11
  • $\begingroup$ Using various books/kindle - Wellin, Schaum, Roozbek (cannot remember name)...I read chapters, screenshot and capture ones I do not know or ones that are deemed difficult and do them at end of each month at once to test my knowledge $\endgroup$ – asik Nov 13 '13 at 0:39
  • $\begingroup$ google has few good files online with sample if you want to try them out $\endgroup$ – asik Nov 13 '13 at 0:40
  • $\begingroup$ @asik I hope you can understand. A lot of students come here asking for somebody else to do their homework. Here you can get a very good book (probably the better one) for free: mathematica.stackexchange.com/a/22724/193 $\endgroup$ – Dr. belisarius Nov 13 '13 at 0:54

This presents no advantage (at all) over belisarius (and I have voted for belisarius). I just post it to illustrate the multiplicity of ways of achieving the 'same' result. Choice dependent on aim, preferences etc. I have just used bland styling:

f[x_] := x^3 - x;
sol = {x, f@x} /. Solve[D[f[x], x] == 0, x];
cp1 = ContourPlot[f[x] - y == 0, {x, -2, 2}, {y, -2, 2}, 
   MeshFunctions -> (3 #1^2 - 1 &), Mesh -> {{0.}}, 
   MeshStyle -> Directive[Red, PointSize[Large]], 
   GridLines -> Transpose@sol];
cp2 = ContourPlot[f[x] - y, {x, -2, 2}, {y, -2, 2}, Contours -> {0.}, 
   ContourShading -> False, MeshFunctions -> {#1 &, #2 &}, 
   Mesh -> Transpose@N[sol], 
   Epilog -> {Red, PointSize[Large], Point@sol}];
GraphicsRow[{cp1, cp2}]

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.