92 lines
3.1 KiB
Typst
92 lines
3.1 KiB
Typst
#import "@preview/physica:0.9.6": *
|
|
|
|
= problem 3
|
|
|
|
$
|
|
a_0(f') = 0, quad a_n (f') = n b_n (f), quad b_n(f') = -n a_n(f)
|
|
$
|
|
|
|
if $f(-pi) != f(pi)$ then the formulas don't work anymore, since there will be
|
|
a discreet jump every time the period is restarted. to fix the formulas we need
|
|
to account for this. let $[f] = f(pi) - f(-pi)$
|
|
$
|
|
cases(
|
|
a_0 (f') & = 1/(2 pi) integral_(-pi)^pi f'(x) dd(x)
|
|
= 1/(2 pi) [f(x)]_(-pi)^pi = [f]/(2 pi), ,
|
|
a_n (f') & = 1/pi integral_(-pi)^pi f'(x) cos(n x) dd(x) \
|
|
& = 1/pi ([f(x) cos(n x)]_(-pi)^pi
|
|
+ n integral_(-pi)^pi f(x) sin(n x) dd(x)) \
|
|
& = 1/pi ((-1)^n [f] + n pi b_n (f)) \
|
|
& = n b_n (f) + 1/pi (-1)^n [f], ,
|
|
b_n (f') & = - n a_n (f)
|
|
)
|
|
$
|
|
|
|
recall the fourier series for a $p$-periodic function $f$
|
|
$
|
|
f(x) approx f_N (x) = a_0 + sum_(n=1)^N
|
|
(a_n cos((2 pi)/p x) + b_n sin((2 pi)/p x))
|
|
$
|
|
where
|
|
$
|
|
cases(
|
|
a_0 = 1/p integral_p f(x) dd(x),
|
|
a_n = 2/p integral_p f(x) cos((2 pi)/p n x) dd(x),
|
|
b_n = 2/p integral_p f(x) sin((2 pi)/p n x) dd(x)
|
|
)
|
|
$
|
|
|
|
let $f(x) = sin^2(x) + 3 x^2 - 4 x + 5$ be periodically continued based on
|
|
$[-pi, pi]$.
|
|
|
|
notice that this series has a jump $[f] > 0$ so we need to use the modified
|
|
formulas we found above.
|
|
|
|
also remark that $sin^2(x) = (1 - cos(2x))/2$, which is already its fourier
|
|
series.
|
|
|
|
since fourier series are linear, we can compute the fourier series of each
|
|
term and we can use the provided properties to compute the coefficients using
|
|
the derivative of $f$.
|
|
$
|
|
f'(x) = dots.c + 6 x - 4
|
|
$
|
|
we then need to compute the fourier series for $x^2$, $x$ and $1$ using
|
|
$
|
|
"fourier"(1) & = cases(
|
|
a_0 (1) = 1/(2 pi) integral_(-pi)^pi 1 dd(x) = 1,
|
|
a_n (1) = 1/pi integral_(-pi)^pi cos(x) dd(x) = 0,
|
|
b_n (1) = 0
|
|
) \
|
|
"fourier"(x) & = cases(
|
|
a_0 (x) = 1/(2 pi) integral_(-pi)^pi x dd(x) = 0,
|
|
a_n (x) = 1/n (b_n (1)) = 0,
|
|
b_n (x) = 1/n (a_n (1) - 1/pi (-1)^n [x])
|
|
= 2/n (-1)^(n + 1)
|
|
) \
|
|
"fourier"(x^2) & = cases(
|
|
a_0 (x^2) = 1/(2 pi) integral_(-pi)^pi x^2 dd(x)
|
|
= 1/(6 pi) [x^3]_(-pi)^pi = 1/3 pi^2,
|
|
a_n (x^2) = -1/n b_n (2 x)
|
|
= -2/n b_n (x) = 4/n^2 (-1)^n,
|
|
b_n (x^2) = 1/n (a_n (2 x) - 1/pi (-1)^n [x^2]) = 0
|
|
)
|
|
$
|
|
|
|
combining these we get
|
|
$
|
|
"fourier"(f(x)) & = "fourier"(sin^2(x)) \
|
|
& + "fourier"(3 x^2) - "fourier"(4 x) + "fourier"(5) \
|
|
& = 1/2 (1 - cos(2 x)) + 3 "fourier"(x^2) \
|
|
& - 4 "fourier"(x) + 5 "fourier"(1) \
|
|
& = 1/2 (1 - cos(2 x)) x + cases(
|
|
a_0 (f(x)) & = 3 a_0 (x^2) - 4 a_0 (x) + 5 a_0 (1) \
|
|
& = pi^2 + 5,
|
|
a_n (f(x)) & = 12/n^2 (-1)^n,
|
|
b_n (f(x)) & = -8/n (-1)^(n+1) = 8/n (-1)^n
|
|
) \
|
|
& = pi^2 + 11/2 - 1/2 cos(2 x) \
|
|
& + sum_(n=1)^oo (12/n cos(n x)
|
|
+ 8 sin(n x))(-1)^n / n
|
|
$
|