# How do you draw the graph of y=2-cosx for 0<=x<2pi?

May 30, 2018

See below

#### Explanation:

This excercise involves function transformations. It means that you start from a function whose graph is known, and tranform it. Let's see what the transformations are and how they affect the graph:

Transformation 1: sign change

As a first step, we change from $\cos \left(x\right)$ to $- \cos \left(x\right)$. In general, everytime you change from $f \left(x\right)$ to $- f \left(x\right)$ you reflect the graph vertically, with respect to the $x$ axis. Here is the transformation:

Original function $f \left(x\right) = \cos \left(x\right)$
graph{cos(x) [-0.2,6.48,-1.2,3.2]}

Reflected function $- f \left(x\right) = - \cos \left(x\right)$
graph{-cos(x) [-0.2,6.48,-1.2,3.2]}

Transformation 2: vertical shift

The next transformation is represented by an additive constant: you change from $- \cos \left(x\right)$ to $- \cos \left(x\right) + 2$. In general, everytime you change from $f \left(x\right)$ to $f \left(x\right) + k$ you have a vertical translation, $k$ units up if $k > 0$, down otherwise. In this case, we have a translation of $2$ units up. Here is the transformation:

Original function $f \left(x\right) = - \cos \left(x\right)$
graph{-cos(x) [-0.2,6.48,-1.2,3.2]}

Shifted function $- f \left(x\right) = - \cos \left(x\right) + 2$
graph{-cos(x)+2 [-0.2,6.48,-1.2,3.2]}