partial differential equations – Boundary Conditions Working Themselves Out

I tried solving an equation I had already solved via the regular separation of variables approach, $v_t = v_{xx}, v(0, t) = 0, v(10, t) = 0, v(x, 0) = 2x$, by applying the initial condition before applying the boundary conditions to see if it would work.

The separated equations are $begin{cases}dot T = lambda T \ X” = lambda Xend{cases}$, and the general solutions is $v = Ae^{lambda t}cos(sqrt{-lambda} x) + Be^{lambda t}sin(sqrt{-lambda} x)$. Applying the initial condition, $2x = Acos(sqrt{-lambda} x) + Bsin(sqrt{-lambda} x)$. Just knowing that the next step is supposed to be some flavor of Fourier Series immediately lets $lambda$ be solved by pattern matching, without applying the boundary conditions. Then, finding the Fourier Series of $f(x) = 2x$ reveals both $A$ and $B$, which is enough arrive at the final, particular solution. In other words, once I applied the initial condition, the boundary conditions became superfluous.

Why was I able to solve this problem without applying the boundary conditions? Are the boundary conditions really needed to solve separation of variables problems? It seems like applying them solves the same problem more slowly. Is the only reason to apply them to make it more obvious that the initial condition step is a Fourier Series problem?