Register to reply

Fourier series for (sin(x))^2

by Gza
Tags: fourier, series, sinx2
Share this thread:
Gza
#1
Apr27-05, 10:12 PM
Gza's Avatar
P: 525
Hey guys i was working on an algorithm for one of my CS classes that included working out the fourier series for the function f(x) = (sin(x))^2. it's been a few years since i've done anything like this, so I did some googling to refresh my memory of how to determine the fourier coefficients, and after some integrals and calculations, came up with:


f(x) = (1/2) + (1/2)cos(2x) + (1/2)sin(2x)

I graphed this along with f(x) = (sin(x))^2 and it looked different from it. I was wondering if someone can give me a correct answer to compare with what i came up with, or help with giving me a rough walkthru of the process. Thanks again.
Phys.Org News Partner Science news on Phys.org
Hoverbike drone project for air transport takes off
Earlier Stone Age artifacts found in Northern Cape of South Africa
Study reveals new characteristics of complex oxide surfaces
learningphysics
#2
Apr27-05, 10:38 PM
HW Helper
P: 4,125
The answer you got is incorrect.

The two identities you need are:

(sin(x))^2 + (cos(x))^2 =1

and

cos(2x) = 2(cos(x))^2 - 1

Use both of these to solve for (sin(x))^2 in terms of cos(2x).
OlderDan
#3
Apr28-05, 09:41 AM
Sci Advisor
HW Helper
P: 3,033
Quote Quote by Gza
Hey guys i was working on an algorithm for one of my CS classes that included working out the fourier series for the function f(x) = (sin(x))^2. it's been a few years since i've done anything like this, so I did some googling to refresh my memory of how to determine the fourier coefficients, and after some integrals and calculations, came up with:


f(x) = (1/2) + (1/2)cos(2x) + (1/2)sin(2x)

I graphed this along with f(x) = (sin(x))^2 and it looked different from it. I was wondering if someone can give me a correct answer to compare with what i came up with, or help with giving me a rough walkthru of the process. Thanks again.
One thing you should always check is to see if the symmetry of the component functions matches the symmetry of the function you are decomposing. The function you started with is an even function

f(-x) = f(x)

All the component functions must also be even functions. One of yours is not. You can often take advantage of symmetry to eliminate performing many of the integrals that have to be calculated to decompose a function.

Data
#4
Apr28-05, 02:45 PM
P: 998
Fourier series for (sin(x))^2

No integrals at all required here. You can either use the identities learningphysics gave, or use the exponential form of sine:

[tex]\sin{x} = \frac{e^{ix}-e^{-ix}}{2i}[/tex]

and just square it (and then convert back to sines and cosines).
OlderDan
#5
Apr28-05, 08:19 PM
Sci Advisor
HW Helper
P: 3,033
Quote Quote by Data
No integrals at all required here. You can either use the identities learningphysics gave, or use the exponential form of sine:

[tex]\sin{x} = \frac{e^{ix}-e^{-ix}}{2i}[/tex]

and just square it (and then convert back to sines and cosines).
That is true. My comment about integrals was a general comment about Fourier series where one often does have integrals to perform, and taking advatange of the symmetry can save work.
Data
#6
Apr28-05, 09:41 PM
P: 998
Indeed, I wasn't criticizing your reply at all

If you want to find the fourier series for x^n, for example, that symmetry can help a lot!


Register to reply

Related Discussions
Evaluation of Numerical series by Fourier series Calculus & Beyond Homework 7
Need help to find application of the Fourier series and Fourier Transforms! Introductory Physics Homework 8
Rom fourier transfom to fourier series Calculus & Beyond Homework 1
Fourier Series / Fourier Transform Question Electrical Engineering 6
The difference between Fourier Series, Fourier Transform and Laplace Transform General Physics 1