# Evaluate function using list

I'm trying to evaluate the first derivative of the period-3 logistic map for the fixed points in the period 3 window at a specific value of r. I define the period-3 map:

f[r_, x0_] := r*(r*(r*x0(1-x0))*(1-(r*x0(1-x0))))*(1-r*(r*x0 (1-x0))*(1-(r*x0 (1-x0))));


and the derivative of the map:

F1p[r, x0] := Derivative[2, 0][f][r, x0];


Then I get the fixed points at a specified value of r:

s = Solve[f[3.835, x0] == x0 && x0 > 0 , {x0}]


and put these values into a list (table)?:

xx = s[[All, 1, 2]]


What I'm trying to do next is get each fixed point and evaluate the derivative, but the code just outputs the function call and not the output value:

For[i = 1, i < Length[xx], i++, Print[Evaluate[F1p[3.835, xx[[i]]]]]]


outputs something like:

F1p[3.835,0.152074]


I also just tested my derivative function, and it looks like that is giving the same output as well. What am I doing wrong here?

In the definition of F1p its arguments need to be patterns.

Clear[f, F1p]

f[r_, x0_] :=
r*(r*(r*x0 (1 - x0))*(1 - (r*x0 (1 - x0))))*(1 -
r*(r*x0 (1 - x0))*(1 - (r*x0 (1 - x0))));

F1p[r_, x0_] = Derivative[2, 0][f][r, x0] // Simplify;

xx = x0 /. Solve[f[3.835, x0] == x0 && x0 > 0, {x0}]

(* {0.152074, 0.167205, 0.494514, 0.534015, 0.739244, 0.954313, 0.958635} *)

F1p[3.835, #] & /@ xx

(* {-0.530149, -0.148339, -9.079, -8.66445, 0.816794, -0.526866, -0.415777} *)

• You can also do F1p = Derivative[2, 0][f], although then it is a bit harder to simplify. – Carl Woll Apr 18 '18 at 4:06
• Bob, did you use Set instead of SetDelayed in the definition of F1p for a purpose? I'd have used F1p[r_, x0_] := Evaluate[Simplify[Derivative[2, 0][f][r, x0]]]; – Henrik Schumacher Apr 18 '18 at 6:08
• @HenrikSchumacher - yes it was deliberate -- to avoid the necessity of using Evaluate – Bob Hanlon Apr 18 '18 at 14:44