Who are you?

114 days ago by eviatarbach

Who are you?

By Waffles, Tim, Natha\pi, and \Sigmaviatar

Effect of B on sin and cos functions

Changing the value of B does not change the range, since it is creates a horizontal expansion or compression. The domain doesn't change with different values of B since it is already -\infty \leq x \leq \infty; dividing it by an integer (unless it's 0) does not change its value. The wavelength (or period) is \frac{2 \pi}{|B|}, since one is compressing or expanding it by a factor of B, and the regular period is 2 \pi. We divide by the absolute value of B since one cannot have a negative period.

The following table shows the effect of different B values on range, domain, wavelength, and graphs of sine and cosine functions.

%hide html.table([('$%s$'%latex(B), '$-1 \leq y \leq 1$', '$x \in \mathbb{R}$', '$%s$'%latex((2*pi)/abs(B)), plot(sin(B*x), xmin=-2*pi, xmax=2*pi, tick_formatter=pi, ticks=pi/2, figsize=[4,2]), plot(cos(B*x), xmin=-2*pi, xmax=2*pi, tick_formatter=pi, ticks=pi/2, figsize=[4,2])) for B in [-2,-1,-1/2,1/2,1,2]], header=('$B$', '$\mathrm{Range}$', '$\mathrm{Domain}$', '$\mathrm{Wavelength}$', '$\sin(B \cdot x)$', '$\cos(B \cdot x)$')) 
       
B \mathrm{Range} \mathrm{Domain} \mathrm{Wavelength} \sin(B \cdot x) \cos(B \cdot x)
-2 -1 \leq y \leq 1 x \in \mathbb{R} \pi
-1 -1 \leq y \leq 1 x \in \mathbb{R} 2 \, \pi
-\frac{1}{2} -1 \leq y \leq 1 x \in \mathbb{R} 4 \, \pi
\frac{1}{2} -1 \leq y \leq 1 x \in \mathbb{R} 4 \, \pi
1 -1 \leq y \leq 1 x \in \mathbb{R} 2 \, \pi
2 -1 \leq y \leq 1 x \in \mathbb{R} \pi
B \mathrm{Range} \mathrm{Domain} \mathrm{Wavelength} \sin(B \cdot x) \cos(B \cdot x)
-2 -1 \leq y \leq 1 x \in \mathbb{R} \pi
-1 -1 \leq y \leq 1 x \in \mathbb{R} 2 \, \pi
-\frac{1}{2} -1 \leq y \leq 1 x \in \mathbb{R} 4 \, \pi
\frac{1}{2} -1 \leq y \leq 1 x \in \mathbb{R} 4 \, \pi
1 -1 \leq y \leq 1 x \in \mathbb{R} 2 \, \pi
2 -1 \leq y \leq 1 x \in \mathbb{R} \pi

When |B| < 1, a horizontal expansion occurs, as can be seen in the graphs. This can be understood using a table of values:

%hide html.table([(a, n(sin(a))) for a in srange(-2,3)], header=['$x$', '$\sin(x)$']) html.table([(a, n(sin((1/2)*a))) for a in srange(-2,3)], header=['$x$', r'$\sin(\frac{1}{2} x)$']) 
       
x \sin(x)
-2 -0.909297426825682
-1 -0.841470984807897
0 0.000000000000000
1 0.841470984807897
2 0.909297426825682
x \sin(\frac{1}{2} x)
-2 -0.841470984807897
-1 -0.479425538604203
0 0.000000000000000
1 0.479425538604203
2 0.841470984807897
x \sin(x)
-2 -0.909297426825682
-1 -0.841470984807897
0 0.000000000000000
1 0.841470984807897
2 0.909297426825682
x \sin(\frac{1}{2} x)
-2 -0.841470984807897
-1 -0.479425538604203
0 0.000000000000000
1 0.479425538604203
2 0.841470984807897

We can see that some numbers have switched positions; f(1) is now at f'(2), and f(-1) is now at f'(-2).

B affects the x values, making them a fraction B of what they originally were. When B=\frac{1}{2}, it expands the graph by a factor of 2 because each x value has to be twice as large to yield the same y value.

Conversely, when |B| > 1, a horizontal compression occurs. For example, when B=2, it compresses the graph by a factor of \frac{1}{2}, since each x value has to be half as large to yield the same y value.

%hide html.table([(a, n(sin(a))) for a in srange(-2,3)], header=['$x$', '$\sin(x)$']) html.table([(a, n(sin((2)*a))) for a in srange(-2,3)], header=['$x$', r'$\sin(2 x)$']) 
       
