Suppose, I want to solve a equation and want to obtain it's first root. In this case I've used
In[1]=:Solve[b^2 + b*z + 1 == 0, b][[1]] This gives
Out[2]={b -> 1/2 (-z - Sqrt[-4 + z^2])} Now I want use this result directly in Plot command. My code for this is
In[3]:Plot[Out[2], {z, -1000, 1000}, PlotRange -> All] But I'm not getting the plot. If I use
In[4]:Plot[1/2 (-z - Sqrt[-4 + z^2]), {z, -1000, 1000}, PlotRange -> All] I'm getting the plot correctly. I guess in In[3], Out[2] contains b->, that's why it's unable to plot. How to handle this situation?
p.s. This is a prototype of my actual problem. I want to solve this in this way because my output is too large to copy and paste in the Plot command.
Plot[%[[1, 2]], {z, -1000, 1000}, PlotRange -> All]! Taking second part of theRuleis the trick. You can also usePlot[Out[1][[1, 2]], {z, -1000, 1000}, PlotRange -> All]. $\endgroup$Outor%. I though assumed the OP will understand this ordering issue himself while playing with the notebook and if not through the answers below. $\endgroup$