# Thread: Sin and Cos Graph

1. ## Sin and Cos Graph

2. Originally Posted by Mr_Green
The general form will be
$\displaystyle y = A sin(kx + \phi)$

Since A is the amplitude, this part is easy: A = 3.

$\displaystyle y = 3 sin(kx + \phi)$

Now, we want a 0 of the sine function to be positioned at $\displaystyle x = - \frac{\pi}{2}$. We can do this by setting $\displaystyle kx + \phi = 0$ at $\displaystyle x = - \frac{\pi}{2}$, so we have the equation:
$\displaystyle k \left ( - \frac{\pi}{2} \right ) + \phi = 0$

Again, we want a 0 of the sine function to be positioned at $\displaystyle x = \frac{3 \pi}{2}$. We can do this by setting $\displaystyle kx + \phi = \pi$ ($\displaystyle \pi$ is the next zero for the sine function after 0) at $\displaystyle x = \frac{3 \pi}{2}$, so we have the equation:
$\displaystyle k \left ( \frac{3 \pi}{2} \right ) + \phi = 0$

Solving the first equation for $\displaystyle \phi$ gives:
$\displaystyle \phi = \frac{\pi}{2}k$

Inserting this into the second equation gives:
$\displaystyle \frac{3\pi}{2}k + \frac{\pi}{2}k = \pi$
or
$\displaystyle k = \frac{1}{2}$

This gives
$\displaystyle \phi = \frac{\pi}{4}$.

Thus
$\displaystyle y = 3 sin \left ( \frac{1}{2}x + \frac{\pi}{4} \right )$.

-Dan

3. Thanks!

4. Originally Posted by Mr_Green
THANKS!

FOR COS WOULD IT BE:

3cos(.5x+pi/4)

???
Close. You can do that in two ways. The first is to do it the same way I did below, except to use
$\displaystyle -\frac{\pi}{2}k + \phi = -\frac{\pi}{2}$ ($\displaystyle -\frac{\pi}{2}$ is a convenient first zero for cos)

$\displaystyle \frac{3\pi}{2}k + \phi = \frac{\pi}{2}$ (the next zero for cos after $\displaystyle -\frac{\pi}{2}$)

The other way is to recall that $\displaystyle sin(\theta) = cos(\theta - \pi/2)$ so to switch to cosine we need to "shave" a $\displaystyle \pi/2$ off the argument.

Either way I got:
$\displaystyle y = 3 cos \left ( \frac{1}{2}k - \frac{\pi}{4} \right )$

-Dan