How to construct a periodic function ## f ## with period ## 4 ##?

In summary, to construct a periodic function \( f \) with a period of \( 4 \), one can start with a basic periodic function, such as a sine or cosine function, and adjust its parameters. The function can be defined over one period, typically from \( 0 \) to \( 4 \), and then extended to repeat every \( 4 \) units. For example, using a sine function: \( f(x) = \sin\left(\frac{\pi}{2}x\right) \) will have a period of \( 4 \). Additionally, piecewise-defined functions can be created to fit specific shapes or behaviors within each interval of the period, ensuring that the function is continuous or follows desired characteristics
  • #1
Math100
802
222
Homework Statement
Construct a periodic function ## f ## with period ## 4 ## for which ## f(11)=1 ## and ## f(22)=2 ##.
Relevant Equations
None.
On the book, it says, "Let ## f ## be defined by ## f(4n)=f(4n+1)=0, f(4n+2)=2 ## and ## f(4n+3)=1 ##, for all integers ## n ##". (Other answers are possible). But I don't understand, how does this work in the problem? I know that it must has something to do with the period, which is ## 4 ## in here and also has something to do with the modulo, because ## 11\pmod 4=3, 22\pmod 4=2 ##. What to do with these though?
 
Physics news on Phys.org
  • #2
Math100 said:
Homework Statement: Construct a periodic function ## f ## with period ## 4 ## for which ## f(11)=1 ## and ## f(22)=2 ##.
Relevant Equations: None.

On the book, it says, "Let ## f ## be defined by ## f(4n)=f(4n+1)=0, f(4n+2)=2 ## and ## f(4n+3)=1 ##, for all integers ## n ##". (Other answers are possible). But I don't understand, how does this work in the problem? I know that it must has something to do with the period, which is ## 4 ## in here and also has something to do with the modulo, because ## 11\pmod 4=3, 22\pmod 4=2 ##. What to do with these though?
What is the domain of the function?

The example indicates that it is the integers. If so, then ##f(11)=f(4\cdot 2 +3)=1 ## with ##n=2## in the definition and ##f(22)=f(4\cdot 5+2)= 2## with ##n=5## in the definition, so the two requested values are obtained by the given definition of ##f##.

Now you could prove that ##f(m)=f(m+4)## for all non-negative integers by induction, starting with ##m=0## and then that it also holds for negative values of ##m.## But ##f(-m)\neq f(m)## so you must be careful.

However, as you correctly observed, you need to consider four different cases with ##m \equiv a \in\{0,1,2,3\} \pmod{4}## anyway, so forget the induction and the negative values. Instead, let's observe (prove) that ##f(m)=f(a)## for any integer ##m## with ##m\equiv a\pmod{4},## and note that ##f(a)## is per definition of period ##4.##

For an example with real values, I would consider ##y=A\cdot \sin\left(\dfrac{2\pi}{4}\cdot x\right)+B\cdot \cos\left(\dfrac{2\pi}{4}\cdot x\right)## which makes it of the period ##4## and determine the values of ##A## and ##B## by ##y(11)=1## and ##y(22)=2.## You have two fixed points so I suggested two trig functions with two independent parameters ##A,B.## If you are lucky, then one might do, but I don't think so. Another possibility is to use ##y=A(x)\cdot \sin\left(\dfrac{2\pi}{4}\cdot x\right)## and define a function ##A(x)## instead of two parameters accordingly.
 
  • Like
Likes docnet and Math100
  • #3
fresh_42 said:
What is the domain of the function?

The example indicates that it is the integers. If so, then ##f(11)=f(4\cdot 2 +3)=1 ## with ##n=2## in the definition and ##f(22)=f(4\cdot 5+2)= 2## with ##n=5## in the definition, so the two requested values are obtained by the given definition of ##f##.

Now you could prove that ##f(m)=f(m+4)## for all non-negative integers by induction, starting with ##m=0## and then that it also holds for negative values of ##m.## But ##f(-m)\neq f(m)## so you must be careful.

However, as you correctly observed, you need to consider four different cases with ##m \equiv a \in\{0,1,2,3\} \pmod{4}## anyway, so forget the induction and the negative values. Instead, let's observe (prove) that ##f(m)=f(a)## for any integer ##m## with ##m\equiv a\pmod{4},## and note that ##f(a)## is per definition of period ##4.##

For an example with real values, I would consider ##y=A\cdot \sin\left(\dfrac{2\pi}{4}\cdot x\right)+B\cdot \cos\left(\dfrac{2\pi}{4}\cdot x\right)## which makes it of the period ##4## and determine the values of ##A## and ##B## by ##y(11)=1## and ##y(22)=2.## You have two fixed points so I suggested two trig functions with two independent parameters ##A,B.## If you are lucky, then one might do, but I don't think so. Another possibility is to use ##y=A(x)\cdot \sin\left(\dfrac{2\pi}{4}\cdot x\right)## and define a function ##A(x)## instead of two parameters accordingly.
For ## y=A\cdot sin(\frac{2\pi}{4}x)+B\cdot cos(\frac{2\pi}{4}x) ##, I've got ## y(11)=1\implies 1=A\cdot sin(\frac{11\pi}{2})+B\cdot cos(\frac{11\pi}{2})\implies 1=-A+0\implies A=-1 ## and ## y(22)=2\implies 2=A\cdot sin(11\pi)+B\cdot cos(11\pi)\implies 2=0-B\implies B=-2 ##. With ## y=A(x)\cdot sin(\frac{2\pi}{4}x) ##, we have ## y(11)=1\implies 1=A(11)\cdot sin(\frac{11\pi}{2})\implies 1=A(11)\cdot (-1)\implies A(11)=-1 ## and ## y(22)=2\implies 2=A(22)\cdot sin(\frac{11\pi}{2})\implies 2=A(22)\cdot (-1)\implies A(22)=-2 ##. Since ## 11\pmod {4}=3, 22\pmod {4}=2 ##, it follows that ## f(11)=f(3)=1, f(22)=f(2)=2 ##. To define a periodic function for ## x=0, 1, 2, 3 ## where period is ## 4 ##, I've got
\begin{align*}
f(x) = \begin{cases}
a & \text{if } x \equiv 0\pmod {4}\\
b & \text{if } x \equiv 1\pmod {4}\\
2 & \text{if } x \equiv 2\pmod {4}\\
1 & \text{if } x \equiv 3\pmod {4}.
\end{cases}
\end{align*} for some ## a, b\in\mathbb{Z} ##.
 
