# Given the function f(x) = |x^2 -3x -4|, write a f(x) as a piece wise function on [-10,10]

*print*Print*list*Cite

We can define the absolute value of a function as ` ``|f(x)|={[f(x),f(x)>0],[0,f(x)=0],[-f(x),f(x)<0]} ` .

Given `f(x)=|x^2-3x-4| ` :

Consider `f(x)=x^2-3x-4=(x-4)(x+1) `

The function is divided into 3 areas: to the left of x=-1, from x=-1 to x=4, and to the right of x=4. At x=-1,x=4 the value of the function is 0.

For x<-1, f(x)>0

For -1<x<4, f(x)<0

For x>4, f(x)>0

(To see this, try substituting values in the intervals. That is, f(-2)=6>0,f(0)=-4<0,f(5)=6>0 where -2,0,5 are arbitrary (your choice) values of x in the intervals of interest.)

Using the definition of the absolute value of the function, we can write `f(x)=|x^2-3x-4| ` as:

`f(x)={[x^2-3x-4,x<-1],[0,x=-1],[-x^2+3x+4,-1<x<4],[0,x=4],[x^2-3x-4,x>4]} `

There are alternative ways to write this, such as:

`f(x)={[x^2-3x-4,x<=-1],[-(x^2-3x-4),-1<x<4],[x^2-34-4,x>=4]} `

The graph:

********************************************************************************************

Using the given domain [-10,10] we can write the function `f(x)=|x^2-3x-4| ` as:

`f(x)={[x^2-3x-4,-10<=x<=-1],[-(x^2-3x-4),-1<x<4],[x^2-3x-4,4<=x<=10]} `

********************************************************************************************

**Another way to see this graphically, is that from x+-1 to x=4 we have the reflection of the graph of f(x) across the x-axis. The reflection of the graph of any function f(x) can be found by graphing -f(x).

Here the black graph is of f(x), the red graph is -f(x), and the green graph is |f(x)|. The green graph includes the parts of f(x) to the left of -1 and to the right of 4, while it includes the graph of -f(x) from -1 to 4.