How do I graph piecewise functions?

Like f(x)= x+2 if x greater/equal than 0
x less than 0

Also, how do I write an equation of the line passing through (2,1) and is perpendicular to the line y= 1/2x+1

You helped a LOT on the second question, I forgot to change it to the negative reciprocal, so thanks! I can do the second one now. But I'm still not sure about the top question. I'm not sure how do graph piecewise functions. When you say from 0, do you mean from the origin?

f(x)={-x+3, if x <1

To graph a piecewise function like f(x), first, identify the different intervals and the corresponding functions for each interval.

For the given function f(x) = x + 2 if x ≥ 0, and x if x < 0, we have two intervals: x ≥ 0 and x < 0.

1. For x ≥ 0 (interval 1):
- Plot the points on the graph where x is greater than or equal to 0.
- For example, if you substitute x = 0 into the equation f(x) = x + 2, you get f(0) = 0 + 2 = 2. So, plot the point (0, 2).
- Choose another x-value, such as x = 1, and substitute it into the equation. f(1) = 1 + 2 = 3. Plot the point (1, 3).
- Continue this process to find other points, or you can use a slope-intercept form.

2. For x < 0 (interval 2):
- Plot the points on the graph where x is less than 0.
- In this case, the function is simply f(x) = x. Therefore, to find points, substitute negative x-values into the equation.
- For example, if you substitute x = -1 into the function f(x) = x, you get f(-1) = -1. Plot the point (-1, -1).
- Similarly, you can choose other negative x-values to find additional points.

Now, connect the points in each interval with a solid line. The graph of the piecewise function f(x) = x + 2 if x ≥ 0, and x if x < 0 will be composed of two lines, one for each interval.

Regarding the equation of the line passing through (2,1) and perpendicular to y = 1/2x+1:

To solve this, we need to determine the slope of the given line, which is in the slope-intercept form y = mx + b, where m is the slope. In this case, the slope is 1/2.

The slope of any line perpendicular to this line would be the negative reciprocal of the given slope. So, the negative reciprocal of 1/2 would be -2.

Now, we have the slope (-2) and a point (2,1) that the line goes through. We can use the point-slope form of the equation, y - y1 = m(x - x1), where (x1, y1) is the given point and m is the slope:

Substituting the values, we have:
y - 1 = -2(x - 2)

Simplifying:
y - 1 = -2x + 4

Or rearranging:
y = -2x + 5

So, the equation of the line passing through (2,1) and perpendicular to y = 1/2x+1 is y = -2x + 5.

You graph it in two regions

1) less than zero
2) from zero toward +inf.

You know the slope of the perpendicular line is -2 (the negative reciprocal of 1/2).

y=mx+b
y=-2x+b
Put in the point 2,1, and solve for b.
then you have slope and b, so you know the equation.