# Graphing Sine and Cosine

## Key Questions

• The domain of a function $f \left(x\right)$ are all the values of $x$ for which $f \left(x\right)$ is valid.

The range of a function $f \left(x\right)$ are all the values which $f \left(x\right)$ can take on.

$\sin \left(x\right)$ is defined for all real values of $x$, so it's domain is all real numbers.

However, the value of $\sin \left(x\right)$, its range , is restricted to the closed interval [-1, +1]. (Based on definition of $\sin \left(x\right)$.)

• The maximum value of the function $\cos \left(x\right)$ is $1$.

This result can be easily obtained using differential calculus.

First, recall that for a function $f \left(x\right)$ to have a local maximum at a point ${x}_{0}$ of it's domain it is necessary (but not sufficient) that ${f}^{p} r i m e \left({x}_{0}\right) = 0$. Additionally, if ${f}^{\left(2\right)} \left({x}_{0}\right) < 0$ (the second derivative of f at the point ${x}_{0}$ is negative) we have a local maximum.

For the function $\cos \left(x\right)$:

$\frac{d}{\mathrm{dx}} \cos \left(x\right) = - \sin \left(x\right)$

${d}^{2} / {\mathrm{dx}}^{2} \cos \left(x\right) = - \cos \left(x\right)$

The function $- \sin \left(x\right)$ has roots at points of the form $x = n \pi$, where $n$ is an integer (positive or negative).

The function $- \cos \left(x\right)$ is negative for points of the form $x = \left(2 n + 1\right) \pi$ (odd multiples of $\pi$) and positive for points of the form $2 n \pi$ (even multiples of $\pi$).

Therefore, the function $\cos \left(x\right)$ has all it's maximums at the points of the form $x = \left(2 n + 1\right) \pi$, where it takes the value $1$.

• Since the function passes from the origin, in fact $\sin 0 = 0$,
the y-intercept is $0$.

graph{sinx [-10, 10, -5, 5]}