# Math Help - Functions

1. ## Functions

Given
f(x)= x x>0
and 1/x x<0

and
g(x)= e^x

compute the functions fg, gf.

I know how to do these kind of questions normally, but I'm not sure how to deal with the function f(x), when the value changes based on the value of x... Any words of advice?

2. Hello,
Originally Posted by Hellreaver
Given
f(x)= x x>0
and 1/x x<0

and
g(x)= e^x

compute the functions fg, gf.

I know how to do these kind of questions normally, but I'm not sure how to deal with the function f(x), when the value changes based on the value of x... Any words of advice?
Well, let's first care of gof=g(f(x))
Distinguish two situations :
- x>0 : f(x)=x ---> g(f(x))=e^x
- x<0 : f(x)=1/x ---> g(f(x))=e^(1/x)

Now let's care of fog=f(g(x))
Write f(t)=t if t>0, =1/t if t<0
Consider g(x)=t. It's often useful when dealing with composite functions.
So when t=g(x) is positive, then f(t)=t.
When t=g(x) is negative, then f(t)=1/t.
But e^x is positive for any x.
Then g(x)=e^x=t>0 ---> f(g(x))=t=e^x

Does it look clear ?

3. Originally Posted by Moo
Hello,

Well, let's first care of gof=g(f(x))
Distinguish two situations :
- x>0 : f(x)=x ---> g(f(x))=e^x
- x<0 : f(x)=1/x ---> g(f(x))=e^(1/x)

Now let's care of fog=f(g(x))
Write f(t)=t if t>0, =1/t if t<0
Consider g(x)=t. It's often useful when dealing with composite functions.
So when t=g(x) is positive, then f(t)=t.
When t=g(x) is negative, then f(t)=1/t.
But e^x is positive for any x.
Then g(x)=e^x=t>0 ---> f(g(x))=t=e^x

Does it look clear ?
So then the case of f(g(x)) where g(x)<0 (which is impossible) does not exist?

4. Originally Posted by Hellreaver
So then the case of f(g(x)) where g(x)<0 (which is impossible) does not exist?
Right. Also, the domain of $f\circ g$ is all reals, since $f$ is defined for every value in the range of $g$.