Find an equation of the tangent line to the curve at

y = cosx - sinx (pi, -1)

I found y'= -sinx - cosx

and used the equation of the tangent
y = mx +b

I input the values and get -1 - [(-sinx - cosx) * pi] = b

the answer says it is y = x - 1 - pi

I have no idea how the answer got that.

m= -sinPI-cosPI=1

y= x+b
-1=PI+b
b= -PI-1

y=x-pi-1

To find the equation of the tangent line to a curve at a given point, you need both the derivative of the function representing the curve and the coordinates of the given point. Let's break down the steps to find the equation of the tangent line:

1. Start with the given function: y = cos(x) - sin(x)

2. Differentiate the function to find its derivative:

y' = -sin(x) - cos(x)

You correctly found the derivative of the function.

3. Now, we have the slope of the tangent line, which is given by the value of the derivative at the given point. In this case, the given point is (π, -1), which means x = π and y = -1.

4. Substitute the x-coordinate of the given point into the derivative:

y' = -sin(π) - cos(π)
= 0 - (-1)
= 1

Therefore, the slope of the tangent line at this point is 1.

5. Now we can use the point-slope form of a linear equation, y = mx + b, where m is the slope and b is the y-intercept.

6. Plug in the values of the slope (m = 1) and the coordinates of the given point (x = π, y = -1) into the equation:

-1 = (1)(π) + b

7. Solve for b:

-1 = π + b
b = -1 - π
b = -π - 1

8. Therefore, the equation of the tangent line to the curve at (π, -1) is:

y = x - π - 1

So, the answer is y = x - 1 - π, which is equivalent to y = x - π - 1.