Question:

Let \(f:R\to R\) and \(g:R\to R\) be defined as
\(f(x)=\begin{cases}x+a, & x<0\\ |x-1|, & x\ge 0\end{cases}\) and \(g(x)=\begin{cases}x+1, & x<0\\ (x-1)^2+b, & x\ge 0\end{cases}\),
where a, b are non-negative real numbers. If \((g\circ f)(x)\) is continuous for all \(x\in R\), then \(a+b\) is equal to ____________.

Show Hint

Check continuity of \(g\circ f\) at \(x=0\); also check the point where \(f(x)=0\), because \(g\) jumps at 0 unless \(b=0\).
Updated On: Nov 4, 2026
Show Solution
collegedunia
Verified By Collegedunia

Correct Answer: 1

Solution and Explanation

For \(x\ge0\), \(f(x)=|x-1|\ge0\), so \((g\circ f)(x)=(|x-1|-1)^2+b\), continuous for \(x\ge0\), with value \(b\) at \(x=0\) (since \(f(0)=1\), \(g(1)=b\)).
For \(x<0\), \(f(x)=x+a\).
Case \(a=0\): \(f(x)=x<0\), \(g(f(x))=x+1\to1\) as \(x\to0^-\). Continuity at 0 needs \(b=1\). Then \(g\circ f\) is continuous everywhere, so \((a,b)=(0,1)\) and \(a+b=1\).
Case \(a>0\): \(f(x)\to a>0\) as \(x\to0^-\), so the left limit is \((a-1)^2+b\); equating with \(b\) gives \(a=1\). Then \(f(x)=x+1\) crosses 0 at \(x=-1\), where \(g\) has left limit 1 and right value \(1+b\); continuity at \(x=-1\) needs \(b=0\). So \((a,b)=(1,0)\) and \(a+b=1\).
In every valid case \(a+b=1\).
Answer: 1
Was this answer helpful?
0
0