Determine whether the following functions are defined and where they are continuous.

$f(x)=\frac{x+\sin \pi x}{x^2+3x+2}$$g(x)=\frac{x^2}{x+1}$.

### Solution

As $\sin \pi x$ is defined everywhere, $f(x)$ is defined as long as the denominator, $x^2+3x+2\neq0$. Now

$x^2+3x+2=x^2+2x+x+2=x(x+2)+1(x+2)=(x+1)(x+2)$,

therefore $x^2+3x+2\neq0\Leftrightarrow x\neq -1,-2$. So $f(x)$ is defined for all $x\in\mathbb{R}$ except $x=-1,-2$. As $x+\sin\pi x$ is continuous (as the sum of a polynomial and a sine) and $x^2+3x+2$ is continuous (as a polynomial), $f(x)$ is continuous as long as $x^2+3x+2\neq 0\Leftrightarrow x\neq-1,-2$.

Similarly $g(x)$ is defined for, and continuous at, all $x+1\neq0\Leftrightarrow x\neq -1$.

By evaluating $f(0)$ and $f(2)$, show that there is a solution to the equation $12(x+\sin\pi x)=x^2+3x+2$.

### Solution

$f(0)=0$ and $f(2)=1/6$. As $f$ is continuous on the interval $[0,2]$$f$ satisfies the hypothesis of the Intermediate Value Theorem on $[0,2]$:

As $f$ is continuous, it takes all values between  $0$ and  $1/6$ — this is the Intermediate Value Theorem

Now, looking at the equation:

$12(x+\sin\pi x)=x^2+3x+2$

$\Leftrightarrow f(x)= \frac{x+\sin\pi x}{x^2+3x+2}=\frac{1}{12}$,

for $x\neq-1,-2$ which is certainly the case here in $[0,2]$. Now $0\leq 1/12\leq 1/6$ so by the Intermediate Value Theorem, there exists a $c\in [0,2]$ such that $f(c)=1/12$ — which is equivalent to $12(x+\sin\pi x)=x^2+3x+2$ having a solution.

Evaluate $g(-2)$ and $g(0)$, but show that there is no (real) solution to the equation $g(x)=-2$ lying in the interval $(-2,0)$. What is different to your analysis of $f(x)$?

$g(-2)=-4$ and $g(0)=0$.

Let us find all solutions to $g(x)=-2$.

$\frac{x^2}{x+1}=-2$

$\Rightarrow x^2=-2x-2$,

which is fine as long as $x\neq -1$ (if $x=-1$$g(-1)$ is undefined so certainly not equal to $-2$.)

$x^2+2x+2=0$

$\Rightarrow x_{\pm}=\frac{-2\pm\sqrt{4-4(2)}}{2}=\frac{-2\pm\sqrt{-4}}{2}\not\in\mathbb{R}$.

That is there are no real solutions to $g(x)=-2$, in particular in the interval $(-2,0)$.

Although $g(-2)=-4$ and $g(0)=0$, suggesting a $c\in (-2,0)$ such that $g(c)=-2$$g$ does not in fact satisfy the hypothesis of the Intermediate Value Theorem on $[-2,0]$ as it is not continuous at $x=-1$ and thus not continuous on $[-2,0]$.

Advertisement