# Math Help - Piecewise Function problem

1. ## Piecewise Function problem

Let f(x) =

(0) if x< 0
(x) if 0 <= x <= 1
(2 - x) if 1 < x <= 2
(0) if x > 2

and g(x) = [integrate] f(t)dt on [0, x]

i) Find an expression for g(x) similar to the one for f(x).

ii) Where is f differentiable? Where is g differentiable?

I'm pretty much stuck, and don't know how to start this question.
I know first of all that by the fundamental theorem of Calculus, g'(x) = f(x).

But from that, how do I figure out an expression for g(x) from the piecewise function?

Any and all help is appreciated here.

2. Originally Posted by Tulki
Let f(x) =

(0) if x< 0
(x) if 0 <= x <= 1
(2 - x) if 1 < x <= 2
(0) if x > 2

and g(x) = [integrate] f(t)dt on [0, x]

i) Find an expression for g(x) similar to the one for f(x).

ii) Where is f differentiable? Where is g differentiable?

I'm pretty much stuck, and don't know how to start this question.
I know first of all that by the fundamental theorem of Calculus, g'(x) = f(x).

But from that, how do I figure out an expression for g(x) from the piecewise function?

Any and all help is appreciated here.
i)

for $x < 0$, $f(x) = 0$ and $g(x) = \int f(t) ~dt = 0$

for $0 \leq x \leq 1$, $f(x) = x$ and $g(x) = \int_{0}^{x} f(t) ~dt = \int_{0}^{x} t ~dt = \frac{1}{2}x^2$

for $1 < x \leq 2$, $f(x) = 2 - x$ and $g(x) = \int_{0}^{x} f(t) ~dt = \int_{0}^{1} f(t) ~dt + \int_{1}^{x} f(t) ~dt=$ $\int_{0}^{1} t ~dt + \int_{1}^{x} (2-t) ~dt= \frac{1}{2} + (2x - 2) - (\frac{1}{2}x^2 - \frac{1}{2})$

for $x > 2$

3. Hello, Tulki!

Here's part (a).
Did you make a sketch?

$\text{Let }\:f(x) \;=\;\left\{\begin{array}{cccc}0 && x < 0 \\ \\[-4mm]
x && 0 \leq x \leq 1 \\ \\[-4mm]
2 - x && 1 < x \leq 2 \\ \\[-4mm]
0 && x > 2 \end{array}\right\}$

and: . $g(x) \:=\: \int_0^x f(t)\,dt$

a) Find an expression for $g(x)$ similar to the one for $f(x).$

$g(x)$ gives the area under the graph from $0\text{ to }x$

The graph looks like this:
Code:
          |
|
1+       *
|     *:::*
|   *:::::::*
| *:::::::::| *
- * * * - - - * - + - * * * - -
0       1   x   2

Then: . $\displaystyle g(x) \;=\;\left\{ \begin{array}{cccc}
0 && x < 0 \\ \\[-3mm]
\int^x_0t\,dt && 0 \leq x \leq 1 \\ \\[-2mm]
\frac{1}{2} + \int^x_1 (2-t)\,dt && 1 < x \leq 2 \\ \\[-3mm]
1 && x > 2
\end{array} \right\}$

4. Because all of the graphs are straight lines, you don't really need to integrate, just find the areas of the polygons involved.

For x< 0, f(x)= 0 so its integral is 0 (and its graph is just the x-axis so there is 0 area).

For x between 0 and 1, y= x so the "area under the curve" is the area of a right triangle with base x and height x: its area is $\frac{1}{2}x^2$.

For x between 1 and 2, y= 2- x and we can break the "area under the currve" from 0 to x into two parts: The area of the right triangle with base 1 and height 1 is $\frac{1}{2}(1)(1)= \frac{1}{2}$. The area from 1 to x is a trapezoid with bases 1 and 2-x and height x. It's area is $\frac{2-x+ 1}{2}x= \frac{(3-x)x)}{2}= \frac{3x- x^2}{2}$.
The total area is $\frac{1}{2}+ \frac{3x- x^2}{2}= \frac{1+ 3x- x^2}{2}$. AT x= 2, the integral is the entire area of a triangle with base 2 and height 1 which is 1.

For x> 2, the graph is again the x-axis so no new area is added. For all x> 2, the function is the constant 1.

5. Thank you very much, all of you!

I suppose it was only the piecewise function that scared me. Graphing it DOES indeed help greatly. The pieces of the function are pretty darn simple, in retrospect.