## Tutorial: Trigonometric functions, models, and regression

This tutorial: Part A: Modeling with the sine function

What is the sine function?

Take a look at the following graph, which shows the month-by-month average temperature in Germany over a period of two years.
**sinusoidal**curve, which is the type of curve that can model many kinds of cyclical behavior, from the propogation of light and osciallating springs in physics to sales and employment patters in economics. Sinusoidal curves are based on the

**sine**function: Imagine a stationary bicycle with a wheel of radius is one unit, with a marker attached to its rim, as shown in the following figure.

**The sine function**

**Bicycle wheel definition**

If a wheel of radius 1 unit rotates counterclockwise at a speed of 1 unit of length per second, and at time $t=0$ is in the position shown in the figures above, then its height after $t$ seconds is given by

#[$h(t) = \sin(t).$][$h(t) = \text{sen}(t).$]#

**Geometric definition**

The

**sine**of a real number $t$ is given by the $y$âˆ’coordinate (height above the $x$-axis) of the point $P$ in the following diagram, in which $t$ is the length of the arc shown.

**#[Notes][Notas]#:**

- The diagram shows how to find the sine of $t$ for positive $t$. For negative $t$, we rotate the wheel counterclockwise, so the point $P$ initially moves downward, and the $y$-coordinate $\sin(t)$ is the negative of the value for positive $t$ (move the point on the interactive wheel clockwise to see how). So, $\sin(-t) = -\sin(t)$.
- We can also think of the quantity $t$ as measuring the angle $QOP$ it spans; the quantity $t$ it is then the
**radian measure**of the angle $Q0P$, and $\sin(t)$ is also called the**sine of the angle $t$ radians.**

**#[Graph][Gráfica]#:**

*y*= #[sin][sen]#(*t*)*amplitude*of 1.

**#[Examples][Ejemplos]#**As the circumference of the entire circle is $2\pi$, when $t = 2\pi$, the point $P$ has moved around the entire circle, bringing it back tp its initial position on the $x$-axis at a height of $0$. Thus,

#[$\sin(2\pi) = 0$][$\text{sen}(2\pi) = 0$]# \gap[20] \t $2\pi$ #[constitutes a complete revolution, or 360°.][constituye una completa revolución, o 360°.]#

Similarly, when the point $P$ has moved a quarter of the way around the circle, a distance of $\dfrac{2\pi}{4} = \dfrac{\pi}{2}$, it makes an angle of 90° with the positive $x$-axis and it is at its highest position, so
#[$\sin\left(\dfrac{\pi}{2}\right) = 1$][$\text{sen}\left(\dfrac{\pi}{2}\right) = 1$]# \gap[20] \t $\dfrac{\pi}{2}$ #[constitutes a quarter of a revolution, or 90°.][constituye un cuarto de revolución, o 90°.]#

A negative value of $t$ would correspond to moving the point $P$ *clockwise*through a distance of $|t|$. So, for instance, $t = -\dfrac{\pi}{2}$ would move it down to the right, quarter way around the circle to the lowest point, so

#[$\sin\left(-\dfrac{\pi}{2}\right) = -1$][$\text{sen}\left(-\dfrac{\pi}{2}\right) = -1$]# \gap[20] \t $-\dfrac{\pi}{2}$ #[is the radian measure of the angle −90°.][es la medida en radianes del ángulo −90°.]#

**Note**It is common to write $\sin(x)$ without parentheses as $\sin x$ in the same way as we write $\log(x)$ as $\log x$ (and we will often do that here). However, when entering $\sin(x)$ as a formula in spreadsheets and calculators (and also this tutorial!) one should always use the parentheses.

**Some for you**

Transforming the sine function

To use the sine function to model real world phenomena like monthly temperatures or propagating light waves, we need to manipulate the sine curve along the lines of what we do with general functions in New functions from old: Scaled and shifted functions
**Transformations of the sine function**

**Amplitude**

