# If $f(x)=\sqrt{x+3}$ and $g(x)=x^{2}+1$ be two real functions,

Question.
If $f(x)=\sqrt{x+3}$ and $g(x)=x^{2}+1$ be two real functions, then find fog and gof.

Solution:
$f(x)=\sqrt{x+3}$
For domain,
$x+3 \geq 0$
$\Rightarrow x \geq-3$
Domain of $f=[-3, \infty)$
Since $f$ is a square root function, range of $f=[0, \infty)$
$f:[-3, \infty) \rightarrow[0, \infty)$
$g(x)=x^{2}+1$ is a polynomial.
$\Rightarrow g: R \rightarrow R$
Computation of fog:
Range of $g$ is not a subset of the domain of $f$.
and domain $(f o g)=\{x: x \in$ domain of $g$ and $g(x) \in$ domain of $f(x)\}$
$\Rightarrow$ Domain $(f o g)=\left\{x: x \in R\right.$ and $\left.x^{2}+1 \in[-3, \infty)\right\}$
$\Rightarrow$ Domain $(f o g)=\left\{x: x \in R\right.$ and $\left.x^{2}+1 \geq-3\right\}$
$\Rightarrow$ Domain $(f o g)=\left\{x: x \in R\right.$ and $\left.x^{2}+4 \geq 0\right\}$
$\Rightarrow$ Domain $(f o g)=\{x: x \in R$ and $x \in R\}$
$\Rightarrow$ Domain $(f o g)=\mathrm{R}$
$f o g: R \rightarrow R$
$(f o g)(x)=f(g(x))$
$=f\left(x^{2}+1\right)$
$=\sqrt{x^{2}+1+3}$
$=\sqrt{x^{2}+4}$
Computation of gof:
Range of $f$ is a subset of the domain of $g$.
gof $:[-3, \infty) \rightarrow R$
$\Rightarrow(g \circ f)(x)=g(f(x))$
$=g(\sqrt{x+3})$
$=(\sqrt{x+3})^{2}+1$
$=x+3+1$
$=x+4$