区間 [-π,π] 上で定義された関数 f(x) に対し、
( a0 / 2 ) + Σ∞n=1( ancosnx + bnsinnx ) |
an = ( 1 / π ) ∫π-πf(x) cosnx dx ( n = 0 , 1 , 2 , ・・・)
bn = ( 1 / π ) ∫π-πf(x) sinnx dx ( n = 1 , 2 , 3 , ・・・) |
Sm (x) = s ( x , m ) = ( a0 / 2 ) + Σmn=1( ancosnx + bnsinnx ) |
>f : = x -> x^2
> a : = n -> ( 1/Pi ) * ( int ( f(x) * cos (n*x) , x=-Pi . . Pi ) ) > b : = n -> ( 1/Pi ) * ( int ( f(x) * sin (n*x) , x=-Pi . . Pi ) ) > s : = ( x , m ) - > a(0) / 2 + sum ( a(n) * cos (n*x) + b(n) * sin (n*x) , n=1 . . m ) |
> s ( x , 1 ) |
> plot ( s ( x , 1 ) , x = -Pi . . Pi ) |
> plot ( { f(x) , s ( x , 1 ) } , x = -Pi . . Pi ) |
> plot ( { f(x) , s ( x , 1 ) , s ( x , 5 ) , s ( x , 9 ) , s ( x , 13 ) } , x = -Pi . . Pi ) |
[正解例]
[正解例]
[正解例]