Here is the formula for the kernel:
I know that there is in-built function in R, that constructs the kernel, but I need to program the kernel density function myself.