Message Boards Message Boards

0
|
5499 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Function composition

Posted 11 years ago
Hi.

I'm kinda new to this and just learning all I can to compute everything with Mathematica.
How can i compute this:

f(x) = 3x - 5
g(x) = 2 - x^2

(F o G) (x) ?

I've tried with:
f[x]=3x-5
g[x]=2-x^2

Composition [f,g], but I'm just getting:
f[2 - x^2]
Any help would be appreciated, Thanks.
POSTED BY: jose C
2 Replies
f[x_]:=3x-5;g[x_]:=2-x^2;
Composition[f,g][x]
 In[42]:= Clear[f, g]
 f[x_] := 3 x - 5
 g[x_] := 2 - x^2
 
 In[45]:= f[g[o]]
 Out[45]= -5 + 3 (2 - o^2)
 
 In[46]:= Composition[f, g][q]
 Out[46]= -5 + 3 (2 - q^2)
does not do it? Syntax matters ...
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract