Continuity of $a^x+b$ with $a, b \in \mathbb R$ Let $a,b \in  \mathbb{R}$ with $a > 0$. find $a$, $b$ so the function would be continuous
$$
f(x) = \begin{cases} a^x + b, & |x|<1 \\
x, & |x| \geq 1 \end{cases}
$$
I got $b = -a^x+x$ as my answer, but I'm unsure.
 A: Since $f(x) = a^x + b$ will be continuous on $|x| < 1$ for $a > 0$, we only need to match up this portion of $f$ with it's definition on $|x| \geq 1$ at the endpoints $x = \pm 1$. Evidently, $f(-1) = -1$ and $f(1) = 1$. So we need $a^{-1} + b = -1$ and $a + b = 1$. Using the latter gives $b = 1 -a$, so substitution yields:
$$
\frac{1}{a} + 1 - a = -1.
$$
This becomes:
$$
a^2 -2a -1 = 0.
$$
A quick application of the quadratic formula yields $a = 1 \pm \sqrt{2}$, and we can discard $a = 1 - \sqrt{2}$ since we require $a > 0$. Thus,
$$
a = 1 + \sqrt{2},
\; \; \; \; \; \;b = -\sqrt{2}.
$$
Indeed, the function:
$$
f(x) = \begin{cases} (1+\sqrt{2})^x - \sqrt{2} & |x| < 1, \\
x & |x| \geq 1, \end{cases}
$$
is continuous, as shown below:

A: Just do the definitions.  $x$, and $a^x + b$ are continuous so the the only possible point of discontinuity is as $|x| = 1$.
If $f$ is continuous at $x = 1$ then $\lim_{x\to 1^-} f(x) = \lim_{x\to 1^-}a^x + b = a+b$ must equal $f(1) = x|_1 = 1$  which must equal $\lim_{x\to 1^+} f(x) = \lim_{x\to 1^+} x = 1$.  So we must have $a+b = 1$
If $f$ is continuous at $x =-1$ then $\lim_{x\to -1^+} f(x) = \lim_{x\to -1^+} a^x + b = \frac 1a + b$ must equal $f(-1) = x|_{-1} = -1$ which must equal $\lim_{x\to -1^-}f(x) = \lim_{x\to -1^-}x = -1$.  So we must have $\frac 1a+b =-1$.
So $a+b =1$ and $\frac 1a + b = -1$.  So $b= 1-a=-1-\frac 1a$ so $a \ne 0$ and $1-a=-1-\frac 1a$ so $a-a^2=-a-1$ so $a^2-2a-1=0$ so $a =\frac {2 \pm\sqrt{4+4}}2=1\pm \sqrt 2$.
So $b =1-(1\pm \sqrt 2)=\mp \sqrt 2$ [Note: $b= -1-\frac 1{1\pm\sqrt 2} = -1-\frac {1\mp \sqrt 2}{(1\pm \sqrt 2)(1\mp \sqrt 2)} = -1-\frac {1\mp \sqrt 2}{1-2}=-1+(1\mp \sqrt 2= \mp \sqrt 2$]
so we can have $a = 1+\sqrt 2$ and $b= -\sqrt 2$ (then $\lim_{x\to 1^-} f(x) = (1+\sqrt 2)^1 + (-\sqrt 2) = 1+\sqrt 2 -\sqrt 2 = 1$ and $\lim_{x\to -1^+} f(x) = \frac 1{1+\sqrt 2} -\sqrt 2 =\frac 1{1+\sqrt 2}\frac {1-\sqrt 2}{1-\sqrt 2} - \sqrt 2=\frac {1-\sqrt 2}{1-2} - \sqrt 2 = (-1+\sqrt 2)-\sqrt 2 = -1$)
or we can have $a=1-\sqrt 2$ and $b = \sqrt 2$ (then $\lim_{x\to 1^-} f(x) = (1-\sqrt 2)^1 + \sqrt 2 = 1$ and $\lim_{x\to -1^+} f(x) = \frac 1{1-\sqrt 2} +\sqrt 2 =\frac 1{1-\sqrt 2}\frac {1+\sqrt 2}{1+\sqrt 2} + \sqrt 2=\frac {1+\sqrt 2}{1-2} + \sqrt 2 = (-1-\sqrt 2)+\sqrt 2 = -1$)
