I was working on a very simple 1D solving Poisson's Equation using a DFT and I found that I couldn't arrive to the solution analytically via this method, so I looked around for other methods and decided to try using the Discrete Sine Transform (DST) which is an offshoot of the DFT, specifically DST-I, and I arrived to the correct analytical solution (after accounting for the 1/2 scale factor). I don't know why this worked whereas the DFT method did not. It's great that this led to the solution, but it's worthless if I don't know when or why to use it over the other method.
So, could someone help me to understand when or why it's used?
To add context, the problem I used it on had the following setup: $$u_{xx} = 2, \ \ \ \ \ \ \ 0\le x_n \le 1, \ \ \ \ \ 0\le n\le N, N=3 \\u(0) = 0, u(1) = 1$$ The solution was simply $u(x_n) = x_n^2$.