# Find all possible sequences $\{a_n\}$ and $\{b_n\}$ such that $f$ is continuous on $[0,\infty)$.

Define $$f(x)= \begin{cases} a_n + \sin\pi x &\text{if}&x \in [2n, 2n + 1],\\ b_n + \cos\pi x &\text{if}&x \in (2n − 1, 2n), \end{cases}$$ where $n\in\mathbb{N}\cup\{0\}$. Find all possible sequences $\{a_n\}$ and $\{b_n\}$ such that $f$ is continuous on $[0,\infty)$.

My Attempt :

In order that $f$ be continuous on $\mathbb{R}$, a necessary and sufficient condition is that $$\lim_{x\to(2n)^-} f(x) =\lim_{x\to(2n)^+} f(x) \text{ and } \lim_{x\to(2n-1)^-}f(x) = \lim_{x\to(2n-1)^+} f(x)$$ as I have took \begin{align} a_1 + \sin2\pi &= a_1\\ a_2 + \sin4\pi &= a_2\\ \vdots&\\ a_n + \sin2n\pi &= a_n \end{align} similarly \begin{align} b_1 + \cos \pi &= b_1 + (-1)\\ b_2 + \cos3\pi &= b_2 + (-1)\\ \vdots&\\ b_n + \cos(2n-1)\pi &= b_n + (-1) \end{align} so my answer is that $a_1, a_2,\cdots,a_n$ and $b_1 + (-1), b_2 + (-1), \cdots ,b_n + (-1)$ are all possible sequences $\{a_n\}$ and $\{b_n\}$ such that $f$ is continuous on $[0,\infty)$.

is my answer is correct or not, I would be very more thankful who will rectify my mistake.

$$f (2n^-)=b_n+\cos (2n\pi)=b_n+1$$
$$f (2n^+)=a_n+\sin (2n\pi)=a_n+0$$
thus $f$ is continuous at $[0,+\infty)$ if
$a_n=b_n+1$ for $n\ge 1$. For example
$$b_n=\cos(2n) \;\;, \;\;a_n=2\cos^2 (n)$$
• But what about an the odd points, that is, at $x=2n-1/2n+1$, we get $a_n=b_n-1$, isnt it? – vidyarthi Sep 20 '17 at 6:45