Plot a function with a recursion relation

Consider the following functions:

r[x_] := r0 Exp[(k x)/(r1/(r1 + r[x]))];
f[x_] := (k x)/(r1/(r1 + r[x]));


and that

r1=1; r0=1; k=1;


I'd like to plot the function f[x]:

Plot[(k x)/(r1/(r1 + r[x])),{x,-1,1}]


How can the recursion relation can be dealt with?

For recursion relations we can use RSolve (this case can be solved algebraically however, see comments):

sol1 = RSolve[r[x] == r0 Exp[(k x)/(r1/(r1 + r[x]))], r[x], x]


to plot:

Plot[(k x)/(r1/(r1 + r[x])) /. sol1 /. {r1 -> 1, r0 -> 1,
k -> 1}, {x, -1, 1}]


• You will however have this warning: Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. – Ruud3.1415 Jan 22 '18 at 13:22
• And in this specific case, there is no need for recursion so sol2 = Solve[r[x] == r0 Exp[(k x)/(r1/(r1 + r[x]))], r[x]] will give you the exact same thing algebraically – Ruud3.1415 Jan 22 '18 at 13:28