I am practicing composite functions and I can't get the same answer as the back of the textbook but I am confident in my calculations which leads me to believe the book is wrong.
Question
Let a be a positive number, $f:[2,\infty)\rightarrow \mathbb{R}, f(x)=a-x $ and let $g:(-\infty,1]\rightarrow\mathbb{R}, g(x)=x^2+a$. Find all values of $a$ for which both $f\circ g$ and $g\circ f$ exist.
My attempt
I know for $g\circ f$, $Ran$ $f$ must be a subset of $dom$ $g$ and for $f\circ g$, $Ran$ $g$ must be a subset of $dom$ $f$ therefore:
$dom$ $g= (-\infty,1]$ and $Ran$ $f=(-\infty, a-2]$
$dom$ $f= [2,\infty)$ and $Ran$ $g=[1+a,\infty)$
When I solve I am left with:
$a-2 \leq 1 $ and;
$1+a \geq 2 $
Therefore
$a \in [1,3]$
The solution in the textbook shows the answer to be $a \in [2,3]$
Can someone please help me out. Am I correct or is the textbook correct? If I have made an error can you please help me solve this.
Thank you
Best Answer
The textbook is correct.
Your mistake is that the range of $g$ is $[a,\infty)$, because the domain of $g$ contains $0$.
(You might want to look at $g$ on $(-\infty,0)$ and $[0,1]$ separately.)
Therefore, in the second line you should have $a\ge2$ where you wrote $1+a\ge1$.