Last edited:
  • #4
Math100 said:
For ## y=A\cdot sin(\frac{2\pi}{4}x)+B\cdot cos(\frac{2\pi}{4}x) ##, I've got ## y(11)=1\implies 1=A\cdot sin(\frac{11\pi}{2})+B\cdot cos(\frac{11\pi}{2})\implies 1=-A+0\implies A=-1 ## and ## y(22)=2\implies 2=A\cdot sin(11\pi)+B\cdot cos(11\pi)\implies 2=0-B\implies B=-2 ##.
Correct. That makes it ##y(x)=-\sin\left(\dfrac{\pi x}{2}\right) -2\cos\left(\dfrac{\pi x}{2}\right).##
Math100 said:
With ## y=A(x)\cdot sin(\frac{2\pi}{4}x) ##, we have ## y(11)=1\implies 1=A(11)\cdot sin(\frac{11\pi}{2})\implies 1=A(11)\cdot (-1)\implies A(11)=-1 ## and ## y(22)=2\implies 2=A(22)\cdot sin(\frac{11\pi}{2})\implies 2=A(22)\cdot (-1)\implies A(22)=-2 ##.

This is wrong. We have
\begin{align*}
y(11)&=A(11)\sin \left(\dfrac{11\pi}{2}\right)=A(11)\cdot (-1)=1 \\
y(22)&=A(22)\sin \left(\dfrac{22\pi}{2}\right)=A(22)\cdot 0 = 0\neq 2
\end{align*}
which means my idea does not work. We have to avoid that the sine value hits a point where it is zero. The easiest way to correct this is to shift the wave. This doesn't change the period but shifts the points so that the sine isn't zero.

Set ##y(x)=A(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right).## Now,
a) prove that ##y(x)=y(x+4n)## for all ##n\in \mathbb{Z},##
b) prove that ##y(11)\neq 0## and ##y(22)\neq 0## and
c) find an amplitude function ##A(x)## such that ##y(x)=A(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right)## with ##y(11)=1## and ##y(22)=2.##

Note: You could define a straight ##A(x)## such that ##y(11)=1## and ##y(22)=2.## However, such a linear increasing or linear decreasing amplitude would destroy the periodicity of ##y(x).## We need therefore an amplitude function ##A(x)## which itself is of period ##4.## Any idea what we could choose for such a ##A(x)##?


d) I would also recommend to do the same thing with ##z(x)=B(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right),## just for practice.

Math100 said:
Since ## 11\pmod {4}=3, 22\pmod {4}=2 ##, it follows that ## f(11)=f(3)=1, f(22)=f(2)=2 ##. To define a periodic function for ## x=0, 1, 2, 3 ## where period is ## 4 ##, I've got
\begin{align*}
f(x) = \begin{cases}
a & \text{if } x \equiv 0\pmod {4}\\
b & \text{if } x \equiv 1\pmod {4}\\
2 & \text{if } x \equiv 2\pmod {4}\\
1 & \text{if } x \equiv 3\pmod {4}.
\end{cases}
\end{align*} for some ## a, b\in\mathbb{Z} ##.
Ok, but you need the same property as in your given example, namely that ##f(m)=f(c)## for any integer ##m\equiv c \pmod{4}## or in the long version, that ##f(4n)=f(0)=a\, , \,f(4n+1)=f(1)=b\, , \,f(4n+2)=f(2)=1\, , \,f(4n+3)=f(3)=1.## The function ##f## must be defined to have this property.

Please consider elaborating a) - d) since it is a good practice. And don’t be so stingy with text paragraphs.
 
  • Like
Likes Math100
  • #5
fresh_42 said:
Correct. That makes it ##y(x)=-\sin\left(\dfrac{\pi x}{2}\right) -2\cos\left(\dfrac{\pi x}{2}\right).##


This is wrong. We have
\begin{align*}
y(11)&=A(11)\sin \left(\dfrac{11\pi}{2}\right)=A(11)\cdot (-1)=1 \\
y(22)&=A(22)\sin \left(\dfrac{22\pi}{2}\right)=A(22)\cdot 0 = 0\neq 2
\end{align*}
which means my idea does not work. We have to avoid that the sine value hits a point where it is zero. The easiest way to correct this is to shift the wave. This doesn't change the period but shifts the points so that the sine isn't zero.

