I have the following code and output where the original function is $f(x,a) = a^2 - x^2$.
f[x_, a_] = a - x^2
ref := Nest[Function[{u, v}, f[u, v]][x, y], x, 2]
ref
(-x^2 + y)[(-x^2 + y)[x]]
I want the second iteration of this function. i.e, $f(f(x)) = a^2 - (a^2 - x^2)^2$. Why am I not getting this?
SetDelayed(:=) when you make the function assignement.refon the other hand should beSet(=) since it will compute the same thing each timerefis called anyhow. – Marius Ladegård Meyer Feb 25 '16 at 13:54