Math Methods · homework mode

Custom Fourier & PDE Solver

Bring your own function. Type any f(x), choose the series your problem calls for — sine, cosine, or full — and read off the coefficients. Then send that function into the heat or wave equation as an initial condition and watch your solution evolve. Built for checking real PDE homework, separation-of-variables style.

Your function f(x) vs. its Fourier partial sum

f(x) partial sum (N terms)

Coefficients

Evolve as a PDE

u(x, 0) = f(x) → solution u(x, t)

0.50

Your function

Functions need parentheses: sin(x), exp(x). Use ^ for powers, pi for π. Available: sin cos tan exp log sqrt abs sinh cosh tanh sign.

Series type

Terms in the sum

12

Which series for which boundary condition?

This is the choice that trips up most homework. The series you expand in must match the boundary conditions of your PDE, because each one is built from the eigenfunctions those conditions allow:

Sine series — eigenfunctions sin(nπx/L), which vanish at both ends. Use it for Dirichlet conditions u(0)=u(L)=0 (a rod held at zero, a string pinned at both ends).
Cosine series — eigenfunctions cos(nπx/L), whose slope vanishes at both ends. Use it for Neumann conditions u′(0)=u′(L)=0 (insulated ends). Note the constant term survives forever in the heat equation — it's the average, the final steady temperature.
Full series — both sines and cosines on [−L, L], for periodic conditions.

How the solution evolves

Separation of variables gives each mode its own time factor, applied to the coefficient you computed: e^(−(nπ/L)²αt) for the heat equation (decay), or cos(nπct/L) for the wave equation (oscillation). Press Solve PDE and you're watching exactly your homework's analytic solution, summed term by term. Switch between heat and wave to see the same initial shape either diffuse away or vibrate forever.

Tips for checking answers

The coefficient panel prints the first several values — compare them directly to your hand-computed bₙ or aₙ. If a coefficient should be zero by symmetry (odd/even function), you'll see it come out ≈ 0 here. Raise N to watch convergence, and remember: a function with jumps converges slowly with Gibbs overshoot, while a smooth one nails it in a few terms. Pair this with the Fourier builder and the Heat & Wave lab.

EngineeringCandy · safe expression parser + numeric coefficients + separation-of-variables solution, all live · bring your own problem