# Find the real parameters for which the function is continuous over the reals.

How should I solve this exercise? Find the values of the real parameters $a$ and $b$ for which the following function is continuous on $\Bbb{R}$:

\begin{cases} e^x+a\cos(x) \text{ if } x\le0 \\ x^2+b\sin(x) \text{ if } x>0 \\ \end{cases} Thank you!!!

For continuity at $x=c$ $$\lim_{x\to c^-}f(x)=f(c)=\lim_{x\to c^+}f(x)$$

Here $\displaystyle c=0, \lim_{x\to 0^-}f(x)=f(0)=e^0+a\cdot\cos0=1+a$

and $\displaystyle\lim_{x\to 0^+}f(x)=0^2+b\cdot \sin^20=0$

• I know this, but may be I am doing something wrong when I apply this , because I get 1+a=1+a. Can you pleae write the values of the limits for above functions? – Ivan Gandacov Apr 17 '14 at 15:00
• @GitGud, I've just generalized the answer – lab bhattacharjee Apr 17 '14 at 15:01
• So a =-1 but how do I find "b"? – Ivan Gandacov Apr 17 '14 at 15:04
• @JohnG., You can not. $b$ can be arbitrary finite real constant – lab bhattacharjee Apr 17 '14 at 15:05
• I understand, thank you – Ivan Gandacov Apr 17 '14 at 15:05

Note that the function is defined piecewise, and each "piece" is cont. So, the function defined above will be continuous, if the pieces "glue" together "nicely" at $0$.

More formally, your function $f$ will be cont. if and only if

$\lim_{x \rightarrow 0+}f(x)=\lim_{x \rightarrow 0-}f(x)$. Now I hope you can finish the problem.

The necessary and sufficient condition for which a function $f(x)$ is continuous in a point $c$ is that $$\lim_{x\to c^-}f(x)=\lim_{x\to c^+}f(x)$$ Note that $f(x)$ is continuous in $]-\infty;0[$ and $]0;+\infty[$, because $e^x$, $\cos(x)$ and $\sin(x)$ are continuous $\forall x \in \Bbb{R}$. The only "critical" point is $x=0$. By the definition of continuous function you get $$\lim_{x\to c^-}f(x)=\lim_{x\to c^+}f(x)$$ $$e^0+a\cos(0)=0^2+b\sin(0)$$ $$1+a=0 \Rightarrow a=-1$$ As regards $b$, there are insufficient conditions to determine it, so $b$ can be any real number.