# Thread: Sketch the graph of a continuous function

1. ## Sketch the graph of a continuous function

Hi again I'm tackling a question that is very likely to be on a future exam, and I'm a bit stuck.

The question:

g(x){ 0 if x<2
2 if 2<x<4
-1 if x>4

Sketch the graph of a continuous function f(x) knowing that f(0)=1, and f'(x) = g(x)

Graphing g(x) is not a problem, but understanding how to formulate a seperate function with just the info given is a major roadblock.

2. Originally Posted by ughintegrals
Hi again I'm tackling a question that is very likely to be on a future exam, and I'm a bit stuck.

The question:

g(x){ 0 if x<2
2 if 2<x<4
-1 if x>4

Sketch the graph of a continuous function f(x) knowing that f(0)=1, and f'(x) = g(x)

Graphing g(x) is not a problem, but understanding how to formulate a seperate function with just the info given is a major roadblock.

If $
g(x) = \left\{
\begin{array}{cl}
0 & \text{if}\; x < 2\\
2 & \text{if}\; 2 < x < 4\\
-1 & \text{if}\; x > 4
\end{array}\right.
$

then

$
f(x) = \left\{
\begin{array}{cl}
c_1 & \text{if}\; x \le 2\\
2x + c_2 & \text{if}\; 2 < x \le 4\\
-x + c_3 & \text{if}\; x > 4
\end{array}\right.
$
.

Then use the fact that $f(0) = 1$ (this gives you $c_1$) and that $f(x)$ is continuous at $x = 2$ and $x = 4$ (this gives the remaining constants.)

3. ugh, im almost there.

c1 was no sweat, but how am i supposed to use the x= 2 and x = 4 to solve the remaining constants? plug 2 into the 2x+c, or equate it to 2? or neither?

im just a bit stuck there....sorry for being difficult.