Multiplying $\sin(x)$ by a positive constant $A$ causes its graph to oscillate between $A$ and $-A$ instead of between $1$ and $-1$. For instance, the following graph shows $2\sin(x)$ (plotted in red).

$y = \sin(x) \qquad \qquad \qquad$$y = 2\sin(x)$

**amplitude $2$.**

**Vertical shift**

Adding a quantity $C$ to $\sin(x)$ causes its graph to shift upwards by $C$. (If $C$ is negative, this is understood to mean shifting

*downward*by $|C|$.) For instance, the following graph shows $1/2 + \sin(x)$ (plotted in red).

$y = \sin(x) \qquad \qquad \qquad$$y = 1/2 + \sin(x)$

**Horizontal shift**

If $a$ is positive, then replacing $x$ by $x-a$ causes the graph of $\sin(x)$ to shift right by $a$ units, and replacing $x$ by $x+a$ causes the graph to shift

*left*by $a$ units. For instance, the following graph shows $\sin(x-\pi/4)$ (plotted in red).

$y = \sin(x) \qquad \qquad \qquad$$y = \sin (x-\pi/4)$

**Angular frequency**

If $\omega$ is positive, then replacing $x$ by $\omega x$ results in $\sin(\omega x)$, which oscillates $\omega$ times as fast as $\sin(x)$. For instance, the following graph shows $\sin(2x)$ (plotted in red).

$y = \sin(x) \qquad \qquad \qquad$$y = \sin(2x)$

**angular frequency $2$.**

Angular frequency and period

We saw above that the graph of the sine function repeats every $2\pi$ units. This means that increasing or decreasing $x$ by $2\pi$ results in the same $y$-coordinate:
$\sin(x \pm 2\pi) = \sin(x)$

**period**of $P = 2\pi$. We also saw that multiplying $x$ by $2$ led to a graph that oscillates twice as fast as that of $\sin(x)$, so the period gets cut in half. In other words, the period of $\sin(2x)$ is $P = \dfrac{2\pi}{2} = \pi$.

Period $P=\pi:$

$\sin(2(x \pm \pi)) = \sin(2x)$

$\sin(2(x \pm \pi)) = \sin(2x)$

*angular frequency*of oscillation. In general we can say][Recuerda que llamamos al múltiplo $2$ en $\text{sen}(2x)$ su

*frecuencia angular*de oscilación. Por lo general podems decir]#:

**Relationship between angular frequency and period**#[The period $P$ and angular frequency $\omega$ of oscillation are related by][El periodo $P$ y la frecuencia angular $\omega$ de oscilación están relacionados por]#

$P = \dfrac{2\pi}{\omega}$.

#[For instance, the function $\sin(3x)$ has period of oscillation][Por ejemplo, la función $\text{sen}(3x)$ tiene periodo de oscilación]# $P = \dfrac{2\pi}{3}$.
#[We can rewrite the above formula by solving for $\omega$ to get][Podemos reescribir la fórmula anterior resolviendo $\omega$ para obtener]#
$\omega = \dfrac{2\pi}{P}$.

#[For instance, if we want a function with period 1, we need to multiply $x$ by][Por ejemplo, si queremos una función con período 1, necesitamos multiplicar $x$ por]# $\omega = \dfrac{2\pi}{1} = 2\pi$ #[to get][para obtener]#
#[$\sin(\omega x) = \sin(2\pi x). \qquad$][$\text{sen}(\omega x) = \text{sen}(2\pi x). \qquad$]# #[The function $\sin(2\pi x)$ has period 1.][La función $\text{sen}(2\pi x)$ has periodo 1.]#

**#[Examples][Ejemplos]#**

**1.**$f(x) = \sin\left(\dfrac{x}{4}\right)$ #[has period][tiene periodo]# $P = \dfrac{2\pi}{\omega} = \dfrac{2\pi}{1/4} = 8\pi.$ \\

**2.**$g(x) = \sin\left(\dfrac{x}{4} + 9\right)$ #[also has period][también tiene periodo]# $8\pi.$ \t

