This expression:
FullSimplify[Solve[dx == dL - (1/2) dd, dL]]
Gives this solution (I've simplified it for brevity):
$$\left\{\left\{ d_L\rightarrow \frac{\sqrt{1+z}}{2+z} \right\}\right\}$$ Which appears to be a 'rule', but now I want to create a function from that rule. Something like:
F[z_] := $\frac{\sqrt{1+z}}{2+z}$
but with the actual result from the Solve function. I've seen various attempts with the ReplaceAll command, but I can't seem to get it to work. How do I do this?
EDIT: I'm reasonably comfortable getting the answer using substitution like in the examples on this question: Assign the results from a Solve to variable(s). What I can't figure out is how to make a proper Function.
Function
, one for each solution:sol = Solve[a^2 + z a - 2 == 0, a]; Function[z, #] & /@ Values[sol]
$\endgroup$Function[1024]
, all you get is1024&
. $\endgroup${F, G} = Function[z, #] & /@ Values[sol]
. (Tho, you should avoid starting names with a capital, esp. single-letter symbols.) $\endgroup$