# Piece-wise function problem

by thereddevils
Tags: function
 P: 439 1. The problem statement, all variables and given/known data Function f and g are defined as follows : f(R)=R , f(x)=x^2 , g(R)=R , g(x)=x+1,x>=0 , -x , x<0 (its a piecewise function) . Find fg(x) and gf(x) . 2. Relevant equations 3. The attempt at a solution fg(x)= (x+1)^2 , x>=0 x^2 , x<0 gf(x)= x^2+1 , x>=0 -x^2 , x<0 Am i correct ? What are the things i will need to look into when face questions like this ? Cheking the domain ?
 P: 2,179 This looks correct to me.
 Mentor P: 15,170 If you mean f(g(x)) and g(f(x)) then what you have for f(g(x)) is correct, but the other is not.
P: 439
Piece-wise function problem

 Quote by D H If you mean f(g(x)) and g(f(x)) then what you have for f(g(x)) is correct, but the other is not.
thanks but why ? How did you see that ?
 Mentor P: 15,170 Show your steps on how you derived g(f(x)).
P: 439
 Quote by D H Show your steps on how you derived g(f(x)).
ok . Basically , i just substituted the function f(x) into the function g(x) , without doing any other checkings because i do not know what to check . Could you guide me on thsi ? Thanks .
 Mentor P: 15,170 Hint: Is f(x) ever negative?
 P: 2,179 Ah, based on DH's hint, I now agree that you have done g(f(x)) incorrectly. Thereddevils, do you see it now?
P: 439
 Quote by D H Hint: Is f(x) ever negative?
thanks !

 Related Discussions Linear & Abstract Algebra 6 Advanced Physics Homework 0 Quantum Physics 2 General Physics 5 Advanced Physics Homework 0