I'm currently studying continuity of functions and I like to use symbolab to study.
The teacher told us that a function is continuous at $x=a$ if
- $a$ is defined in the piecewise function(if has one)
- $f(a)$ is defined
- $\lim _{x\to a}\:\:f\left(x\right)$ = f(a)
The teacher never explained how piecewise functions work. He just assumed we knew. And as soon as I saw one I intuitively knew(or thought I knew) seemed pretty straight forward, the left side is the function to use whenever the right side condition is met for x.
So I gave symbolab a piecewise function, precisely this function:
$continuity\:y=\:\begin{cases}\frac{x^2+2}{x-1}&x\le \:1\\ x+2&x>\:1\end{cases},\:x=1$
Symbolab concluded that $f(x)$ is continous at $x=1$
Before this, I thought this function wasn't continuous at $x=1$ because if $x=1$ I thought it would use the function next to the condition $x ≤ 1$. That is:
$f\left(1\right)=\frac{1^2+2}{1-1}=undefined$
but instead, symbolab used the second part of the piecewise function to evaluate $f(1)$
$f\left(1\right)=1+2$
Either
- I don't know how piecewise functions work.
- I'm missing something about continuous functions
- Symbolab has a bug
Since the first 2 are the most probable, I ask here. What am I missing?
For those who are programmers this my thought process:
$g(x)=\frac{x^2+2}{x-1}$
$f(x)=x-1$
$\:eval(x)=\:\begin{cases}g\left(x\right)&x\le \:1\\ f\left(x\right)&x>\:1\end{cases},\:x=1$
function eval(x){
if(x<=1)
return g(x);
else
return f(x);
}
Thus
print(eval(1)); //undefined || div0 || crash
There was an error while defining the function.
$y=\:\begin{cases}\frac{x^2+2}{x-1}&x\le \:1\\ x+2&x>\:1\end{cases}$
Here,writing $x\leq1$ makes the question erroneous as $1$ is not in the domain of the function.
Therefore, the correct way of defining the function should be :
$y=\:\begin{cases}\frac{x^2+2}{x-1}&x<1\\ x+2&x>\:1\end{cases}$
Edit: As @ryang rightly pointed out that the function is continuous because at $x=1$, the function is not defined and that's the point where the limit doesn't exist, but continuity of a function is discussed within its domain.