### Using Fast Fourier Transforms to find derivatives

Write a subroutine, fdiff.m, which takes a function f on [-pi,pi], and returns fd, its derivative. Compute the derivative using the fast fourier transform.

To do this, you'll have to look in the guts of heat4.m or heat5.m or burgers.m

Choose a periodic function and verify that fdiff is computing the derivative correctly. How many mesh-points do you have to take before the error is at the level of round-off? Compare this to the finite-difference derivative with that many mesh-points.

Now choose a function that isn't periodic. How many mesh-points do you have to take before the error is at the level of round-off? Compare this to the finite-difference derivative with that many mesh-points.

### Using Crank-Nicolson to compute the heat equation

Modify both heat3.m and heat5.m to compute the approximate solutions using the Crank-Nicolson method. Demonstrate that both of your codes are O(dt^2) in time. Demonstrate that the code based on finite-differences is O(dx^2) in space.

### The Kuramoto-Sivashinsky equation

Consider the periodic Kuramoto-Sivashinsky equation

u_t = - u_xxxx - 10 u_xx + u_x^2 = L(u) + N(u)

where L is linear and N is nonlinear. Modify heat5.m to compute solutions of the K-S equation as follows:

(u_{i,j+1}-u_{i,j})/dt = -(u_xxxx)_{i,j+1} - 10 (u_xx)_{i,j} + N(u)_{i,j}

Look at burgers.m to see how to do the nonlinearity spectrally.

Why did I choose to do the linear terms the way I did above?

Why did I not bother to do a Crank-Nicolson on the linear terms?

Verify that your code is O(dt). Choose initial data and compute. Observe and discuss the evolution of the solution, as well as the evolution of the power spectrum.