How do you graph #g(x) = abs(2 + x) - 1#?
2 Answers
g(x)=y= |2+1| - 1 , you might know! graph{g(x)=2 lx+2l -4 [-2.732, 2.744, -1.366, 1.372]}
Explanation:
To plot a graph, we need the coordinates. For 2D graph, like your problem, we need x coordinate and y coordinate .
Your given function is g(x)= | 2+x | -1 . You might know g(x) is the function of "x". This means its the thing which determines the "y" coordinate for each value of x . So you can write g(x)=y=| 2+x | -1.
Now its just piece of cake. Take the values of x (as you wish!). Take at least 2 values, so you will have "two points" and you can draw a "straight line" , which is your desired graph of the function.
Here's the example :
1. If x=0 , g(x)=y= | 2+0 |-1= 2-1 = 1 . So 1st point A(0,1)
2. If x=1 , y=|2+1| -1= 2. So 2nd point B(1,2)
Now plot them in the graph , add them (don't extend the line. just add the points with a line )
- If x=-1, y=|2+(-1)| -1=0 . Point 3 C(-1,0)
Now you plot it. You must've noticed that its colinear with the previous points.
Two points was enough. Then why we took 3 points? - To be sure that we're correct with our calculations. And as you take more negative values of x, the graph will bump up again and continue in the 2nd quadrant. So the the graph will be "V" shape.
Its important while you work with many weird looking functions .
Now can you tell me what will be the graph of this function ?
f(x)= |x|
What's the difference between g(x) and f(x) ?
The graph will have a V shape.
Explanation:
Substitute
Determine points on the graph by substituting positive and negative values for
Plot the points. The graph will have a V shape. Draw straight lines through the points on both halves of the graph.
graph{y=abs(2+x)-1 [-10, 10, -5, 5]}