I'm a beginner to Mathematica. Here's my question.
I'd like to store the output(s) of a Solve command to variable(s) that can be manipulated later.
For example, I would like x1 and x2 to be the two solutions of x^2 - x - 1. I start with this
Clear[f, x]; f[x_] = x^2 - x - 1; solutions = Solve[f[x] == 0, x]
To be clear, I want x1 to have value
(1/2)(1 - Sqrt[5])
and NOT {x -> (1 - Sqrt[5])/2}
so that I could input
x1 + Sqrt[5]
and get output
(1/2)(1 - Sqrt[5])
How do I do this? Any help is much appreciated.
{}
button above the edit window. The edit window help button?
is also useful for learning how to format your questions and answers. $\endgroup$ReplaceAll[]
. $\endgroup$