Let f
Question:

Let $\mathrm{f}: \mathrm{R} \rightarrow \mathrm{R}$ and $\mathrm{g}: \mathrm{R} \rightarrow \mathrm{R}$ be defined as

$f(x)=\left\{\begin{array}{rr}x+a, & x<0 \\ |x-1|, & x \geq 0\end{array}\right.$ and

$g(x)=\left\{\begin{array}{rl}x+1, x<0 & 0 \\ (x-1)^{2}+b, x \geq 0 & \end{array}\right.$

where $\mathrm{a}, \mathrm{b}$ are non-negative real numbers. If (gof) $(\mathrm{x})$ is continuous for all $\mathrm{x} \in \mathrm{R}$, then $\mathrm{a}+\mathrm{b}$ is equal to________.

Solution:

$g[f(x)]=\left[\begin{array}{cc}f(x)+1 & f(x)<0 \\ (f(x)-1)^{2}+b & f(x) \geq 0\end{array}\right.$

$g[f(x)]=\left[\begin{array}{cl}x+a+1 & x+a<0 \& x<0 \\ |x-1|+1 & \mid x-1<0 \& x \geq 0 \\ (x+a-1)^{2}+b & x+a \geq 0 \& x<0 \\ (|x-1|-1)^{2}+b & |x-1| \geq 0 \& x \geq 0 \\ \mathrm{x}+\mathrm{a}+1 & \mathrm{x} \in(-\infty,-\mathrm{a}) \& \mathrm{x} \in(-\infty, 0)\end{array}\right.$

$\mathrm{g}[\mathrm{f}(\mathrm{x})]=\left[\begin{array}{cc}|\mathrm{x}-1|+1 & \mathrm{x} \in \phi \\ (\mathrm{x}+\mathrm{a}-1)^{2}+\mathrm{b} & \mathrm{x} \in[-\mathrm{a}, \infty) \& \mathrm{x} \in(-\infty, 0) \\ (|\mathrm{x}-1|-1)^{2}+\mathrm{b} & \mathrm{x} \in \mathrm{R} \& \mathrm{x} \in[0, \infty) \\ \mathrm{x}+\mathrm{a}+1 & \mathrm{x} \in(-\infty,-\mathrm{a})\end{array}\right.$

$\mathrm{g}[\mathrm{f}(\mathrm{x})]=\left[\begin{array}{cc}(\mathrm{x}+\mathrm{a}-1)^{2}+\mathrm{b} & \mathrm{x} \in[-\mathrm{a}, 0) \\ (1 \mathrm{x}-1 \mid-1)^{2}+\mathrm{b} & \mathrm{x} \in[0, \infty)\end{array}\right.$

$\mathrm{g}(\mathrm{f}(\mathrm{x}))$ is continuous

at $x=-a \& \quad$ at $x=0$

$1=b+1 \quad \& \quad(a-1)^{2}+b=b$

$b=0 \quad a=1$

$\Rightarrow \quad a+b=1$