Set ##y(x)=A(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right).## Now,
a) prove that ##y(x)=y(x+4n)## for all ##n\in \mathbb{Z},##
b) prove that ##y(11)\neq 0## and ##y(22)\neq 0## and
c) find an amplitude function ##A(x)## such that ##y(x)=A(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right)## with ##y(11)=1## and ##y(22)=2.##

Note: You could define a straight ##A(x)## such that ##y(11)=1## and ##y(22)=2.## However, such a linear increasing or linear decreasing amplitude would destroy the periodicity of ##y(x).## We need therefore an amplitude function ##A(x)## which itself is of period ##4.## Any idea what we could choose for such a ##A(x)##?


d) I would also recommend to do the same thing with ##z(x)=B(x)\cdot \sin \left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right),## just for practice.


Ok, but you need the same property as in your given example, namely that ##f(m)=f(c)## for any integer ##m\equiv c \pmod{4}## or in the long version, that ##f(4n)=f(0)=a\, , \,f(4n+1)=f(1)=b\, , \,f(4n+2)=f(2)=1\, , \,f(4n+3)=f(3)=1.## The function ##f## must be defined to have this property.

Please consider elaborating a) - d) since it is a good practice. And don’t be so stingy with text paragraphs.
a) Let ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Then ## y(x+4n)=A(x+4n)\cdot sin(\frac{\pi(x+4n)}{2}+\frac{\pi}{4})=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+2\pi\cdot n+\frac{\pi}{4}) ##.
Note that ## sin(x)=sin(x+2\pi\cdot n) ## by the trigonometric identity, so we have ## sin(\frac{\pi\cdot x}{2}+2\pi\cdot n+\frac{\pi}{4})=sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
This gives ## y(x+4n)=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Thus, ## y(x)=y(x+4n)\implies A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4})=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Therefore, ## y(x)=y(x+4n) ## for all integers ## n ##.

b) Given that ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##, we have ## y(11)=A(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{4})=A(11)\cdot (-\frac{\sqrt{2}}{2}) ## and ## y(22)=A(22)\cdot sin(11\pi+\frac{\pi}{4})=A(22)\cdot (-\frac{\sqrt{2}}{2}) ## but how to prove that ## y(11)\neq 0 ## and ## y(22)\neq 0 ## from here? It must be the case that ## A(11) ## and ## A(22) ## are nonzero in order for ## y(11)\neq 0 ## and ## y(22)\neq 0 ##, but then how to prove that ## A(11) ## and ## A(22) ## are nonzero?

c) Consider ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ## such that ## y(11)=1 ## and ## y(22)=2 ##.
Then ## y(11)=1\implies 1=A(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{4})\implies 1=A(11)\cdot (-\frac{\sqrt{2}}{2})\implies A(11)=-\sqrt{2} ## and ## y(22)=2\implies 2=A(22)\cdot sin(11\pi+\frac{\pi}{4})\implies 2=A(22)\cdot (-\frac{\sqrt{2}}{2})\implies A(22)=-2\sqrt{2} ##.

As of finding the amplitude function from here, would it just be ## A(x)=-\sqrt{2} ##?
 
  • #6
Math100 said:
Homework Statement: Construct a periodic function ## f ## with period ## 4 ## for which ## f(11)=1 ## and ## f(22)=2 ##.
FWIW, since the question has essentially been answered, here’s an alternative solution.

A = (11,1), B = (22,2). The period is 4 so there are ##\frac {22-11}4 =## eleven quarter-cycles between A and B. The angular frequency (considering trig' functions) is ##\frac {2 \pi }4 = \frac {\pi}2##.

We note that ##f(x)## increases by 1 from A to B, that there are an odd number of quarter-cycles between A and B and that sine changes by ##\pm## 1 each quarter-cycle.

##\sin(\frac {11 \pi}2) = -1##
##\sin(\frac {22 \pi}2) = 0##

So ##f(x) = \sin(\frac {\pi x}2) +2## is a solution.
 
  • #7
Math100 said:
a) Let ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Then ## y(x+4n)=A(x+4n)\cdot sin(\frac{\pi(x+4n)}{2}+\frac{\pi}{4})=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+2\pi\cdot n+\frac{\pi}{4}) ##.
Note that ## sin(x)=sin(x+2\pi\cdot n) ## by the trigonometric identity, so we have ## sin(\frac{\pi\cdot x}{2}+2\pi\cdot n+\frac{\pi}{4})=sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
This gives ## y(x+4n)=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Thus, ## y(x)=y(x+4n)\implies A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4})=A(x+4n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##.
Therefore, ## y(x)=y(x+4n) ## for all integers ## n ##.
Correct.
Math100 said:
b) Given that ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ##, we have ## y(11)=A(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{4})=A(11)\cdot (-\frac{\sqrt{2}}{2}) ## and ## y(22)=A(22)\cdot sin(11\pi+\frac{\pi}{4})=A(22)\cdot (-\frac{\sqrt{2}}{2}) ## but how to prove that ## y(11)\neq 0 ## and ## y(22)\neq 0 ## from here? It must be the case that ## A(11) ## and ## A(22) ## are nonzero in order for ## y(11)\neq 0 ## and ## y(22)\neq 0 ##, but then how to prove that ## A(11) ## and ## A(22) ## are nonzero?
We are free to choose a function ##A## appropriately since this is a parameter we can freely choose. We only have to make sure that it is of period four. Constant functions are the easiest ones.

