# How can I plot graphic b[a[x]] after having defined a[x]? [closed]

I'm very new to Mathematica and I need it to create a (simple) theoretical model.

I'm struggling to plot graphic b[a[x]] after having defined a[x], so far my code is:

a[x_] := Exp[x];
b[x_] := (a[x]/(a[x] + 1))^(1 - 3/10);
Plot[b[x], {x, -3, 3}]


What am I missing? Thank you in Advance!

• Did you try to restart Mathematica? Jun 19, 2018 at 15:16
• I just did, Thank you very much! It is working
– MarV
Jun 19, 2018 at 15:21
• Your question may be put on-hold as it seems to be off-topic, i.e it arises from a simple mistake (Needed a fresh Kernel) and is unlikely to help any future visitors, or else it is easily found in the documentation. Don't be discouraged by that cleaning-up policy. Your future good questions are welcome. Learn about common pitfalls here. Jun 19, 2018 at 16:29

Is this what you want?

a[x_] := Exp[x];
b[x_] := (a[x]/(a[x] + 1))^(1 - 3/10);

Plot[b[a[x]], {x, -3, 3}]


Hope that helps.

Edit

I took your first line literally. As @roman465 suggests do you just want b[x] ?

If so

Plot[b[x], {x, -3, 3}]


Is this what you need? Can't see why it did not work for you although comments now suggest that restarting worked. Before defining a function then ClearAll is useful to remove previous definitions. I would have done

ClearAll[a, b];
a[x_] := Exp[x];
b[x_] := (a[x]/(a[x] + 1))^(1 - 3/10);

• It doesn't seem to be working still.. And I copied your code. I don't understand if it's a fault in my programme.
– MarV
Jun 19, 2018 at 15:14
• @Hugh notice that b[x] (what OP is actually asking) and b[a[x]] are different functions. Jun 19, 2018 at 15:48
• @roman465 I added an edit. Thanks for noting the alternative interpretation.
– Hugh
Jun 19, 2018 at 15:57
• Thank you both for your help. If my code was correct it must've been that the variables where defined somewhere else or that the programme had too many pages opened. Thank you for your help !
– MarV
Jun 19, 2018 at 16:17
• @MarV Happy to help. The standard approach for you now is wait for a day or so and if you don't get a better answer then accept mine and the case is then nicely closed. You also might like to see how to post code etc. Welcome to Mathematica stack exchange.
– Hugh
Jun 19, 2018 at 16:21