# The period, angular frequency of a piecewise function

• TheSodesa
In summary, the function ##f## is defined as follows: it has a period of 2, and its angular frequency is 2 pi/T.
TheSodesa

## Homework Statement

The function ##f## is defined as follows:
\begin{equation*}
f(t) =
\begin{cases}
1, \text{ when } 2k < t < (2k+1),\\
0, \text{ when } t = k,\\
2, \text{ when } (2k-1) < t < 2k, & k \in \mathbb{Z}\\
\end{cases}
\end{equation*}

What is the period ##T## of the function ##f##? How about angular frequency? Calculate the following definite integrals:
$$a_n = \frac{2}{T}\int_{0}^{T} f(t) \cos (n \omega t) dt \text{ and } b_n = \frac{2}{T}\int_{0}^{T} f(t) \sin (n \omega t) dt,$$
where ##n = 0,1,2, \ldots##

## Homework Equations

Angular freguency:

\omega = 2 \pi f = \frac{2 \pi}{T}

## The Attempt at a Solution

I should preface this by saying, that something in me thinks this should be a simple problem, and that I'm just confused by the notation used.

Anyways, I started by cataloging how the function should behave with different values of ##k \in \mathbb{Z}##:
\begin{array}{ | l | c | c | c | c | c | c |}
\hline
k & 2k-1 & 2k & 2k+1 & f(t), (2k-1) < t < 2k & f(t), t = k & f(t), 2k < t < (2k+1)\\
\hline
0 & -1 & 0 & 1 & 2 & 0 & 1\\
1 & 1 & 2 & 3 & 2 & 0 & 1\\
2 & 3 & 4 & 5 & 2 & 0 & 1\\
3 & 5 & 6 & 7 & 2 & 0 & 1\\
4 & 7 & 8 & 9 & 2 & 0 & 1\\
\hline
\end{array}
It looks like ##f## will repeat in intervals of ##2##, since whenever ##k## is increased by ##1##, the domain of ##f## is shifted by ##2## to the right, and within that new domain ##f## is defined identically. Now here's the first thing that confuses me: I know I can test for periodicity by plugging ##t+T## in place of ##t## in ##f(t)##. However, here it wouldn't create a nice expression that simplified into the original through trig symmetry or some other trick. How can I show in writing, that what I stated above is true, or is the above intuitive realization enough for a proof?

Moving on, assuming the period was 2 implies that ##\omega = \frac{2 \pi}{2} = \pi##. Which leads us into the integration part of the problem, where another confusing thing occurs. Evaluating the integral seems simple enough: just split it into two parts between ##0## and ##T = 2## based on how ##f## is defined. However, in the assignment it is stated that ##n \in {0} \cup \mathbb{N}##. Does this mean I need to evaluate the integral infinitely many times, since the expression contains an ##n## that gains all of those values? Of course not, but I have no idea what this means in practise.

The first task is to draw the graph of ##f##. Can you describe in 1-2 simple sentences what ##f## looks like?

PS I don't like the definition as it's too loose. Personally, I would define it differently.

PeroK said:
The first task is to draw the graph of ##f##. Can you describe in 1-2 simple sentences what ##f## looks like?
I did this in GeoGebra, and it looks like a step function that has a period of 2, except that the function is zero when ##t \in \mathbb{Z}## and varies between 2 and 1 between the integers.

Maybe I should do a Matlab implementation of the picture because of GG limitations...

TheSodesa said:
I did this in GeoGebra, and it looks like a step function that has a period of 2, except that the function is zero when ##t \in \mathbb{Z}## and varies between 2 and 1 between the integers.

Could I sketch the function based on your description? If I hadn't seen the formula? It's a good idea to be precise in mathematics.

By the way, setting ##f(t) =0## on a finite (or countable) set of points will make no difference to any integrals.

PeroK said:
Could I sketch the function based on your description? If I hadn't seen the formula? It's a good idea to be precise in mathematics.

By the way, setting ##f(t) =0## on a finite (or countable) set of points will make no difference to any integrals.

Alright, let's try again. Let ##k \in \mathbb{Z}##. Between -1 and 0, ##f(t) = 2## and between 0 and 1 ##f(t) = 1##. The function repeats this pattern ad infinitum with what seems to be a period of 2, shifting between the values 2 and 1 while being zero when ##t = k##.

