What is the process for determining the Fourier series of (sin(x))^2?

AI Thread Summary
The discussion focuses on determining the Fourier series for the function f(x) = (sin(x))^2. The initial attempt yielded incorrect coefficients, prompting a request for clarification and assistance. Key identities, such as (sin(x))^2 + (cos(x))^2 = 1 and cos(2x) = 2(cos(x))^2 - 1, are suggested to properly express (sin(x))^2 in terms of cosine. Additionally, the importance of symmetry in the function and its components is emphasized, noting that all functions must share the same symmetry to avoid unnecessary calculations. The conversation concludes with a reminder that leveraging symmetry can simplify the process of finding Fourier series.
Gza
Messages
446
Reaction score
0
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.
 
Physics news on Phys.org
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).
 
Gza said:
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.
 
No integrals at all required here. You can either use the identities learningphysics gave, or use the exponential form of sine:

\sin{x} = \frac{e^{ix}-e^{-ix}}{2i}

and just square it (and then convert back to sines and cosines).
 
Data said:
No integrals at all required here. You can either use the identities learningphysics gave, or use the exponential form of sine:

\sin{x} = \frac{e^{ix}-e^{-ix}}{2i}

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.
 
Indeed, I wasn't criticizing your reply at all :smile:

If you want to find the Fourier series for x^n, for example, that symmetry can help a lot!
 
Thread 'Variable mass system : water sprayed into a moving container'
Starting with the mass considerations #m(t)# is mass of water #M_{c}# mass of container and #M(t)# mass of total system $$M(t) = M_{C} + m(t)$$ $$\Rightarrow \frac{dM(t)}{dt} = \frac{dm(t)}{dt}$$ $$P_i = Mv + u \, dm$$ $$P_f = (M + dm)(v + dv)$$ $$\Delta P = M \, dv + (v - u) \, dm$$ $$F = \frac{dP}{dt} = M \frac{dv}{dt} + (v - u) \frac{dm}{dt}$$ $$F = u \frac{dm}{dt} = \rho A u^2$$ from conservation of momentum , the cannon recoils with the same force which it applies. $$\quad \frac{dm}{dt}...
TL;DR Summary: I came across this question from a Sri Lankan A-level textbook. Question - An ice cube with a length of 10 cm is immersed in water at 0 °C. An observer observes the ice cube from the water, and it seems to be 7.75 cm long. If the refractive index of water is 4/3, find the height of the ice cube immersed in the water. I could not understand how the apparent height of the ice cube in the water depends on the height of the ice cube immersed in the water. Does anyone have an...
Back
Top