# Thread: Calculus: Solving Piece wise function for constants a and b

1. ## Calculus: Solving Piece wise function for constants a and b

Hi
I have been working on this problem for days and i think im just missing a concept or something. the question is;
Let f(x)={cos (pi*x/2) +a if x<-2
{100 if x=-2
{2x^2 +b if -2<x<0
{2^x +1 if x>0 where a and b are constants. Find a and b for which both lim x-->0 f(x) and lim x-->-2f(x) exist.
So far i work it out and i can get either a=11 and b=2 or a=101 and b=92 but with these answers f(x) isnt continuous.
Help meh pleaaasseee!! (with working would be great )
THANK YOU!!!

2. ## Re: Calculus: Solving Piece wise function for constants a and b

In order for $\displaystyle \lim_{x\to-2}f(x)$ to exist, we require:

$\displaystyle \lim_{x\to-2^{-}}f(x)=\lim_{x\to-2^{+}}f(x)$

Now, using the definition of $\displaystyle f(x)$, we find this means:

$\displaystyle \lim_{x\to-2^{-}}\left(\cos\left(\frac{\pi x}{2} \right)+a \right)=\lim_{x\to-2^{+}}\left(2x^2+b \right)$

$\displaystyle \cos\left(\frac{\pi\cdot2}{2} \right)+a=2(2)^2+b$

$\displaystyle -1+a=8+b$

$\displaystyle a=9+b$

In order for $\displaystyle \lim_{x\to0}f(x)$ to exist, we require:

$\displaystyle \lim_{x\to0^{-}}f(x)=\lim_{x\to0^{+}}f(x)$

Now, using the definition of $\displaystyle f(x)$, we find this means:

$\displaystyle \lim_{x\to0^{-}}\left(2x^2+b \right)=\lim_{x\to0^{+}}\left(2^x+1 \right)$

$\displaystyle 2(0)^2+b=2^0+1$

$\displaystyle b=2\,\therefore\,a=11$

This ensures the limits exist, and while there is a discontinuity at $\displaystyle x=-2$, this is allowed as the function need not have the value of the limits at that point.

3. ## Re: Calculus: Solving Piece wise function for constants a and b

Thank you MarkFL that was the answer that i has but i didnt know that discontinuity would allow the limits to still exist thanks again