Is this any better?

TheSodesa said:
Alright, let's try again. Let ##k \in \mathbb{Z}##. Between -1 and 0, ##f(t) = 2## and between 0 and 1 ##f(t) = 1##. The function repeats this pattern ad infinitum with what seems to be a period of 2, shifting between the values 2 and 1 while being zero when ##t = k##.

Is this any better?

Okay, so you've got ##f(t)## figured out. What about ##\cos(n\omega t)##?

PeroK said:
Okay, so you've got ##f(t)## figured out. What about ##\cos(n\omega t)##?
Since we have now established, that our period seems to be 2, our angular frequency ##\omega = \pi \Rightarrow \cos (n \omega t) = \cos (n \pi t)##. Here ##n \pi## increases the frequency by multiples of ##\pi##, while dividing the period by the same factor. Cosine of ##t## has a period of ##2 \pi##, so ##\cos (n \pi t) = \cos (n \pi t + \frac{2\pi}{n\pi}) = \cos (n \pi t + \frac{2}{n})##.

In other words, unless ##n = 0##, in which case ##cos(n\pi t) = 1##, ##\cos (n \pi t)## is just the usual cosine function with it's frequency increased, meaning it is squished in the ##t##-direction.

I'm not sure I see the point of this question. If ##T=2## you just have to integrate over ##(0,1)## and ##(1,2)## on which ##f(t)## is constant.

PeroK said:
I'm not sure I see the point of this question. If ##T=2## you just have to integrate over ##(0,1)## and ##(1,2)## on which ##f(t)## is constant.

I should have prefaced this by saying, that this is the first week of a course of Fourier methods, and the teacher gave us review excercises for homework, before we get into the proper subject matter. I wouldn't say this question is pointless since it is giving me a headache.

Are you saying, that the ##n## is there just to throw me off? Surely the integral evaluates differently depending on the value of ##n## in that interval?

TheSodesa said:
I should have prefaced this by saying, that this is the first week of a course of Fourier methods, and the teacher gave us review excercises for homework, before we get into the proper subject matter. I wouldn't say this question is pointless since it is giving me a headache.

Are you saying, that the ##n## is there just to throw me off? Surely the integral evaluates differently depending on the value of ##n## in that interval?

Yes, you can go ahead and evaluate them. See what you get.

PeroK said:
Yes, you can go ahead and evaluate them. See what you get.
Alright, it took me a moment, but the results I got are as follows:

$$a_n = \frac{2 \sin (2 \pi n) - \sin (n \pi)}{n \pi}, n \neq 0$$
and
$$b_n = \frac{1 + \cos(n \pi) - 2 \cos (2 n \pi)}{n \pi}, n \neq 0.$$
So even though it was originally stated, that ##n \in {0,1,2,...}##, ##n## can't be zero. Otherwise this was pretty straightforward.

EDIT: A mistake in ##b_n##: Forgot to include the factor 2 in front of ##\cos (2 \pi n)##.

Last edited:
TheSodesa said:
Alright, it took me a moment, but the results I got are as follows:

$$a_n = \frac{2 \sin (2 \pi n) - \sin (n \pi)}{n \pi}, n \neq 0$$
and
$$b_n = \frac{1 + \cos(n \pi) - \cos (2 n \pi)}{n \pi}, n \neq 0,$$.
So even though it was originally stated, that ##n \in {0,1,2,...}##, i can't be zero. Otherwise this was pretty straightforward.

You can't stop there! You'll have to simplify those expressions.

PeroK said:
You can't stop there! You'll have to simplify those expressions.

Using trig identities doesn't seem to allow us to get rid of that annoying ##n \pi## in the denominator, which is why I assume we should be trying to simplify these even further. I'm a bit lost here.

TheSodesa said:
Using trig identities doesn't seem to allow us to get rid of that annoying ##n \pi## in the denominator, which is why I assume we should be trying to simplify these even further. I'm a bit lost here.

PeroK said:

Of course.
So ##a_n = 0##.

As for ##b_n##, $$\cos(2 \pi n) = 1 \Rightarrow \frac{1 + \cos(n \pi) - 2\cos(2 \pi n)}{n \pi} = \frac{1+\cos(n \pi) - 2}{n \pi} = \frac{\cos(n \pi) - 1}{n \pi}$$

