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?


1 Answer 1


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}]

enter image description here

  • 1
    $\begingroup$ 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. $\endgroup$
    – Ruud3.1415
    Jan 22, 2018 at 13:22
  • 1
    $\begingroup$ 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 $\endgroup$
    – Ruud3.1415
    Jan 22, 2018 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.