-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFourier Trigonometric Series.nb
4011 lines (3868 loc) · 160 KB
/
Fourier Trigonometric Series.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 11.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 163700, 4003]
NotebookOptionsPosition[ 152309, 3816]
NotebookOutlinePosition[ 152693, 3832]
CellTagsIndexPosition[ 152650, 3829]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Trigonometric Fourier Series", "Title",
CellChangeTimes->{{3.8451404729399767`*^9, 3.8451405047577963`*^9}, {
3.867012093198598*^9, 3.8670121003800087`*^9}},
TextAlignment->Center,ExpressionUUID->"0085b437-c676-49a4-abf5-0784de703d2b"],
Cell["\<\
Universidad Nacional de Colombia
Facultad de Ciencias
Judol Alejandro Rodr\[IAcute]guez Franco\
\>", "Affiliation",
CellChangeTimes->{{3.8670123963593984`*^9, 3.8670124110964727`*^9}, {
3.8670124694327574`*^9, 3.8670124834738293`*^9}},
TextAlignment->Center,ExpressionUUID->"2253ee8c-6c85-4e76-aa33-a4dfd844e198"],
Cell["\<\
This notebook is intended to give a quick review on the Fourier trigonometric \
real and complex series as well as provide an easy tool to calculate Fourier \
Coefficients and generate plots for a given function and periodicity\
\>", "Abstract",
CellChangeTimes->{{3.8670125045789356`*^9, 3.867012546661143*^9}, {
3.86701257733629*^9, 3.8670125794502935`*^9}, {3.86701285990166*^9,
3.867012913723928*^9}, {3.86701294593509*^9, 3.867013020108446*^9},
3.8670132306358027`*^9},ExpressionUUID->"293f62f3-8f1a-409c-9114-\
44eec24c3645"],
Cell[CellGroupData[{
Cell["Fourier Trigonometric Series", "Section",
CellChangeTimes->{{3.8670291035798035`*^9,
3.8670291134998503`*^9}},ExpressionUUID->"4d266491-d0ea-4ad8-98ac-\
3908fa514501"],
Cell[TextData[{
"The Fourier Series is a method which consist in representing any periodic \
function or signal ",
Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"f", "(", "t", ")"}], "=",
RowBox[{"f", "(",
RowBox[{"t", "+", "nT"}], ")"}]}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"4b721d68-941b-4fad-9631-10166c6254d9"],
" with periodicity ",
Cell[BoxData[
FormBox["T", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"7be37899-33ed-4ca8-9f7d-7cc662ed02ba"],
" as a superposition (infinite sum) of sine and cosine functions, it also \
works to turn a generic function into a periodic signal function given the \
starting and ending points where the function is intended to repeat, that is, \
two points ",
Cell[BoxData[
FormBox[
RowBox[{"a", ",", "b"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"eb2723e6-5168-43f7-883e-94a7e4ee8e93"],
". \n\nThe trick to represent a function as a series of sines and cosines \
relies on the ",
StyleBox["Fourier\[CloseCurlyQuote]s trigonometric formula",
FontWeight->"Bold"],
" given by:"
}], "Text",
CellChangeTimes->{{3.867013856877447*^9, 3.867014133564148*^9}, {
3.867014177671667*^9, 3.867014219079007*^9}, {3.8670143643482885`*^9,
3.8670144519812484`*^9}, {3.8670145830446835`*^9, 3.8670147062556725`*^9},
3.867014739813571*^9},ExpressionUUID->"a7186f60-9b86-4462-9dd6-\
5dcc825ae334"],
Cell[BoxData[
RowBox[{
RowBox[{"f",
RowBox[{"(", "t", ")"}]}], "=",
RowBox[{
FractionBox[
SubscriptBox["a", "0"], "2"], "+",
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"n", "=", "1"}], "\[Infinity]"],
RowBox[{
SubscriptBox["a", "n"], "cos",
RowBox[{"(",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], ")"}]}]}], "+",
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"n", "=", "1"}], "\[Infinity]"],
RowBox[{
SubscriptBox["b", "n"], "*", "sin",
RowBox[{"(",
RowBox[{"n", "*", "\[Omega]", "*", "t"}],
")"}]}]}]}]}]], "DisplayFormula",
CellChangeTimes->{{3.867014677221024*^9, 3.867014702619466*^9}},
TextAlignment->Center,ExpressionUUID->"6c5a01bf-3262-4e86-8a77-46f57b73d487"],
Cell[TextData[{
"where the coefficients ",
Cell[BoxData[
FormBox[
RowBox[{
SubscriptBox["a", "0"], ",", " ",
SubscriptBox["a", "n"], ",", " ",
SubscriptBox["b", "n"]}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"054fec48-b5fa-435e-896e-d379fcb7b782"],
" are called the ",
StyleBox["Fourier Coefficients",
FontWeight->"Bold"],
" and are calculated by means of the following formulas:"
}], "Text",
CellChangeTimes->{{3.8670148430054455`*^9, 3.867014907911091*^9},
3.867015262995257*^9},ExpressionUUID->"8e01ef3a-1e89-4f37-8cae-\
6eb7ff8c69f5"],
Cell[TextData[Cell[BoxData[{
RowBox[{
SubscriptBox["a", "0"], "=",
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{"f",
RowBox[{"(", "t", ")"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}]}], "\[IndentingNewLine]",
RowBox[{
SubscriptBox["a", "n"], "=",
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{"f",
RowBox[{"(", "t", ")"}], "*", "cos",
RowBox[{"(",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], ")"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}]}], "\[IndentingNewLine]",
RowBox[{
SubscriptBox["b", "n"], "=",
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{"f",
RowBox[{"(", "t", ")"}], "*", "sin",
RowBox[{"(",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], ")"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}]}]}], "InlineFormula",
CellChangeTimes->{{3.844643612609451*^9, 3.8446436325325904`*^9}, {
3.8446436905769105`*^9, 3.8446436915319653`*^9}, {3.844644469531464*^9,
3.844644473383684*^9}, {3.844644802467507*^9, 3.844644803781582*^9}, {
3.8446449288047333`*^9, 3.844644928958742*^9}, {3.844644988854168*^9,
3.844644994927515*^9}, {3.8446467523310328`*^9, 3.8446467556492224`*^9}, {
3.84464888431398*^9, 3.8446489678857603`*^9}, {3.8446490443611345`*^9,
3.8446490453031883`*^9}, {3.844649138745533*^9, 3.844649144514863*^9}, {
3.844650951166198*^9, 3.844650973809493*^9}, {3.8447190627681894`*^9,
3.844719063047206*^9}},ExpressionUUID->"e0b1e1b1-ef78-4576-8e95-\
9a8ffdc3ece5"]], "Text",
CellChangeTimes->{
3.867014962403183*^9, {3.8670150194884243`*^9, 3.867015145085532*^9}},
TextAlignment->Center,ExpressionUUID->"bb0c2945-b667-48ef-ae2d-1b4b713384bb"],
Cell[TextData[{
"and ",
Cell[BoxData[
FormBox[
SubscriptBox["a", "0"], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"bb0f20b3-8b91-4b47-9b41-0e4e6c219677"],
" represents the midpoint of the oscillatory signal amplitude, ",
Cell[BoxData[
FormBox[
SubscriptBox["a", "n"], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"7fcef694-c0f5-43ec-b250-e31d60563687"],
" the amplitude of the even part of the function, and ",
Cell[BoxData[
FormBox[
SubscriptBox["b", "n"], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"633d30c3-2495-4fb6-b1f8-d63d9d077738"],
" the amplitude of the odd part of the function."
}], "Text",
CellChangeTimes->{{3.867019564817311*^9,
3.867019684627888*^9}},ExpressionUUID->"33c05f98-19a3-4500-bea9-\
618e8e1519d0"]
}, Open ]],
Cell[CellGroupData[{
Cell["Fourier complex exponential series", "Section",
CellChangeTimes->{{3.8670196921349363`*^9, 3.867019722510081*^9}, {
3.867027451480539*^9,
3.867027455588557*^9}},ExpressionUUID->"0517baff-d03f-4b22-af2a-\
c396e4803bff"],
Cell[TextData[{
"As long as there is a mathematical relation between trigonometric functions \
and complex numbers, the trigonometric real series can be simplified as a \
trigonometric ",
StyleBox["Complex Fourier series",
FontWeight->"Bold"],
" in the form"
}], "Text",
CellChangeTimes->{{3.8670152939080176`*^9, 3.867015390751495*^9}, {
3.867029055570548*^9,
3.867029062412574*^9}},ExpressionUUID->"800b6b22-90aa-4ada-8b4e-\
56ac3cc0fa6c"],
Cell[BoxData[
RowBox[{
RowBox[{"f",
RowBox[{"(", "t", ")"}]}], "=",
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"n", "=",
RowBox[{"-", "\[Infinity]"}]}], "\[Infinity]"],
RowBox[{
SubscriptBox["c", "n"],
SuperscriptBox["e", "in\[Omega]t"]}]}]}]], "DisplayFormula",
CellChangeTimes->{{3.867014677221024*^9, 3.867014702619466*^9}, {
3.867027586998223*^9, 3.8670276628985825`*^9}},
TextAlignment->Center,ExpressionUUID->"19206598-6ea6-40f7-904a-0a78f37aec1e"],
Cell[TextData[{
"where ",
Cell[BoxData[
FormBox[
SubscriptBox["c", "n"], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"ed116171-d17b-4894-a717-48a0309e9f33"],
" is the ",
StyleBox["complex fourier coefficient",
FontWeight->"Bold"],
" and can be calculated with the following integral formula:"
}], "Text",
CellChangeTimes->{{3.8670276686416073`*^9, 3.8670276709526105`*^9}, {
3.867028024728371*^9, 3.86702808162864*^9}, {3.867028116532804*^9,
3.867028124852849*^9}},ExpressionUUID->"aed72c9e-de8b-4cd6-8c0d-\
1a38cb3131c8"],
Cell[TextData[Cell[BoxData[
RowBox[{
SubscriptBox["c", "n"], "=",
RowBox[{
FractionBox["1", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{"f",
RowBox[{"(", "t", ")"}],
SuperscriptBox["e", "in\[Omega]t"],
RowBox[{"\[DifferentialD]", "t"}]}]}]}]}]], "InlineFormula",
CellChangeTimes->{{3.844643612609451*^9, 3.8446436325325904`*^9}, {
3.8446436905769105`*^9, 3.8446436915319653`*^9}, {3.844644469531464*^9,
3.844644473383684*^9}, {3.844644802467507*^9, 3.844644803781582*^9}, {
3.8446449288047333`*^9, 3.844644928958742*^9}, {3.844644988854168*^9,
3.844644994927515*^9}, {3.8446467523310328`*^9, 3.8446467556492224`*^9}, {
3.84464888431398*^9, 3.8446489678857603`*^9}, {3.8446490443611345`*^9,
3.8446490453031883`*^9}, {3.844649138745533*^9, 3.844649144514863*^9}, {
3.844650951166198*^9, 3.844650973809493*^9}, {3.8447190627681894`*^9,
3.844719063047206*^9}},ExpressionUUID->"2f43aed4-93d9-49df-a923-\
6036f70e9fcd"]], "Text",
CellChangeTimes->{
3.867028177759123*^9, {3.8670283627610044`*^9, 3.8670283760820584`*^9}, {
3.867028428754319*^9, 3.867028476200538*^9}},
TextAlignment->Center,ExpressionUUID->"5d41b075-8722-4c19-8ac3-bab90e812998"],
Cell["\<\
or it can be calculated by using the trigonometric coefficients\
\>", "Text",
CellChangeTimes->{{3.86702813821492*^9,
3.8670281589340143`*^9}},ExpressionUUID->"fd8bcafb-ac59-4dad-9601-\
5fe389efd2ce"],
Cell[TextData[Cell[BoxData[
FormBox[
RowBox[{
SubscriptBox["c", "n"], "=", "\[InvisibleSpace]",
TagBox[GridBox[{
{"\[Piecewise]", GridBox[{
{
FractionBox[
SubscriptBox["a", "0"], "2"],
RowBox[{"n", "\[Equal]", "0"}]},
{
RowBox[{
FractionBox["1", "2"], " ",
RowBox[{"(",
RowBox[{
SubscriptBox["a", "n"], "-", " ",
RowBox[{"i", " ",
SubscriptBox["b", "n"]}]}], ")"}]}],
RowBox[{"n", ">", "0"}]},
{
RowBox[{
FractionBox["1", "2"], " ",
RowBox[{"(",
RowBox[{
SubscriptBox["a", "n"], "+", " ",
RowBox[{"i", " ",
SubscriptBox["b", "n"]}]}], ")"}]}],
RowBox[{"n", "<", "0"}]}
},
AllowedDimensions->{2, Automatic},
Editable->True,
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.84]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}},
Selectable->True]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{1.}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.35]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]},
Offset[0.2]}}],
"Piecewise",
DeleteWithContents->True,
Editable->False,
SelectWithContents->True,
Selectable->False,
StripWrapperBoxes->True]}], TraditionalForm]],
FormatType->
"TraditionalForm",ExpressionUUID->"db2a6ed5-1281-4ec8-a5a9-4e41f86e1977"]], \
"Text",
CellChangeTimes->{{3.8670278076932955`*^9, 3.8670278960817165`*^9}, {
3.8670279319968896`*^9, 3.8670279559990005`*^9}, {3.867028002892273*^9,
3.867028018655346*^9}},
TextAlignment->Center,ExpressionUUID->"55387f61-cdd9-40bb-a8cf-22eb4899cd8e"],
Cell["", "Text",
CellChangeTimes->{{3.867028090998685*^9, 3.8670281046787524`*^9},
3.867028134966899*^9},ExpressionUUID->"5059cc0d-f9d5-46de-803b-\
9abb3cbe998b"]
}, Open ]],
Cell[CellGroupData[{
Cell["Code Construction", "Section",
CellChangeTimes->{{3.8446392052123623`*^9, 3.8446392113127112`*^9}, {
3.844648777626873*^9, 3.8446487849962945`*^9}, {3.867019877952838*^9,
3.8670198816458607`*^9}},ExpressionUUID->"308115d4-7089-4a48-8524-\
2d726b547d24"],
Cell[CellGroupData[{
Cell["Oscillatory parameters", "Subsubsection",
CellChangeTimes->{{3.8446370596246414`*^9, 3.8446370633718557`*^9}, {
3.844641857706076*^9, 3.844641858208105*^9}, {3.8446444295801787`*^9,
3.844644430051206*^9}, {3.84464477805311*^9, 3.8446447785121365`*^9}, {
3.8446452483800116`*^9, 3.844645248929043*^9}, {3.8446454611901836`*^9,
3.844645463009288*^9}, {3.8446475201279483`*^9, 3.8446475203939633`*^9}, {
3.8446495026853495`*^9, 3.8446495163421307`*^9}, {3.8670203256450214`*^9,
3.867020330647044*^9}},ExpressionUUID->"86273336-aaca-47b1-9775-\
eb3752d4b729"],
Cell[TextData[{
"Let\[CloseCurlyQuote]s define the function f(x) and calculate the \
periodicity interval given initial and final point of one oscillation (as an \
example ",
Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"f", "(", "x", ")"}], "=",
RowBox[{"x", "^", "2"}]}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"5c66e524-cc2a-47e1-bb4d-17da245442d7"],
" from ",
Cell[BoxData[
FormBox["0", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"9f4b9fb0-f825-4cd9-9be4-f59078861501"],
" to ",
Cell[BoxData[
FormBox["4", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"4d43694a-8aed-412b-b6b2-02bd0971b93c"],
"):"
}], "Text",
CellChangeTimes->{{3.844636957154781*^9, 3.8446369617860456`*^9}, {
3.8446369921577826`*^9, 3.8446370359352865`*^9}, {3.8446370686561584`*^9,
3.8446370724423747`*^9}, {3.844637113481722*^9, 3.8446371147267933`*^9},
3.844641906146847*^9, {3.8446444354625154`*^9, 3.8446444417238736`*^9},
3.8446447750889406`*^9, {3.8446452694342155`*^9, 3.8446452736064544`*^9}, {
3.8446454663494787`*^9, 3.844645470864737*^9}, 3.8446503308937197`*^9, {
3.8447193804203587`*^9, 3.844719425568941*^9}, {3.8670200371776114`*^9,
3.8670200933398876`*^9}, {3.867020233616554*^9,
3.8670202882918177`*^9}},ExpressionUUID->"a2b3fcf8-5862-4148-a9b7-\
177c70d208b7"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"f", "[", "x_", "]"}], "=",
RowBox[{"x", "^", "2"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"a", "=", "0"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"b", "=", "4"}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"T", "=",
RowBox[{"b", "-", "a"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"\[Omega]", "=",
RowBox[{"2",
RowBox[{"\[Pi]", "/", "T"}]}]}], ";"}]}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.844637119052041*^9, 3.8446371291816196`*^9}, {
3.8446371922002244`*^9, 3.8446373218656406`*^9}, {3.844637405138404*^9,
3.844637427556686*^9}, {3.844637479286645*^9, 3.844637485180982*^9},
3.8446375406781564`*^9, {3.8446375949392595`*^9, 3.8446375951772738`*^9}, {
3.8446376564847803`*^9, 3.844637657814856*^9}, {3.844637788890353*^9,
3.844637805167284*^9}, {3.8446379164506493`*^9, 3.844638425983793*^9}, {
3.8446384826250324`*^9, 3.844638490761498*^9}, {3.8446390422540417`*^9,
3.844639060448082*^9}, {3.844639244595615*^9, 3.8446392466707335`*^9}, {
3.844641920869689*^9, 3.84464202859085*^9}, {3.8446421288585854`*^9,
3.8446421291586027`*^9}, {3.844642259315047*^9, 3.844642260107092*^9},
3.844642291208871*^9, 3.844642931065469*^9, {3.8446444495363207`*^9,
3.8446444554806604`*^9}, {3.8446447835294237`*^9, 3.8446447870416245`*^9},
3.844644981852767*^9, {3.8446452774046717`*^9, 3.8446452814529033`*^9}, {
3.8446454746109514`*^9, 3.8446454800542626`*^9}, {3.8446484131240244`*^9,
3.844648418655341*^9}, {3.844648485354156*^9, 3.8446484856091704`*^9}, {
3.844650672100236*^9, 3.8446506734143114`*^9}, {3.844650878865062*^9,
3.84465090521657*^9}, {3.844651053417046*^9, 3.8446510727501516`*^9}, {
3.8446518823754597`*^9, 3.8446519135622435`*^9}, {3.844719201910148*^9,
3.8447192062543964`*^9}, {3.8447193384839597`*^9, 3.844719345536363*^9}, {
3.8447194568017273`*^9, 3.8447194789199924`*^9}, {3.8448610258140917`*^9,
3.844861047955358*^9}, {3.8448611342142916`*^9, 3.8448611593517294`*^9}, {
3.8448613298914833`*^9, 3.8448613368978844`*^9}, {3.8448613796693306`*^9,
3.8448613864477186`*^9}, {3.8448615635098457`*^9,
3.8448615818308935`*^9}, {3.844861649786781*^9, 3.8448616608634143`*^9}, {
3.844861823281704*^9, 3.8448618389175987`*^9}, {3.8451399073596272`*^9,
3.8451399082896805`*^9}, {3.845140513586301*^9, 3.8451405162544537`*^9}, {
3.867013477658477*^9, 3.8670136039622493`*^9}, {3.8670136348899636`*^9,
3.867013670692145*^9}, 3.8670169632315645`*^9, 3.86701993587012*^9, {
3.8670199718912954`*^9, 3.867019982995346*^9}, {3.8670200989139113`*^9,
3.8670201002739134`*^9}, {3.867020163379222*^9, 3.867020186689337*^9},
3.8670239914591293`*^9, {3.867026289823679*^9, 3.8670262903036795`*^9}, {
3.867026344068941*^9, 3.867026384895136*^9}},
CellLabel->"In[6]:=",ExpressionUUID->"c5811644-1423-421a-95e6-8e716ac164a0"],
Cell["\<\
now, show the calculated values and the plot of the original function \
centered at the given interval\
\>", "Text",
CellChangeTimes->{{3.86702012035301*^9,
3.867020179918295*^9}},ExpressionUUID->"3df35df2-16cb-4ae8-b51a-\
d7e53704e2fd"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"Print", "[",
RowBox[{"\"\<The functions is f(x)=\>\"", ",", " ",
RowBox[{"f", "[", "x", "]"}], ",", " ", "\"\< with a period T=\>\"", ",",
" ", "T", ",", " ", "\"\< and a frequency \[Omega]=\>\"", ",",
"\[Omega]"}], "]"}], " "}], "\[IndentingNewLine]",
RowBox[{"Plot", "[",
RowBox[{
RowBox[{"{",
RowBox[{"f", "[", "x", "]"}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",",
RowBox[{"(",
RowBox[{"a", "-", "1"}], ")"}], ",",
RowBox[{"(",
RowBox[{"b", "+", "1"}], ")"}]}], "}"}], ",",
RowBox[{"PlotLabel", "\[Rule]", "\"\<Function to expand\>\""}]}],
"]"}]}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.8447188747564363`*^9, 3.8447188904273324`*^9}, {
3.8451405461211624`*^9, 3.8451405736187353`*^9}, {3.8670201680132446`*^9,
3.867020169113246*^9}, {3.867029177434145*^9, 3.867029225059887*^9}, {
3.867029256037671*^9, 3.867029281600794*^9}},
CellLabel->"In[11]:=",ExpressionUUID->"bd210722-cba6-481f-973a-dbbf5c6df14f"],
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"The functions is f(x)=\"\>", "\[InvisibleSpace]",
SuperscriptBox["x", "2"], "\[InvisibleSpace]", "\<\" with a period T=\"\>",
"\[InvisibleSpace]", "4",
"\[InvisibleSpace]", "\<\" and a frequency \[Omega]=\"\>",
"\[InvisibleSpace]",
FractionBox["\[Pi]", "2"]}],
SequenceForm[
"The functions is f(x)=", $CellContext`x^2, " with a period T=", 4,
" and a frequency \[Omega]=", Rational[1, 2] Pi],
Editable->False]], "Print",
CellChangeTimes->{
3.8670201917303605`*^9, 3.867020456554659*^9, 3.867023996504165*^9, {
3.867025253662324*^9, 3.8670252676663933`*^9}, {3.8670262374444323`*^9,
3.8670262530665045`*^9}, 3.8670262936807003`*^9, 3.867026406883253*^9,
3.8670292873698177`*^9, 3.867029658209528*^9, 3.867030539548958*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[11]:=",ExpressionUUID->"f3e5234e-f1ad-49f2-8288-67d75f866817"],
Cell[BoxData[
GraphicsBox[{{{}, {},
TagBox[
{RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
1.], LineBox[CompressedData["
1:eJwVl1cgFmwfhx87K+Mxi7KSEJJ4CP9bka2SEEUDaUnCW2QXkpm8ZFPI3nvc
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LU956bJJThda75ZyMRXR316lF5QEIqiW5cVh1E
tNMaq3fAm4Ssxr6XnBknIsP7wyvLmSREn7IVYDFBRLkjDtPi+SSUc5/O0mWK
iNQOG9vYlpDQr20huoJZIqIW3uH6VktCAQfMTATJRMTG3yH8rZ+EpKduS6is
EdFBqaoA0RES6kt32jP9QUTmxE0P2wkSOqQYlhb6i4iemelwriySUAMhwTVr
i4iuVVkVn1glIdvWrPOt20T0eL1t2mmDhJhCK4Rndoio+u/TxIo/JJRv0vpr
b4+IYMTx+94eCf0PiYRcJw==
"]]},
Annotation[#, "Charting`Private`Tag$9383#1"]& ]}, {}},
AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{False, False}, {False, False}},
FrameLabel->{{None, None}, {None, None}},
FrameTicks->{{Automatic,
Charting`ScaledFrameTicks[{Identity, Identity}]}, {Automatic,
Charting`ScaledFrameTicks[{Identity, Identity}]}},
GridLines->{None, None},
GridLinesStyle->Directive[
GrayLevel[0.5, 0.4]],
ImagePadding->All,
Method->{
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" ->
AbsolutePointSize[6], "ScalingFunctions" -> None,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& )}},
PlotLabel->FormBox["\"Function to expand\"", TraditionalForm],
PlotRange->{{-1, 5}, {0., 24.999998775510218`}},
PlotRangeClipping->True,
PlotRangePadding->{{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.05],
Scaled[0.05]}},
Ticks->{Automatic, Automatic}]], "Output",
CellChangeTimes->{{3.844718893340499*^9, 3.844718903063055*^9},
3.8447189885199428`*^9, 3.84471906573936*^9, 3.8447192127527685`*^9,
3.8447193486505413`*^9, {3.844719465113202*^9, 3.844719485627376*^9},
3.844861056681857*^9, 3.8448611399136176`*^9, 3.844861195797814*^9,
3.8448613417011595`*^9, 3.8448615872102013`*^9, {3.84513991492806*^9,
3.8451399348231983`*^9}, 3.8451400326087914`*^9, 3.8451403972976503`*^9,
3.845140521865775*^9, 3.8451405798230896`*^9, 3.86702019182036*^9,
3.867020456634659*^9, 3.867023996594165*^9, {3.867025254233324*^9,
3.8670252677753935`*^9}, {3.8670262375954323`*^9, 3.8670262531565046`*^9},
3.8670262937607*^9, 3.8670264069932528`*^9, 3.867029287489818*^9,
3.8670296585345316`*^9, 3.867030539784959*^9},
CellLabel->"Out[12]=",ExpressionUUID->"a3189f4f-bef3-4801-8a75-4f987c39c40f"]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Coefficients", "Subsubsection",
CellChangeTimes->{{3.8670203551521587`*^9,
3.8670203595131807`*^9}},ExpressionUUID->"5fb7742c-3a30-476e-877d-\
977a411c2e57"],
Cell["\<\
The integrals are defined in order to calulate the coefficients explicitly:\
\>", "Text",
CellChangeTimes->{{3.844642303569578*^9, 3.844642333906313*^9}, {
3.867020301251889*^9, 3.8670203187569866`*^9}, {3.8670203909893436`*^9,
3.867020393320347*^9}},ExpressionUUID->"966b761c-8ccb-44b9-817e-\
1d169f520718"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"a0", "[", "n_", "]"}], "=",
RowBox[{"Refine", "[",
RowBox[{
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{
RowBox[{"f", "[", "t", "]"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}], ",",
RowBox[{"Element", "[",
RowBox[{"n", ",", "Integers"}], "]"}]}], "]"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"an", "[", "n_", "]"}], "=",
RowBox[{"Refine", "[",
RowBox[{
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{
RowBox[{"f", "[", "t", "]"}], "*",
RowBox[{"Cos", "[",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], "]"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}], ",",
RowBox[{"Element", "[",
RowBox[{"n", ",", "Integers"}], "]"}]}], "]"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"bn", "[", "n_", "]"}], "=",
RowBox[{"Refine", "[",
RowBox[{
RowBox[{
FractionBox["2", "T"],
RowBox[{
SubsuperscriptBox["\[Integral]", "a", "b"],
RowBox[{
RowBox[{"f", "[", "t", "]"}], "*",
RowBox[{"Sin", "[",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], "]"}],
RowBox[{"\[DifferentialD]", "t"}]}]}]}], ",",
RowBox[{"Element", "[",
RowBox[{"n", ",", "Integers"}], "]"}]}], "]"}]}],
";"}], "\[IndentingNewLine]"}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.844643612609451*^9, 3.8446436325325904`*^9}, {
3.8446436905769105`*^9, 3.8446436915319653`*^9}, {3.844644469531464*^9,
3.844644473383684*^9}, {3.844644802467507*^9, 3.844644803781582*^9}, {
3.8446449288047333`*^9, 3.844644928958742*^9}, {3.844644988854168*^9,
3.844644994927515*^9}, {3.8446467523310328`*^9, 3.8446467556492224`*^9}, {
3.84464888431398*^9, 3.8446489678857603`*^9}, {3.8446490443611345`*^9,
3.8446490453031883`*^9}, {3.844649138745533*^9, 3.844649144514863*^9}, {
3.844650951166198*^9, 3.844650973809493*^9}, {3.8447190627681894`*^9,
3.844719063047206*^9}, {3.867016061060811*^9, 3.867016073124879*^9}},
CellLabel->"In[13]:=",ExpressionUUID->"436dd713-e204-4d7a-8f0c-ea4a9815eea0"],
Cell["Now the coefficient values are printed:", "Text",
CellChangeTimes->{{3.8670204001783743`*^9,
3.867020409699423*^9}},ExpressionUUID->"8d22f3b7-e88c-40a2-bc9b-\
f431ba55bc41"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{"Print", "[", " ", "\"\<The coefficients obtained are:\>\"",
"]"}], "\n",
RowBox[{"Print", "[",
RowBox[{"\"\<\!\(\*SubscriptBox[\(a\), \(0\)]\)=\>\"", ",", " ",
RowBox[{"a0", "[", "n", "]"}]}], "]"}], "\n",
RowBox[{"Print", "[",
RowBox[{"\"\<\!\(\*SubscriptBox[\(a\), \(n\)]\)=\>\"", ",", " ",
RowBox[{"an", "[", "n", "]"}]}], "]"}], "\n",
RowBox[{"Print", "[",
RowBox[{"\"\<\!\(\*SubscriptBox[\(b\), \(n\)]\)=\>\"", ",", " ",
RowBox[{"bn", "[", "n", "]"}]}], "]"}]}], "Code",
CellChangeTimes->{3.8670204402645674`*^9},
CellLabel->"In[16]:=",ExpressionUUID->"51257776-349e-4887-a0a0-e95747b83b15"],
Cell[CellGroupData[{
Cell[BoxData["\<\"The coefficients obtained are:\"\>"], "Print",
CellChangeTimes->{{3.8670204426915865`*^9, 3.8670204673327103`*^9},
3.8670240025742025`*^9, {3.8670252563733444`*^9, 3.867025275777438*^9}, {
3.867026242579457*^9, 3.8670262998307257`*^9}, 3.867026360453015*^9, {
3.8670263909981613`*^9, 3.8670264150442843`*^9}, 3.8670296620226607`*^9,
3.867030548479989*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[16]:=",ExpressionUUID->"78cd7ec9-6fd9-42c3-8db7-8320cdfd51d1"],
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"\\!\\(\\*SubscriptBox[\\(a\\), \\(0\\)]\\)=\"\>",
"\[InvisibleSpace]",
FractionBox["32", "3"]}],
SequenceForm["\!\(\*SubscriptBox[\(a\), \(0\)]\)=",
Rational[32, 3]],
Editable->False]], "Print",
CellChangeTimes->{{3.8670204426915865`*^9, 3.8670204673327103`*^9},
3.8670240025742025`*^9, {3.8670252563733444`*^9, 3.867025275777438*^9}, {
3.867026242579457*^9, 3.8670262998307257`*^9}, 3.867026360453015*^9, {
3.8670263909981613`*^9, 3.8670264150442843`*^9}, 3.8670296620226607`*^9,
3.867030548479989*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[16]:=",ExpressionUUID->"7497d531-f68d-43bf-afbc-4e0b0ae0b8c8"],
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"\\!\\(\\*SubscriptBox[\\(a\\), \\(n\\)]\\)=\"\>",
"\[InvisibleSpace]",
FractionBox["16",
RowBox[{
SuperscriptBox["n", "2"], " ",
SuperscriptBox["\[Pi]", "2"]}]]}],
SequenceForm[
"\!\(\*SubscriptBox[\(a\), \(n\)]\)=", 16 $CellContext`n^(-2) Pi^(-2)],
Editable->False]], "Print",
CellChangeTimes->{{3.8670204426915865`*^9, 3.8670204673327103`*^9},
3.8670240025742025`*^9, {3.8670252563733444`*^9, 3.867025275777438*^9}, {
3.867026242579457*^9, 3.8670262998307257`*^9}, 3.867026360453015*^9, {
3.8670263909981613`*^9, 3.8670264150442843`*^9}, 3.8670296620226607`*^9,
3.8670305484899893`*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[16]:=",ExpressionUUID->"eba72b49-9f38-4f6b-80bc-00b9df7e4d43"],
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"\\!\\(\\*SubscriptBox[\\(b\\), \\(n\\)]\\)=\"\>",
"\[InvisibleSpace]",
RowBox[{"-",
FractionBox["16",
RowBox[{"n", " ", "\[Pi]"}]]}]}],
SequenceForm[
"\!\(\*SubscriptBox[\(b\), \(n\)]\)=", (-16) $CellContext`n^(-1)/Pi],
Editable->False]], "Print",
CellChangeTimes->{{3.8670204426915865`*^9, 3.8670204673327103`*^9},
3.8670240025742025`*^9, {3.8670252563733444`*^9, 3.867025275777438*^9}, {
3.867026242579457*^9, 3.8670262998307257`*^9}, 3.867026360453015*^9, {
3.8670263909981613`*^9, 3.8670264150442843`*^9}, 3.8670296620226607`*^9,
3.867030548499989*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[16]:=",ExpressionUUID->"4beca5d0-1932-4105-9ebf-c839d5b29419"]
}, Open ]]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Trigonometric Series", "Subsection",
CellChangeTimes->{{3.867020598119339*^9,
3.8670206104853935`*^9}},ExpressionUUID->"cf8f12b5-52ea-4657-b39e-\
fa0f46fbe505"],
Cell["\<\
Now that the needed components where found, the series is completely defined \
with the general formula.\
\>", "Text",
CellChangeTimes->{{3.844642186795899*^9, 3.8446422238360176`*^9}, {
3.844649328439383*^9, 3.8446493563679805`*^9}, {3.844649391763005*^9,
3.844649397499333*^9}, {3.8670207730211964`*^9, 3.8670209276479445`*^9}, {
3.8670209727101693`*^9, 3.8670209766921906`*^9}, {3.8670214943147154`*^9,
3.867021534517915*^9}},ExpressionUUID->"05ac0167-3318-4b48-a18c-\
a619b44a59ca"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{"Print", "[",
RowBox[{"\"\<Then, the Fourier Series expansion of f(t)=\>\"", ",", " ",
RowBox[{"f", "[", "t", "]"}], ",", " ", "\"\< is given by: \>\""}],
"]"}], "\n",
RowBox[{"Print", "[",
RowBox[{"\"\<f(t)=\>\"", ",",
FractionBox[
RowBox[{"a0", "[", "n", "]"}], "2"], ",",
"\"\<+\!\(\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \
\(\[Infinity]\)]\)(\>\"", ",", " ",
RowBox[{
RowBox[{"an", "[", "n", "]"}], "*",
RowBox[{"Cos", "[",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], "]"}]}], ",", "\"\<)+(\>\"",
",", " ",
RowBox[{
RowBox[{"bn", "[", "n", "]"}], "*",
RowBox[{"Sin", "[",
RowBox[{"n", "*", "\[Omega]", "*", "t"}], "]"}]}], ",", "\"\<))\>\""}],
"]"}]}], "Code",
CellChangeTimes->{3.86702146747758*^9},
CellLabel->"In[20]:=",ExpressionUUID->"9e7ce53c-70cf-41d3-ab56-835809918015"],
Cell[CellGroupData[{
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"Then, the Fourier Series expansion of f(t)=\"\>",
"\[InvisibleSpace]",
SuperscriptBox["t", "2"], "\[InvisibleSpace]", "\<\" is given by: \"\>"}],
SequenceForm[
"Then, the Fourier Series expansion of f(t)=", $CellContext`t^2,
" is given by: "],
Editable->False]], "Print",
CellChangeTimes->{
3.867021468839582*^9, 3.8670240054842315`*^9, {3.8670252564133444`*^9,
3.8670252784364443`*^9}, 3.867026398185205*^9, 3.86702645252305*^9,
3.867029662216665*^9, 3.867030551515009*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[20]:=",ExpressionUUID->"c6c7f8c3-aabe-4464-bc96-73c1ef03ee0d"],
Cell[BoxData[
InterpretationBox[
RowBox[{"\<\"f(t)=\"\>", "\[InvisibleSpace]",
FractionBox["16", "3"],
"\[InvisibleSpace]", "\<\"+\\!\\(\\*UnderoverscriptBox[\\(\[Sum]\\), \\(n \
= 1\\), \\(\[Infinity]\\)]\\)(\"\>", "\[InvisibleSpace]",
FractionBox[
RowBox[{"16", " ",
RowBox[{"Cos", "[",
FractionBox[
RowBox[{"n", " ", "\[Pi]", " ", "t"}], "2"], "]"}]}],
RowBox[{
SuperscriptBox["n", "2"], " ",
SuperscriptBox["\[Pi]", "2"]}]], "\[InvisibleSpace]", "\<\")+(\"\>",
"\[InvisibleSpace]",
RowBox[{"-",
FractionBox[
RowBox[{"16", " ",
RowBox[{"Sin", "[",
FractionBox[
RowBox[{"n", " ", "\[Pi]", " ", "t"}], "2"], "]"}]}],
RowBox[{"n", " ", "\[Pi]"}]]}], "\[InvisibleSpace]", "\<\"))\"\>"}],
SequenceForm["f(t)=",
Rational[16, 3],
"+\!\(\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(\[Infinity]\)]\)(",
16 $CellContext`n^(-2) Pi^(-2)
Cos[Rational[1, 2] $CellContext`n Pi $CellContext`t],
")+(", (-16) $CellContext`n^(-1) Pi^(-1)
Sin[Rational[1, 2] $CellContext`n Pi $CellContext`t], "))"],
Editable->False]], "Print",
CellChangeTimes->{
3.867021468839582*^9, 3.8670240054842315`*^9, {3.8670252564133444`*^9,
3.8670252784364443`*^9}, 3.867026398185205*^9, 3.86702645252305*^9,
3.867029662216665*^9, 3.867030551525009*^9},
CellLabel->
"Durante la evaluaci\[OAcute]n de \
In[20]:=",ExpressionUUID->"02bcc6f7-37ff-4d5b-87a5-56a9bb6cbd20"]
}, Open ]]
}, Open ]],
Cell["\<\
In order to generate the plot of the result, the general formula is used to \
define a slightly modified version that introduces a maximum value to \
truncate the calculation up to the maximum (for this example there are \
calculated only the first 5 terms of the summation) since the original form \
has a summation that goes to infinite.\
\>", "Text",
CellChangeTimes->{{3.8670214869846864`*^9, 3.867021487474687*^9}, {
3.867021541778947*^9,
3.8670216564015007`*^9}},ExpressionUUID->"b8ec6403-411f-40df-a093-\
3b3942201fbf"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"F", "[",
RowBox[{"n_", ",", "t_"}], "]"}], "=",
RowBox[{
FractionBox[
RowBox[{"a0", "[", "n", "]"}], "2"], "+",
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"k", "=", "1"}], "n"],
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"an", "[", "k", "]"}], "*",
RowBox[{"Cos", "[",
RowBox[{"k", "*", "\[Omega]", "*", "t"}], "]"}]}], ")"}], "+",
RowBox[{"(",
RowBox[{
RowBox[{"bn", "[", "k", "]"}], "*",
RowBox[{"Sin", "[",
RowBox[{"k", "*", "\[Omega]", "*", "t"}], "]"}]}], ")"}]}],
")"}]}]}]}], ";"}], "\n",
RowBox[{