estro
- 239
- 0
I'm trying to get Fourier series for some function however I get the same nonsense series each time:
<br /> f(x)=\begin{cases}<br /> 0, & \mbox{if x $\in [-\pi,0]$}\\<br /> x, & \mbox{if x $\in (0,\pi)$} \end{cases}<br />
<br /> \pi a_n=\int_{-\pi}^\pi f(x)cos(nx)dx=\int_{-\pi}^0 0 \cdot cos(nx)dx+\int_0^\pi xcos(nx)dx=\left.\left[\frac{xsin(nx)}{n}-\frac{cos(nx)} {n^2}\right]\right|_0^\pi<br />
<br /> =\frac{\pi sin(n\pi)}{n}-\frac{cos(n\pi)} {n^2} - \frac{0 sin(0)}{n}+ \frac {cos(0)} {n^2}=\frac {1-(-1)^n}{n^2}<br />
<br /> a_n=\frac{1-(-1)^n}{\pi n^2}<br />
<br /> \pi b_n=\int_{-\pi}^\pi f(x)sin(nx)dx=\int_{-\pi}^0 0 \cdot sin(nx)dx+\int_0^\pi xsin(nx)dx=\left. \left[-\frac{xcos(nx)}{n}-\frac{sin(nx)}{n^2}\right] \right|_0^\pi=-\frac{\pi (-1)^n}{n}<br />
<br /> b_n=-\frac{(-1)^n}{n}<br />
WolframAlpha suggests that I wrongly calculated the integral, however I used well know theorem:
\int p(x)f(x)dx=p \cdot F_1+p' \cdot F_2...
You can also see the same on this picture:
<br /> f(x)=\begin{cases}<br /> 0, & \mbox{if x $\in [-\pi,0]$}\\<br /> x, & \mbox{if x $\in (0,\pi)$} \end{cases}<br />
<br /> \pi a_n=\int_{-\pi}^\pi f(x)cos(nx)dx=\int_{-\pi}^0 0 \cdot cos(nx)dx+\int_0^\pi xcos(nx)dx=\left.\left[\frac{xsin(nx)}{n}-\frac{cos(nx)} {n^2}\right]\right|_0^\pi<br />
<br /> =\frac{\pi sin(n\pi)}{n}-\frac{cos(n\pi)} {n^2} - \frac{0 sin(0)}{n}+ \frac {cos(0)} {n^2}=\frac {1-(-1)^n}{n^2}<br />
<br /> a_n=\frac{1-(-1)^n}{\pi n^2}<br />
<br /> \pi b_n=\int_{-\pi}^\pi f(x)sin(nx)dx=\int_{-\pi}^0 0 \cdot sin(nx)dx+\int_0^\pi xsin(nx)dx=\left. \left[-\frac{xcos(nx)}{n}-\frac{sin(nx)}{n^2}\right] \right|_0^\pi=-\frac{\pi (-1)^n}{n}<br />
<br /> b_n=-\frac{(-1)^n}{n}<br />
WolframAlpha suggests that I wrongly calculated the integral, however I used well know theorem:
\int p(x)f(x)dx=p \cdot F_1+p' \cdot F_2...
You can also see the same on this picture:
Last edited: