The functions exp() and atan() (exponent and arctangens) are part of the standard math library.
The linker complains that it cannot find them.

There are several way to solve this problem. The quickest would be to use g++ instead of gcc:
g++ -lm density.c -o density

Please try this first.