1

I have a sine wave plotted with points but I am having trouble making an equation that actually fits the points. I have made the sine wave as close as I could come to correct but I don't know the math to fix my issue. I was hoping someone knew how to get this sine wave right. All the information/data is in this desmos link: https://www.desmos.com/calculator/9fhqzipwfk

Byron E
  • 39
  • 5
  • I think it's clear that the function which exactly fits your points is $y = 2/\cos(x)$, since this is how you generated the points. – Doug Aug 25 '22 at 18:22
  • Yes, that fits the points but what I am really looking for is a wave that moves like the red wave that I have already made but is still on the points. – Byron E Aug 25 '22 at 18:27
  • As Doug mentioned, this is not possible. You want $\sin (f(x)) \cos x=const$ – Vasili Aug 25 '22 at 18:34
  • 4
    However, you can use Fourier series to get as close as you want to your function, it's just not going to be a simple sine. – Vasili Aug 25 '22 at 18:40
  • I don't mind how complex it is, I would just have to learn how to accomplish the task. – Byron E Aug 25 '22 at 18:46

1 Answers1

1

Any periodic function can be approximated by a Fourier series. In this case, the function is $f(x)=\frac{2}{\cos x}$. Note that this is even function so it can be represented as a cosine series:
$f(x)=\frac{a_0}{2}+\sum\limits_{n=1}^{\infty} a_n \cos(4nx)$ where $a_0=\frac{16}{\pi}\int\limits_0^{\frac{\pi}{4}} \frac{1}{\cos x}dx=\frac{8}{\pi}\log(3+2\sqrt{2}), a_n=\frac{16}{\pi}\int\limits_0^{\frac{\pi}{4}} \frac{ \cos 4nx}{\cos x}dx=a_0+\frac{16\sqrt 2}{\pi}\sum\limits_{i=0}^{n-1} (-1)^{n}\left(\frac{1}{4n+3}-\frac{1}{4n+1}\right)$.

If you are interested in how the integrals can be evaluated, please see this

Vasili
  • 10,690