Math100 said:
c) Consider ## y(x)=A(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{4}) ## such that ## y(11)=1 ## and ## y(22)=2 ##.
Then ## y(11)=1\implies 1=A(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{4})\implies 1=A(11)\cdot (-\frac{\sqrt{2}}{2})\implies A(11)=-\sqrt{2} ## and ## y(22)=2\implies 2=A(22)\cdot sin(11\pi+\frac{\pi}{4})\implies 2=A(22)\cdot (-\frac{\sqrt{2}}{2})\implies A(22)=-2\sqrt{2} ##.

As of finding the amplitude function from here, would it just be ## A(x)=-\sqrt{2} ##?
If ##A(x)=-\sqrt{2}## then ##A(22)=-\sqrt{2}\neq -2\sqrt{2}.##
If ##A(x)=-\sqrt{2}\cdot x## then ##A(x)## hasn't the period ##4## since it is linearly decreasing.
However, we already know a function ##y(x)## of period ##4## such that ##y(11)=1\, , \,y(22)=2.## We can therefore define ##A(x)=-y(x)\cdot\sqrt{2}.## That function was ##y(x)=-\sin\left(\dfrac{\pi x}{2}\right) -2\cos\left(\dfrac{\pi x}{2}\right).##

So
$$
y(x)=\left(\sqrt{2}\sin\left(\dfrac{\pi x}{2}\right) + 2\sqrt{2}\cos\left(\dfrac{\pi x}{2}\right)\right) \cdot \sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right)
$$
is another solution but @Steve4Physics' solution is easier and straight forward. I guess we both tend to make things more complicated than necessary.
 
  • Like
Likes Math100
  • #8
The main message of this exercise is, that modulo functions are suited to get periodic functions on the integers, and that sine and cosine functions are suited to get periodic functions on the real numbers. The most general functions are ##y(x)=A(x)\sin (\omega x + a)+B(x)\cos(\omega x +b) +c,## but sometimes ##y(x)=\sin (\omega x )+c## already does the job.
 
  • Like
Likes Math100
  • #9
fresh_42 said:
Correct.

We are free to choose a function ##A## appropriately since this is a parameter we can freely choose. We only have to make sure that it is of period four. Constant functions are the easiest ones.


If ##A(x)=-\sqrt{2}## then ##A(22)=-\sqrt{2}\neq -2\sqrt{2}.##
If ##A(x)=-\sqrt{2}\cdot x## then ##A(x)## hasn't the period ##4## since it is linearly decreasing.
However, we already know a function ##y(x)## of period ##4## such that ##y(11)=1\, , \,y(22)=2.## We can therefore define ##A(x)=-y(x)\cdot\sqrt{2}.## That function was ##y(x)=-\sin\left(\dfrac{\pi x}{2}\right) -2\cos\left(\dfrac{\pi x}{2}\right).##

So
$$
y(x)=\left(\sqrt{2}\sin\left(\dfrac{\pi x}{2}\right) + 2\sqrt{2}\cos\left(\dfrac{\pi x}{2}\right)\right) \cdot \sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{4}\right)
$$
is another solution but @Steve4Physics' solution is easier and straight forward. I guess we both tend to make things more complicated than necessary.
d) Let ## z(x)=B(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Then ## z(x+3n)=B(x+3n)\cdot sin(\frac{\pi(x+3n)}{2}+\frac{\pi}{3})=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{3\pi\cdot n}{2}+\frac{\pi}{3}) ##.
Note that ## sin(x)=sin(x+2\pi\cdot n) ## by the trigonometric identity, so we have ## sin(\frac{\pi\cdot x}{2}+\frac{3\pi\cdot n}{2}+\frac{\pi}{3})=sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
This gives ## z(x+3n)=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Thus, ## z(x)=z(x+3n)\implies B(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3})=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Therefore, ## z(x)=z(x+3n) ## for all integers ## n ##.
Consider the conditions ## z(11)=1 ## and ## z(22)=2 ##.
Observe that ## z(11)=1\implies 1=B(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{3})\implies 1=B(11)\cdot (-\frac{1}{2})\implies B(11)=-2 ## and ## z(22)=2\implies 2=B(22)\cdot sin(11\pi+\frac{\pi}{3})\implies 2=B(22)\cdot (-\frac{\sqrt{3}}{2})\implies B(22)=-\frac{4\sqrt{3}}{3} ##.
Now we will define ## B(x)=-2z(x) ##, where ## z(x)=-sin(\frac{\pi\cdot x}{2})-\frac{2\sqrt{3}}{3}\cdot cos(\frac{\pi\cdot x}{2}) ##.
Hence, the periodic function is ## z(x)=(2sin(\frac{\pi\cdot x}{2})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi\cdot x}{2}))\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.

Above is the practice problem which you've given me, is this correct? And I agree that I made things more complicated than necessary but I actually like the way you think.
 
  • #10
Math100 said:
d) Let ## z(x)=B(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Then ## z(x+3n)=B(x+3n)\cdot sin(\frac{\pi(x+3n)}{2}+\frac{\pi}{3})=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{3\pi\cdot n}{2}+\frac{\pi}{3}) ##.

This is going in the wrong direction.

Math100 said:
Note that ## sin(x)=sin(x+2\pi\cdot n) ## by the trigonometric identity, so we have ## sin(\frac{\pi\cdot x}{2}+\frac{3\pi\cdot n}{2}+\frac{\pi}{3})=sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
This gives ## z(x+3n)=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Thus, ## z(x)=z(x+3n)\implies B(x)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3})=B(x+3n)\cdot sin(\frac{\pi\cdot x}{2}+\frac{\pi}{3}) ##.
Therefore, ## z(x)=z(x+3n) ## for all integers ## n ##.
Lemma: A function ##y(x)=\sin(\omega \cdot x +a)## has always the least period ##\dfrac{2\pi }{\omega}. ##

Proof:
\begin{align*}
y\left(x+n\cdot\dfrac{2\pi}{\omega}\right)&=\sin\left(\omega\left(x+n\cdot\dfrac{2\pi}{\omega}\right) + a\right)\\
&=\sin\left(\omega x+ 2\pi n +a \right)\\
&=\sin((\omega x+a)+2\pi n)\\
&=\sin(\omega x+a) \cos(2\pi n)+\cos(\omega x+a) \sin(2\pi n)\\
&=\sin(\omega x+a)\cdot 1 + \cos(\omega x+a) \cdot 0\\
&=\sin(\omega x+a)\\
&=y(x)
\end{align*}
Every function of period ##p## is also a function of period ##2p,3p,4p,\ldots## So we want to show now, that ##\dfrac{2\pi }{\omega}## is the least period. To do that, we first note that ##x= \dfrac{n\pi - a}{\omega}## are zeros of ##y(x)## for all integers ##n## so that the period could possibly be ##\dfrac{(n+1)\pi - a}{\omega}-\dfrac{n\pi - a}{\omega} = \dfrac{\pi}{\omega}.## We therefore calculate the slope at these points.
$$
y'(x)=\cos (\omega \cdot x +a)\cdot (\omega \cdot x +a)'= \omega \cos (\omega \cdot x +a)
$$
\begin{align*}
y'\left(\dfrac{-1\cdot\pi - a}{\omega}\right)&=\omega \cos \left( -\pi \right)=-\omega \\
y'\left(\dfrac{0\cdot\pi - a}{\omega}\right)&=\omega \cos \left( 0 \right) =\omega\\
y'\left(\dfrac{1\cdot\pi - a}{\omega}\right)&=\omega \cos \left( \pi \right) =-\omega
\end{align*}
This means, say that ##\omega > 0,## that ##y(x)## is always decreasing at the points ##x= \dfrac{(2n+1)\pi - a}{\omega}## and always increasing at ##x= \dfrac{2n\pi - a}{\omega}.## The period is thus at least
$$
\dfrac{(2n+1)\pi - a}{\omega}-\dfrac{(2n-1)\pi - a}{\omega}=\dfrac{2\pi}{\omega}
$$
##\square##​

This means in our case with ##\omega=\dfrac{\pi}{2}## that we have a period of ##\dfrac{2\pi }{\omega}=\dfrac{2\pi }{\frac{\pi}{2}}=\dfrac{2}{\frac{1}{2}}=4.##

The period cannot be ##3.## I leave it up to you to find the exact point where your argument went wrong. The amplitude ##B(x)## must also be chosen with period ##4,## i.e. such that ##B(x)=B(x+4n).##

Math100 said:
Consider the conditions ## z(11)=1 ## and ## z(22)=2 ##.
Observe that ## z(11)=1\implies 1=B(11)\cdot sin(\frac{11\pi}{2}+\frac{\pi}{3})\implies 1=B(11)\cdot (-\frac{1}{2})\implies B(11)=-2 ## and ## z(22)=2\implies 2=B(22)\cdot sin(11\pi+\frac{\pi}{3})\implies 2=B(22)\cdot (-\frac{\sqrt{3}}{2})\implies B(22)=-\frac{4\sqrt{3}}{3} ##.

This is correct.

We must have ##B(11)=-2## and ##B(22)=-\dfrac{4\sqrt{3}}{3}=-\dfrac{4}{\sqrt{3}}.##
However, we also need the above condition that ##B(x)## is of period ##4##, i.e. that ##B(x)=B(x+4n)## for all ##n\in \mathbb{Z}.## You should be able by now to find such a periodic function ##B(x).##

Math100 said:
Now we will define ## B(x)=-2z(x) ##...
What do you mean?

We defined ##z(x)=B(x)\cdot \sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right).## By setting ##B(x)=-2z(x) ## we would get
\begin{align*}
0&= B(x)\cdot \left(1+2\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right)\right) \\
0&=B(22)\cdot \left(1+2\sin\left(\dfrac{\pi\cdot 22}{2}+\dfrac{\pi}{3}\right)\right)=-\dfrac{4}{\sqrt{3}}\cdot\left(1+2\cdot \left(-\dfrac{\sqrt{3}}{2}\right)\right)=-\dfrac{4}{\sqrt{3}}+4 \neq 0
\end{align*}
You defined ##B(x)## by using ##z(x)## but ##z(x)## is defined by ##B(x)## which is circular. And if ##B(x)\neq 0## we would have ##1=-2\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right)## which can be solved for ##x.## We would be left with only a subset of all real numbers, but we want ##z(x)## to be defined everywhere.

You can use the sine term of the function ##z(x)## as a function of period ##4,## i.e. ##s(x):=\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right).## However, ##s(11)=-\dfrac{1}{2}=\dfrac{1}{4}B(11)## and ##s(22)=-\dfrac{\sqrt{3}}{2}=-\dfrac{3}{2\sqrt{3}}=\dfrac{3}{8}B(22).## This means we have to adjust ##s(x).## I think the method in post #6 doesn't work in this case. So my first ansatz in the thread might be faster than shifting the wave to the right or to the top.

What we need is a function ##B(x)## with
$$
B(x)=B(x+4n)\text{ for all }n\in \mathbb{Z}\;\wedge\; B(11)=-2\;\wedge\; B(22)=-\dfrac{4}{\sqrt{3}}
$$

I would make an ansatz ##B(x)=p\cdot \sin\left(\dfrac{\pi\cdot x}{2}\right)+q\cdot \cos\left(\dfrac{\pi\cdot x}{2}\right).## This guarantees a period of ##4## by the Lemma, and we have two unknowns ##p,q## and two equations ##B(11)=-2## and ##B(22)=-\dfrac{4}{\sqrt{3}}.##

(I hope I made no serious typos, mistakes, or oversaw something. It's late here.)
 
  • Like
Likes Math100
  • #11
Math100 said:
Homework Statement: Construct a periodic function ## f ## with period ## 4 ## for which ## f(11)=1 ## and ## f(22)=2 ##.
Relevant Equations: None.

On the book, it says, "Let ## f ## be defined by ## f(4n)=f(4n+1)=0, f(4n+2)=2 ## and ## f(4n+3)=1 ##, for all integers ## n ##". (Other answers are possible). But I don't understand, how does this work in the problem? I know that it must has something to do with the period, which is ## 4 ## in here and also has something to do with the modulo, because ## 11\pmod 4=3, 22\pmod 4=2 ##. What to do with these though?

Periodicity mod 4 requires [itex]f(4n + 3) = 1[/itex] and [itex]f(4n + 2) = 2[/itex]. So you just need to choose values for [itex]f[/itex] elsewhere on [itex]0 \leq x < 4[/itex] and extend it to the rest of the domain by periodicity. Another solution, which also works for a real domain, is [tex]
f(x) = \begin{cases} 4 - x & 0 \leq x < 4 \\
&\vdots \\
4(n+1) - x, & 4n \leq x < 4(n+1) \\
&\vdots \end{cases}[/tex]
 
  • #12
fresh_42 said:
This is going in the wrong direction.


Lemma: A function ##y(x)=\sin(\omega \cdot x +a)## has always the least period ##\dfrac{2\pi }{\omega}. ##

Proof:
\begin{align*}
y\left(x+n\cdot\dfrac{2\pi}{\omega}\right)&=\sin\left(\omega\left(x+n\cdot\dfrac{2\pi}{\omega}\right) + a\right)\\
&=\sin\left(\omega x+ 2\pi n +a \right)\\
&=\sin((\omega x+a)+2\pi n)\\
&=\sin(\omega x+a) \cos(2\pi n)+\cos(\omega x+a) \sin(2\pi n)\\
&=\sin(\omega x+a)\cdot 1 + \cos(\omega x+a) \cdot 0\\
&=\sin(\omega x+a)\\
&=y(x)
\end{align*}
Every function of period ##p## is also a function of period ##2p,3p,4p,\ldots## So we want to show now, that ##\dfrac{2\pi }{\omega}## is the least period. To do that, we first note that ##x= \dfrac{n\pi - a}{\omega}## are zeros of ##y(x)## for all integers ##n## so that the period could possibly be ##\dfrac{(n+1)\pi - a}{\omega}-\dfrac{n\pi - a}{\omega} = \dfrac{\pi}{\omega}.## We therefore calculate the slope at these points.
$$
y'(x)=\cos (\omega \cdot x +a)\cdot (\omega \cdot x +a)'= \omega \cos (\omega \cdot x +a)
$$
\begin{align*}
y'\left(\dfrac{-1\cdot\pi - a}{\omega}\right)&=\omega \cos \left( -\pi \right)=-\omega \\
y'\left(\dfrac{0\cdot\pi - a}{\omega}\right)&=\omega \cos \left( 0 \right) =\omega\\
y'\left(\dfrac{1\cdot\pi - a}{\omega}\right)&=\omega \cos \left( \pi \right) =-\omega
\end{align*}
This means, say that ##\omega > 0,## that ##y(x)## is always decreasing at the points ##x= \dfrac{(2n+1)\pi - a}{\omega}## and always increasing at ##x= \dfrac{2n\pi - a}{\omega}.## The period is thus at least
$$
\dfrac{(2n+1)\pi - a}{\omega}-\dfrac{(2n-1)\pi - a}{\omega}=\dfrac{2\pi}{\omega}
$$
##\square##​

This means in our case with ##\omega=\dfrac{\pi}{2}## that we have a period of ##\dfrac{2\pi }{\omega}=\dfrac{2\pi }{\frac{\pi}{2}}=\dfrac{2}{\frac{1}{2}}=4.##

The period cannot be ##3.## I leave it up to you to find the exact point where your argument went wrong. The amplitude ##B(x)## must also be chosen with period ##4,## i.e. such that ##B(x)=B(x+4n).##



This is correct.

We must have ##B(11)=-2## and ##B(22)=-\dfrac{4\sqrt{3}}{3}=-\dfrac{4}{\sqrt{3}}.##
However, we also need the above condition that ##B(x)## is of period ##4##, i.e. that ##B(x)=B(x+4n)## for all ##n\in \mathbb{Z}.## You should be able by now to find such a periodic function ##B(x).##


What do you mean?

We defined ##z(x)=B(x)\cdot \sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right).## By setting ##B(x)=-2z(x) ## we would get
\begin{align*}
0&= B(x)\cdot \left(1+2\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right)\right) \\
0&=B(22)\cdot \left(1+2\sin\left(\dfrac{\pi\cdot 22}{2}+\dfrac{\pi}{3}\right)\right)=-\dfrac{4}{\sqrt{3}}\cdot\left(1+2\cdot \left(-\dfrac{\sqrt{3}}{2}\right)\right)=-\dfrac{4}{\sqrt{3}}+4 \neq 0
\end{align*}
You defined ##B(x)## by using ##z(x)## but ##z(x)## is defined by ##B(x)## which is circular. And if ##B(x)\neq 0## we would have ##1=-2\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right)## which can be solved for ##x.## We would be left with only a subset of all real numbers, but we want ##z(x)## to be defined everywhere.

You can use the sine term of the function ##z(x)## as a function of period ##4,## i.e. ##s(x):=\sin\left(\dfrac{\pi\cdot x}{2}+\dfrac{\pi}{3}\right).## However, ##s(11)=-\dfrac{1}{2}=\dfrac{1}{4}B(11)## and ##s(22)=-\dfrac{\sqrt{3}}{2}=-\dfrac{3}{2\sqrt{3}}=\dfrac{3}{8}B(22).## This means we have to adjust ##s(x).## I think the method in post #6 doesn't work in this case. So my first ansatz in the thread might be faster than shifting the wave to the right or to the top.

What we need is a function ##B(x)## with
$$
B(x)=B(x+4n)\text{ for all }n\in \mathbb{Z}\;\wedge\; B(11)=-2\;\wedge\; B(22)=-\dfrac{4}{\sqrt{3}}
$$

I would make an ansatz ##B(x)=p\cdot \sin\left(\dfrac{\pi\cdot x}{2}\right)+q\cdot \cos\left(\dfrac{\pi\cdot x}{2}\right).## This guarantees a period of ##4## by the Lemma, and we have two unknowns ##p,q## and two equations ##B(11)=-2## and ##B(22)=-\dfrac{4}{\sqrt{3}}.##

(I hope I made no serious typos, mistakes, or oversaw something. It's late here.)
I see where I went wrong in my argument and that the period must be ## 4 ##. Also, I have found out that ## B(x)=2sin(\frac{\pi\cdot x}{2})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2}) ##.
 
  • #13
Math100 said:
I see where I went wrong in my argument and that the period must be ## 4 ##. Also, I have found out that ## B(x)=2sin(\frac{\pi\cdot x}{2})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2}) ##.

Yes, that's right. So
$$
z(x)=B(x)\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)\wedge B(x)=2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)
$$
Can you simplify the formula for ##z(x)## by using trigonometric formulas and determine the (least) period of ##z(x)##? How can we change ##z(x)## so that ##z(11)=1\, , \,z(22)=2## and ##z(x)=z(x+4n)## still hold?
 
  • Like
Likes Math100
  • #14
fresh_42 said:
Yes, that's right. So
$$
z(x)=B(x)\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)\wedge B(x)=2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)
$$
Can you simplify the formula for ##z(x)## by using trigonometric formulas and determine the (least) period of ##z(x)##? How can we change ##z(x)## so that ##z(11)=1\, , \,z(22)=2## and ##z(x)=z(x+4n)## still hold?
Yes. It's ## z(x)=(2sin(\frac{\pi x}{2})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2}))\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})=2sin(\frac{\pi x}{2})\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2})\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})=cos(-\frac{\pi}{3})-cos(\pi x+\frac{\pi}{3})+\frac{2\sqrt{3}}{3}(sin(\pi x+\frac{\pi}{3})+sin(\frac{\pi}{3}))=\frac{1}{2}-cos(\pi x+\frac{\pi}{3})+\frac{2\sqrt{3}}{3}(sin(\pi x+\frac{\pi}{3})+\frac{\sqrt{3}}{2})) ## and the least period is ## 2 ##.
 
  • #15
Math100 said:
Yes. It's ## z(x)=(2sin(\frac{\pi x}{2})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2}))\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})=2sin(\frac{\pi x}{2})\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})+\frac{4\sqrt{3}}{3}\cdot cos(\frac{\pi x}{2})\cdot sin(\frac{\pi x}{2}+\frac{\pi}{3})=cos(-\frac{\pi}{3})-cos(\pi x+\frac{\pi}{3})+\frac{2\sqrt{3}}{3}(sin(\pi x+\frac{\pi}{3})+sin(\frac{\pi}{3}))=\frac{1}{2}-cos(\pi x+\frac{\pi}{3})+\frac{2\sqrt{3}}{3}(sin(\pi x+\frac{\pi}{3})+\frac{\sqrt{3}}{2})) ## and the least period is ## 2 ##.
This is correct. The period is ##\dfrac{2\pi }{\pi}=2.## And if ##z(x)=z(x+2m)## we automatically have ##z(x+4n)=z(x+2\cdot (2n))=z(x+2m)=z(x).## Period two implies period four.