TheSodesa said:
Of course.
So ##a_n = 0##.

As for ##b_n##, $$\cos(2 \pi n) = 1 \Rightarrow \frac{1 + \cos(n \pi) - 2\cos(2 \pi n)}{n \pi} = \frac{1+\cos(n \pi) - 2}{n \pi} = \frac{\cos(n \pi) - 1}{n \pi}$$

Just a bit more to do ...

PS I take back what I said about this problem: it's a good work-out for the Fourier Analysis to come!

PeroK said:
Just a bit more to do ...

PS I take back what I said about this problem: it's a good work-out for the Fourier Analysis to come!

As far as I can see, the only thing we can do at this point is to say, that if ##n## is even, ##b_n = 0## , and if ##n## is odd, ##b_n = \frac{-2}{n\pi}, n \neq 0##.

TheSodesa said:
As far as I can see, teh only thing we can do at this point si to say, that if ##n## is even, ##b_n = 0## , and if ##n## is odd, ##b_n = \frac{-2}{n\pi}, n \neq 0##.

Yes. This sort of thing with ##1 \pm \cos(n\pi)## crops up frequently, so it's worth remembering this.

PeroK said:
Yes. This sort of thing with ##1 \pm \cos(n\pi)## crops up frequently, so it's worth remembering this.
Alright, thank you very much.

One last thing that is still bothring me is the fact that there were ##n##'s in the denominators of the expressions that reduced to zero as well. Do we not need to worry about those, or should I have included ##n \neq 0## with those as well?

TheSodesa said:
Alright, thank you very much.

One last thing that is still bothring me is the fact that there were ##n##'s in the denominators of the expressions that reduced to zero as well. Do we not need to worry about those, or should I have included ##n \neq 0## with those as well?

Technically, you still have ##n=0## to do. These are special cases, as ##\sin## and ##\cos## are constant. One thing to remember is that you cannot differentiate or integrate these and then plug in ##n=0## later. You must treat them as constant functions from the outset. It's the same with trig identities. You can easily go wrong if you don't exclude ##n=0## before you use an identity.

PeroK said:
Technically, you still have ##n=0## to do. These are special cases, as ##\sin## and ##\cos## are constant. One thing to remember is that you cannot differentiate or integrate these and then plug in ##n=0## later. You must treat them as constant functions from the outset. It's the same with trig identities. You can easily go wrong if you don't exclude ##n=0## before you use an identity.

Ok, but I think I have spent long enough on this problem. I have other work to do as well. I'll ask about the ##n = 0## case when I turn these in.

## What is the period of a piecewise function?

The period of a piecewise function is the length of one complete cycle of the function. It is the distance between two consecutive points where the function has the same value and the same direction of change.

## How is the period of a piecewise function calculated?

The period of a piecewise function can be calculated by finding the distance between two consecutive points where the function has the same value and the same direction of change. This can be done by finding the difference between the x-coordinates of the two points.

## What is angular frequency of a piecewise function?

The angular frequency of a piecewise function is a measure of how fast the function completes one full cycle. It is equal to 2π divided by the period of the function.

## How is angular frequency related to period in a piecewise function?

Angular frequency and period are inversely related in a piecewise function. This means that as the period increases, the angular frequency decreases, and vice versa. This relationship is given by the formula ω = 2π/T, where ω is the angular frequency and T is the period.

## Can a piecewise function have multiple periods and angular frequencies?

Yes, a piecewise function can have multiple periods and angular frequencies. This is because a piecewise function is made up of different segments, each with its own period and angular frequency. The overall period and angular frequency of the function will depend on the individual periods and angular frequencies of each segment.

• Calculus and Beyond Homework Help
Replies
1
Views
428
• Calculus and Beyond Homework Help
Replies
3
Views
655
• Calculus and Beyond Homework Help
Replies
6
Views
451
• Calculus and Beyond Homework Help
Replies
3
Views
673
• Calculus and Beyond Homework Help
Replies
5
Views
433
• Calculus and Beyond Homework Help
Replies
8
Views
408
• Calculus and Beyond Homework Help
Replies
1
Views
610
• Calculus and Beyond Homework Help
Replies
3
Views
737
• Calculus and Beyond Homework Help
Replies
1
Views
555
• Calculus and Beyond Homework Help
Replies
1
Views
727