1

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.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
asik
  • 109
  • 6
  • 1
    Look at GridLines instead of Exclusions... – rm -rf Nov 12 '13 at 23:00
  • @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 – Sos Nov 12 '13 at 23:30
  • Hm..I will try this and let you know of my new result. – asik Nov 12 '13 at 23:31

2 Answers2

3

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

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
  • 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? – asik Nov 13 '13 at 00:03
  • @asik What book are you using? – Dr. belisarius Nov 13 '13 at 00:11
  • 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 – asik Nov 13 '13 at 00:39
  • google has few good files online with sample if you want to try them out – asik Nov 13 '13 at 00:40
  • @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: http://mathematica.stackexchange.com/a/22724/193 – Dr. belisarius Nov 13 '13 at 00:54
  • No, no I understand, reason why I use so many books is because the one required is not useful -- only has the basic use of a topic and does not emphasis on further details...I will definitely check that book out, many thanks. – asik Nov 13 '13 at 01:03
2

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

ubpdqn
  • 60,617
  • 3
  • 59
  • 148