The simplification could be better:
$$
z(x)=B(x)\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)\wedge B(x)=2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)
$$
So
\begin{align*}
\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)&=\sin\left(\dfrac{\pi x}{2}\right)\cos\left(\dfrac{\pi}{3}\right)+
\cos\left(\dfrac{\pi x}{2}\right)\sin\left(\dfrac{\pi}{3}\right)\\
&=\dfrac{1}{2}\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{\sqrt{3}}{2}\cos\left(\dfrac{\pi x}{2}\right)
\end{align*}
and
\begin{align*}
z(x)&=\left(2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)\right)\cdot\left( \dfrac{1}{2}\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{\sqrt{3}}{2}\cos\left(\dfrac{\pi x}{2}\right)\right)\\
&=\sin^2\left(\dfrac{\pi x}{2}\right)+\dfrac{5}{\sqrt{3}}\sin\left(\dfrac{\pi x}{2}\right)\cos\left(\dfrac{\pi x}{2}\right)+2\cos^2\left(\dfrac{\pi x}{2}\right)\\
&=1+\cos^2\left(\dfrac{\pi x}{2}\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)\\
&=1+\left(\dfrac{1+\cos\left(\pi x\right)}{2}\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)\\
&=\dfrac{3}{2}+\dfrac{1}{2}\cos\left(\pi x\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)
\end{align*}
Since we have ##\sin\left(\pi \cdot 11\right)=\sin\left(\pi \cdot 22\right)=0##, we can drop that term because it doesn't contribute to ##z(11)## or ##z(22).##

The new function is thus ##z_0(x)=\dfrac{3}{2}+\dfrac{1}{2}\cos\left(\pi x\right).##

What a long and winding road to end up with such a simple cosine function!
 
  • Haha
Likes Math100
  • #16
fresh_42 said:
This is correct. The period is ##\dfrac{2\pi }{\pi}=2.## And if ##z(x)=z(x+2m)## we automatically have ##z(x+4n)=z(x+2\cdot (2n))=z(x+2m)=z(x).## Period two implies period four.

The simplification could be better:
$$
z(x)=B(x)\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)\wedge B(x)=2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)
$$
So
\begin{align*}
\sin\left(\dfrac{\pi x}{2}+\dfrac{\pi}{3}\right)&=\sin\left(\dfrac{\pi x}{2}\right)\cos\left(\dfrac{\pi}{3}\right)+
\cos\left(\dfrac{\pi x}{2}\right)\sin\left(\dfrac{\pi}{3}\right)\\
&=\dfrac{1}{2}\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{\sqrt{3}}{2}\cos\left(\dfrac{\pi x}{2}\right)
\end{align*}
and
\begin{align*}
z(x)&=\left(2\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{4}{\sqrt{3}} \cos\left(\dfrac{\pi x}{2}\right)\right)\cdot\left( \dfrac{1}{2}\sin\left(\dfrac{\pi x}{2}\right)+\dfrac{\sqrt{3}}{2}\cos\left(\dfrac{\pi x}{2}\right)\right)\\
&=\sin^2\left(\dfrac{\pi x}{2}\right)+\dfrac{5}{\sqrt{3}}\sin\left(\dfrac{\pi x}{2}\right)\cos\left(\dfrac{\pi x}{2}\right)+2\cos^2\left(\dfrac{\pi x}{2}\right)\\
&=1+\cos^2\left(\dfrac{\pi x}{2}\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)\\
&=1+\left(\dfrac{1+\cos\left(\pi x\right)}{2}\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)\\
&=\dfrac{3}{2}+\dfrac{1}{2}\cos\left(\pi x\right)+\dfrac{5}{2\sqrt{3}}\sin\left(\pi x\right)
\end{align*}
Since we have ##\sin\left(\pi \cdot 11\right)=\sin\left(\pi \cdot 22\right)=0##, we can drop that term because it doesn't contribute to ##z(11)## or ##z(22).##

The new function is thus ##z_0(x)=\dfrac{3}{2}+\dfrac{1}{2}\cos\left(\pi x\right).##

What a long and winding road to end up with such a simple cosine function!
The final new function looks a lot simpler.
 
  • Like
Likes fresh_42

FAQ: How to construct a periodic function ## f ## with period ## 4 ##?

1. What is a periodic function?

A periodic function is a function that repeats its values at regular intervals, known as the period. For a function to be periodic with period \( T \), it must satisfy the condition \( f(x + T) = f(x) \) for all values of \( x \).

2. How can I determine the period of a function?

The period of a function can be determined by identifying the smallest positive value \( T \) for which the function satisfies the periodic condition \( f(x + T) = f(x) \). Graphically, this can be observed as the distance between two successive peaks or troughs of the function.

3. What are some examples of functions with a period of 4?

Examples of functions with a period of 4 include the sine function \( f(x) = \sin\left(\frac{\pi}{2} x\right) \) and the cosine function \( f(x) = \cos\left(\frac{\pi}{2} x\right) \). Both functions repeat their values every 4 units along the x-axis.

4. How do I construct a periodic function with a specific period?

To construct a periodic function with a specific period, you can start with a basic periodic function (like sine or cosine) and adjust its argument. For a period of 4, you can use \( f(x) = A \sin\left(\frac{\pi}{2} x\right) + B \) or \( f(x) = A \cos\left(\frac{\pi}{2} x\right) + B \), where \( A \) and \( B \) are constants that determine the amplitude and vertical shift, respectively.

5. Can I create a piecewise function that is periodic?

Yes, you can create a piecewise function that is periodic as long as the pieces are defined in such a way that they match at the endpoints of the period. For example, you could define \( f(x) \) as different linear or constant segments over the intervals [0, 4), [4, 8), etc., ensuring continuity at the points where the segments meet.

Back
Top