x \sin(x)
-2 -0.909297426825682
-1 -0.841470984807897
0 0.000000000000000
1 0.841470984807897
2 0.909297426825682
x \sin(2 x)
-2 0.756802495307928
-1 -0.909297426825682
0 0.000000000000000
1 0.909297426825682
2 -0.756802495307928
x \sin(x)
-2 -0.909297426825682
-1 -0.841470984807897
0 0.000000000000000
1 0.841470984807897
2 0.909297426825682
x \sin(2 x)
-2 0.756802495307928
-1 -0.909297426825682
0 0.000000000000000
1 0.909297426825682
2 -0.756802495307928

We can conclude that if  |B| > 1, a horizontal compression by a factor of \frac{1}{B} occurs, and when  |B| < 1, a horizontal expansion by a factor of B occurs.

Whether B is negative also has an impact on the function. From the tables, we can see that sin(B \cdot x)=-sin(-B \cdot x); in other words, when the sign of B is flipped, the sign of the corresponding y value is as well. This corresponds to a horizontal reflection. While the same equality is not true for cosine, a horizontal reflection also occurs, but since it is symmetrical no change in y values occurs.

Deducing functions of graphs

Transformations to functions can be understood as the following:

f(x) = A f[B(x-d)] + c, where:

  • A is the amplitude. The amplitude of a wave (at least, a non-translated one) is the height from the x-axis to the its maximum, which, for sinusoidal functions, is also the same as \frac{\max{f(x)} - \min{f(x)}}{2}. Alternatively, it is the vertical expansion/compression. 
  • B is the horizontal expansion/compression. Can also be expressed as \frac{2\pi}{\lambda}, where \lambda is the wavelength
  • d is the horizontal translation
  • c is the vertical translation
%hide html(r'$f(x)=2\sin(4x-\frac{\pi}{6})-3$') plot(2*sin(4*x-pi/6)-3, xmin=-3*pi, xmax=3*pi, ymax=5, ymin=-5, ticks=(pi, 2.5), tick_formatter=pi) 
       
f(x)=2\sin(4x-\frac{\pi}{6})-3
f(x)=2\sin(4x-\frac{\pi}{6})-3
  • Since minimum y value equals -5 and maximum y value equals -1, amplitude must equal 2
  • Since it intersects the y-axis with a positive slope, a sine function was used
  • Deduced from graph that period equals \frac{\pi}{2}, therefore, horizontal compression equals 4
  • Deduced from graph that phase shift equals \frac{\pi}{6} right
  • Deduced from the graph that vertical shift equals 3 units down
%hide html(r'$f(x)=\frac{1}{2}\sin(3x)+2$') plot((1/2)*sin(3*x)+2, xmin=-3*pi, xmax=3*pi, ymax=5, ymin=-5, ticks=(pi, 2.5), tick_formatter=pi) 
       
f(x)=\frac{1}{2}\sin(3x)+2
f(x)=\frac{1}{2}\sin(3x)+2
  • Since minimum y value is 1.5 and maximum y-value is 2.5, amplitude equals 0.5 (\frac{1}{2})
  • Since it intersects the y-axis with a positive slope, a sine function was used
  • Deduced from graph that period equals \frac{2\pi}{3}, therefore, horizontal compression equals 3
  • No phase shift present
  • Deduced from graph that vertical shift equals 2 units up
%hide html(r'$f(x)=\frac{1}{2}\sin(\frac{1}{2}x-\frac{\pi}{4})$') plot((1/2)*sin((1/2)*x-pi/4), xmin=-3*pi, xmax=3*pi, ymax=5, ymin=-5, ticks=(pi, 2.5), tick_formatter=pi) 
       
f(x)=\frac{1}{2}\sin(\frac{1}{2}x-\frac{\pi}{4})
f(x)=\frac{1}{2}\sin(\frac{1}{2}x-\frac{\pi}{4})
  • Since minimum y value equals -0.5 and maximum y value equals 0.5, amplitude equals 0.5 (\frac{1}{2})
  • Since it intersects the y-axis with a positive slope, a sine function was used
  • Deduced from graph that period equals 4\pi, therefore, horizontal expansion equals \frac{1}{2}
  • Deduced from graph that there is a phase shift of \frac{\pi}{4} units right
  • Deduced from graph that vertical shift equals 0
%hide html(r'$f(x)=5\cos(\frac{3}{2} x)+1$') plot(5*cos((3/2)*x)+1, xmin=-3*pi, xmax=3*pi, ymax=6, ymin=-5, ticks=(pi, 2.5), tick_formatter=pi) 
       
f(x)=5\cos(\frac{3}{2} x)+1
f(x)=5\cos(\frac{3}{2} x)+1
  • Since minimum y value equals -4 and maximum y value equals 6, amplitude equals 5
  • Since it intersects the y-axis with a zero slope, a cosine function was used
  • Deduced from graph that period equals \frac{4\pi}{3}, therefore, horizontal expansion equals \frac{3}{2}
  • No phase shift present
  • Deduced from graph that vertical shift equals 1 unit up