Plot f[x_,f[x_]]

Dear all,

I’m a Mathematica beginner and I’m struggling with plotting a nested function.

I have a function f[x_,p_] - and the variable p is also a function of x. So I basically want to plot a function f[x_,f[x_]]. So far, I have tried the following things:

a) First, I defined the variable p=… such that if I enter p, I get the right expression with the unknown parameter x. Second, I entered the function f[x_,p_] - but I do not get any output for that.

b) I defined a function h[x_] instead of the variable p and substituted all p in f[x_,p_] by h[x_], such that f[x_,h[x_]]=… is a function of x and h[x_] which leads to the error "pattern x_ appears on the right hand side.

c) Finally, I plugged the expression of h[x_] in f[x_,h[x_]] such that I only have f[x_]. But in this case I get “construct pure function”.

I am happy for any hint!

Thank you in advance

Patrick

Is it the very same function?
Did you try straightforward definition and plotting like this?

f[x_] := x^2;
g[x_] := f[x]*2;

Plot[g[f[i]], {i, 1, 100}]

You used notation: f[x,f\[x\]\] - does this make any sense? Your first f depends on 2 arguments but second f depends just on 1 argument? Why are you not posting actual functions and code that you are using? It gives me impression that you did not really try to actually code it or did not describe actual issue, because there are no problems in plotting nested functions:

Plot[JacobiSN[JacobiSN[x, 1/3], 1/3], {x, -10, 10}]

Thanks, Tom, that solved the issue! I didn’t know that I have to substitute x_ by i for plotting it…