# F(g(x)) problem, about the domain.

1. Oct 10, 2006

### AznBoi

Ok, f(x)=x^2 g(x)=sq.rt.(2-x)

Problem: f(g(x))

You end up with the answer 2-x but how come you need a domain for the answer? How come the domain is (-infinity,2]????

2. Oct 10, 2006

### drpizza

Because while your answer simplifies to 2-x, you have to remember that there's a sqrt(2-x) in there... you can't take the square root of a negative number.

Here's an example: $$f(x)=\frac{x^2+3x+2}{x+2} = \frac{(x+2)(x+1)}{x+2}$$

While it's obvious that the expression simplifies, you have to remember that you can't divide by zero. Thus, the value of -2 for x is not allowed in the original function. If you simplify the function, it becomes x+1, x doesn't equal 2.