#[(2) is a horizontally shifted form of (1).][(2) es una forma desplazada horizontalmente de (1).]#

\\ **3.**$f(t) = 8\sin\left(\dfrac{\pi t}{6}\right)$ #[has period][tiene periodo]# $P = \dfrac{2\pi}{\omega} = \dfrac{2\pi}{\pi/6} = 12$. \t

#[The amplitude does not affect the period.][La amplitud no afecta el periodo.]#

\\ **4.**$f(t) = 8\sin\left(\dfrac{\pi}{6}(t-4)\right)$ #[also has period 12.][también tiene periodo 12.]# \t

#[(4) obtained from (3) by shifting it to the right by 4 units.][(4) se obtiene de (3) desplazándolo hacia la derecha en 4 unidades.]#

**Some for you**

Modeling with the sine function

Take another look at the graph showing the average temperature in Germany over two years:
**Generalized sine function**#[A

**generalized sine function**has the following form.][Una

**función seno generalizada**tiene la siguiente forma.]#

$f(x) = A\sin\left[\omega(x-\alpha)\right] + C$

#[Thus,][Por lo tanto,]#
- $A = {}$
**#[amplitude][amplitud]#** - $\omega = {}$
**#[angular frequency][frecuencia angular]#** - $\alpha = {}$ #[
**phase shift**(horizontal offset; the graph first crosses the baseline $\alpha$ units to the right of the $y$-axis).][**cambio de fase**(desplazamiento horizontal; la gráfica primero cruza la línea base $\alpha$ unidades a la derecha del eje $y$).]# - $C = {}$ #[
**vertical offset**(the graph is moved $C$ units up).][**desplazamiento vertical**(la gráfica se mueve $C$ unidades hacia arriba).]#

**#[Graph of ][Gráfica de ]# $\bold{f(x) = A\sin\left[\omega(x-\alpha)\right] + C}$**

$\displaystyle A = \frac{\text{highest value} - \text{lowest value}}{2} \qquad \omega = \frac{2\pi}{P} \qquad \alpha = \beta - \frac{P}{4}$

#[$C = {}$ height of baseline: Average of highest and lowest values][$C = {}$ altura de la línea base: promedio de los valores alto y bajo]#

#[$C = {}$ height of baseline: Average of highest and lowest values][$C = {}$ altura de la línea base: promedio de los valores alto y bajo]#

**Note**Increasing or decreasing $\alpha$ (or $\beta$) by the period $P$ or multiples of $P$ has no effect on the graph (and will be permitted in the interactive exercises) as we would be moving it horizontally that distance. For convenience we are using the lowest nonnegative value for $\alpha$ as shown in the graph.

**#[Example][Ejemplo]#**To model the average temperature in Germany, we use the formulas above.

$\displaystyle A = \frac{\text{highest value} - \text{lowest value}}{2} \approx \frac{20 - 0}{2} = 10$
\\ $P = 12$
\\ $\displaystyle \omega = \frac{2\pi}{P} = \frac{2\pi}{12} = \frac{\pi}{6}$
\\ $\displaystyle \alpha = \beta - \frac{P}{4} \approx 6 - \frac{12}{4} = 3$
\\ $C = {}$ #[Average of highest and lowest values][promedio de los valores alto y bajo]# $\displaystyle \approx \frac{20+0}{2} = 10$.

#[Thus, our approximate model is][Por lo tanto, nuestro modelo aproximado es]#
$f(t)$ \t $\displaystyle {} = A\sin\left[\omega(t-\alpha)\right] + C$
\\ \t $\displaystyle {} =10\sin\left[\frac{\pi}{6}(t-3)\right] + 10$.

Now try the exercises in Section 2.5 in

*Finite Mathematics and Applied Calculus*. or move ahead to the next tutorial by pressing "Next tutorial" on the sidebar.*January 2023*

Copyright © 2022 Stefan Waner and Steven R. Costenoble