Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I need to find all the roots of this function. I know it is simple to find by hand, however, I wish to learn how to do it so I can apply it later. The problem is that it only gives me one root.

Distance[t_] := t*(t - 1)*(t - 1.5)^2*(t - 3)
Velocity[t_] := Simplify[Distance'[t]]
FindRoot[Velocity[t], {t, -100, 100}]

{t -> 2.63641}

I can find the minimum and maximum. However, how would I plot them on the same graph as the function without copy and pasting the points manually into a list?

share|improve this question
3  
Any reason you can't just use Solve[Velocity[t] == 0, t]? –  Andy Ross Nov 14 '12 at 22:21
    
Gah! You might as well close the question now. –  General Stubbs Nov 14 '12 at 22:32

1 Answer 1

up vote 6 down vote accepted

As Andy said, you can simply use

solutions = Solve[velocity[t] == 0, t]

to find the extrema: {{t -> 0.291169}, {t -> 1.17242}, {t -> 1.5}, {t -> 2.63641}}

To answer the second part of your question:

However, how would I plot them on the same graph as the function without copy and pasting the points manually into a list?

You can use Show to draw multiple plots or graphics in the same coordinate system:

Show[
 Plot[distance[t], {t, 0, 3}],
 Graphics[{Red, PointSize[Large], 
   Point[{t, distance[t]} /. solutions]}]]

Result:

Mathematica graphics

share|improve this answer
    
You could also use Epilog to plot the points. –  wxffles Nov 14 '12 at 23:06
    
Thank you so much. When I find the maximum and minimum, I'll just define it as a variable. –  General Stubbs Nov 15 '12 at 0:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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