# Thread: Problem with domain/range of a composition

1. ## Problem with domain/range of a composition

If f(x) = x^2 and g(x) = sqrt(x), then isn't it true that g(f(x)) has a domain of all real numbers and a range of all x greater than or equal to zero? This doesn't agree with the book's answer. Also, when looking at the composition of g(f(x)), the algebra simplifies to x. However, if you graph by plugging into g(x) and then into f(x), you get the absolute value of x. What gives?

Thanks.

Bret Norvilitis
OPHS

2. Originally Posted by bmnorvil
If f(x) = x^2 and g(x) = sqrt(x), then isn't it true that g(f(x)) has a domain of all real numbers and a range of all x greater than or equal to zero? This doesn't agree with the book's answer.
If x is any real number, then x^2 is non-negative and so sqrt(x) is defined. yes, the domain is all real numbers. Since sqrt(x) is defined as the non-negative number, a, such that a^2= x, the range is all non-negative numbers, as you say. What is the book's answer?

Also, when looking at the composition of g(f(x)), the algebra simplifies to x.
No, the algebra does NOT simplify to x. Since there are two numbers, positive and negative that give the same square, and sqrt only returns the positive one, sqrt(x^2) simplifies to |x|.

However, if you graph by plugging into g(x) and then into f(x), you get the absolute value of x. What gives?

Thanks.

Bret Norvilitis
OPHS