# Solve equations for  composite functions?

**URL:** <https://community.wolfram.com/t/solve-equations-for-composite-functions/12448>\
**Category:** Questions\
**Tags:** wolfram-alpha, algebra, equation-solving\
**Created:** [May 10, 2018, 10:24pm UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448 "2018-05-10T22:24:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mznxlaks08](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mznxlaks08](https://community.wolfram.com/u/mznxlaks08)\
**Post date:** [May 10, 2018, 10:24pm UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/1 "2018-05-10T22:24:14Z")

</div>

Hello Ladies and Gentlemen,  
Please need instruction, how to enter equations for composite function .

```
Entered f(g(1)) : f(x)=x^2+2;g(x)=4x-5 , if copied/pasted into Wolfram/Alpha. This is displayed {f(g(1))/f(x) = x^2 + 2, g(x) = 4 x - 5}.
Entered f(g(1)),f(x)=x^2+2;g(x)=4x-5 , if copied/pasted into Wolfram/Alpha. This is displayed solve f(x) = x^2 + 2
g(x) = 4 x - 5 for f(x)
g(x).

```

How to input? Solve for f(g(1)) where f(x)=x^2+2 and g(x)=4x-5 ? if it is correctly entered the and calculated the correct answer should be 3.

Thanks

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 11, 2018, 4:35am UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/2 "2018-05-11T04:35:40Z")

</div>

f[x\_] := x^2 + 2  
g[x\_] := 4 x - 5  
In[3]:= f[g[1]]

```
Out[3]= 3

```

---

<div class="post-metadata">

**Author:** ![neils](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/neils/32/20595_2.png) [@neils](https://community.wolfram.com/u/neils)\
**Post date:** [May 12, 2018, 2:17am UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/3 "2018-05-12T02:17:45Z")

</div>

you can also use the shortcut notation for composition (@\*):

```
f@*g[1]

```

or

```
f@*g@1

```

---

<div class="post-metadata">

**Author:** ![mznxlaks08](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mznxlaks08](https://community.wolfram.com/u/mznxlaks08)\
**Post date:** [May 14, 2018, 10:10pm UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/4 "2018-05-14T22:10:07Z")

</div>

If input :  
f[x\_] := x^2 + 2  
g[x\_] := 4 x - 5  
In[3]:= f[g[1]]  
Then Input reads : x^2+2g  
does not give correct input

---

<div class="post-metadata">

**Author:** ![mznxlaks08](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mznxlaks08](https://community.wolfram.com/u/mznxlaks08)\
**Post date:** [May 14, 2018, 10:16pm UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/5 "2018-05-14T22:16:33Z")

</div>

if f@\*g[1] input , then input g(1).  
need input f(g(x))  
need input : f(g(1)) , where f(x)=x^2+3 and g(x)=4x-5  
if input correct , then output should calculate: f(g(1)) = 3  
This calculation (solution) should be accomplished by WolframAlpha as : not contained in input of the problem.

---

<div class="post-metadata">

**Author:** ![neils](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/neils/32/20595_2.png) [@neils](https://community.wolfram.com/u/neils)\
**Post date:** [May 15, 2018, 2:32am UTC](https://community.wolfram.com/t/solve-equations-for-composite-functions/12448/6 "2018-05-15T02:32:43Z")

</div>

You need to enter you functions correctly. Also, I forgot some parenthesis around the second example. g[1] took precedence over the composition.

```
In[1]:= f[x_] := x^2 + 2
 g[x_] := 4 x - 5

In[2]:= f@*g@1

Out[2]= 3

In[3]:= (f@*g)[1]

Out[3]= 3

```

Regards,

Neil
