Design of inhomogeneous slabs for filtering applications via closed form solutions of the reflection coefficient